Opened 10 years ago

Closed 10 years ago

#1510 closed Enhancement (fixed)

[PATCH] New RPC arguments to torrent-remove to delete files too

Reported by: kysucix Owned by: charles
Priority: Normal Milestone: 1.50
Component: Daemon Version: 1.40
Severity: Normal Keywords: daemon patch
Cc:

Description

New rpc argument to "torrent-remove" method to allow deleting files as in transmission gui. Example:

{
    "arguments": {
        "delete-file": 1, 
        "ids": 1
    }, 
    "method": "torrent-remove"
}

transmission-remote has a new parameter -R (or --remove-and-delete). Rpc documentation is updated.

Attachments (3)

delete-file.diff (3.8 KB) - added by kysucix 10 years ago.
delete-local-data.diff (5.2 KB) - added by charles 10 years ago.
second revision
delete-local-data.2.diff (5.3 KB) - added by kysucix 10 years ago.
Delete file when status application returns a status of TR_RPC_NOREMOVE

Download all attachments as: .zip

Change History (9)

Changed 10 years ago by kysucix

comment:1 Changed 10 years ago by kysucix

  • Status changed from new to assigned
  • Summary changed from New RPC arguments to torrent-remove to delete files too to [PATCH] New RPC arguments to torrent-remove to delete files too

Changed 10 years ago by charles

second revision

comment:2 Changed 10 years ago by charles

  • Milestone changed from 1.50 to Sometime

Pretty good patch. :)

Attached is a second revision with minor minor changes:

  • "files" has been replaced with "local-data" for consistency's sake.
  • added documentation to transmission-remote's man page
  • added tr_torrentDeleteLocalData() to encapsulate the removal
  • make sure there's not a dangling file pointer in fdlimit before we unlink the files
  • give "torrent-remove" its own section next to "torrent-add" in the spec

Both patches share a bug that needs to be resolved before this goes into trunk: if the server application (daemon, gtk+, mac) returns a status of TR_RPC_NOREMOVE to indicate that it'll delete the torrent itself, then the files will never get deleted. The mac client always returns TR_RPC_NOREMOVE.

comment:3 Changed 10 years ago by charles

  • Owner kysucix deleted
  • Status changed from assigned to new

Changed 10 years ago by kysucix

Delete file when status application returns a status of TR_RPC_NOREMOVE

comment:4 Changed 10 years ago by charles

  • Milestone changed from Sometime to 1.50
  • Owner set to charles
  • Status changed from new to assigned

comment:5 Changed 10 years ago by charles

committed to trunk in r7331.

comment:6 Changed 10 years ago by charles

  • Resolution set to fixed
  • Status changed from assigned to closed
Note: See TracTickets for help on using tickets.