Opened 7 years ago

Last modified 5 years ago

#4262 new Enhancement

Delete individual files

Reported by: x190 Owned by:
Priority: Normal Milestone: None Set
Component: Transmission Version: 2.31
Severity: Normal Keywords: delete individual files, patch-needed
Cc:

Description

Currently one has to jump through hoops in order to delete and deselect a specific file from an in progress torrent. Therefore, the ability to delete individual files from the Inspector (Mac Client) or the interface of choice for other users would be a major benefit.

Change History (20)

comment:1 follow-up: Changed 7 years ago by livings124

The files can already be deselected. Deleting could cause issues if there's overlap, so that's not the best idea.

comment:2 Changed 7 years ago by jordan

We would need to collect the unwanted fragments separately as per #532

comment:3 in reply to: ↑ 1 Changed 7 years ago by x190

Replying to livings124:

The files can already be deselected.

Not if they're at 100%. That's the frustrating part. You have to ditch the data, then verify the torrent and then find and deselect it in the Inspector to prevent re-download.

Deleting could cause issues if there's overlap, so that's not the best idea.

As Jordan says, #532 neatly takes care of this issue. Sadly, I neglected to grab the patch from the previous "Delete Files" ticket.

comment:4 Changed 7 years ago by livings124

I could see your point.

The patch and corresponding ticket were both a mess, hence the deleting.

comment:5 Changed 6 years ago by x190

  • Keywords delete individual files added

comment:6 Changed 6 years ago by x190

  • Keywords patch needed added

[files,] patch needed added [files removed]

Last edited 6 years ago by x190 (previous) (diff)

comment:7 Changed 6 years ago by schwern

I'm adding a "me too".

This is one of the few important features I've found lacking in Transmission. I've preciously used Vuze and uTorrent which support this. They get around the overlap problem by simply keeping the files which overlap around. Sort of the same way that Transmission will download a file I've left unchecked if it has to.

Downloading large torrents can chew up a lot of hard drive space (a whole TV series can be 100 gigs, a lot for a laptop) when seeding to completion. The process of removing already downloaded files, as pointed out by x190, is obtuse and requires a time consuming re-verification.

I've given the full argument on the forums.

I think there's three separate questions here:

1) Is the problem valid?

That is, do large torrents consuming a lot of disk space is inconvenience Transmission users?

2) Is the solution valid?

Will allowing users to delete individual files solve the problem?

3) What is the technical change necessary?

How do you patch Transmission to let users delete files?

By considering these separately, we can break it down and avoid arguing past each other. If we can't agree that the problem is a problem, then there's no point talking about a solution nor a patch. If we don't agree on the solution to the problem, maybe we can find another solution... but at least we know to find another solution. If we can agree on the problem and solution, then anybody can come along and write the patch. But there's no point talking about how its to be done if we don't agree what should be done or even if it should be done at all.

A project member should be able to be answer 1 and 2 immediately, and maybe sketch out the issues involved with 3.

comment:8 Changed 6 years ago by cfpp2p

Lurking in the back-round there is a rough-cut patch for deleting individual files. Someone with enthusiasm needs to help out with a serious effort to finish the patch up. Along with the functioning #532 patch we'd have a real nice functionality.

comment:9 Changed 5 years ago by x190

Trash/restore files by toggling in Mac Client Inspector (or Web Interface). ============================================================================ Should be easy to adapt for Linux. Currently, it is for r11889 and OS X and requires piece_temp.7 plus toggle patches from #532. Needs updating to current trunk.

Code gets 0 checksum failures while testing with a clean torrent and tries to minimize data loss and also keep the pieces folder as clean as possible while making all data easily and automatically restorable from the Trash. ============================================================================

Last edited 5 years ago by x190 (previous) (diff)

comment:10 Changed 5 years ago by cfpp2p

I'm testing slightly changed for Linux, patched to 2.21+ (11889) as per above attachment and I must say the functionality and stability is quite up to par!

Works well with Transmission Remote GUI.

Last edited 5 years ago by cfpp2p (previous) (diff)

comment:11 Changed 5 years ago by jordan

On Linux, you'd want to use $XDG_DATA_HOME/Trash/ as the trash directory, or $HOME/.local/share/Trash if $XDG_DATA_HOME is empty or not set.

comment:12 Changed 5 years ago by jordan

A few other issues:

  • The 'sub' string on patch line 95 is leaked when reassigned by patch line 105
  • The scope of 'oldpath' on patch line 94 can be moved deeper to patch line 121
  • The path built on patch line 98 is leaked
  • The path built on patch line 106 is leaked
  • The two paths built on patch line 54 are leaked
  • The two paths built on patch line 59 are leaked
  • The 'sub' string on patch line 133 is leaked when reassigned by patch line 136
  • I'm a little confused by the comment before tr_cpReset() -- tr_torrentVerify() doesn't give clean verification without this call?
  • The 'sub' string on patch line 53 is leaked when reassigned by patch line 58
  • The scope of 'newpath' on patch line 48 can be moved deeper to patch line 53
  • The indentation of setFileDND() seems to be nonexistent
  • The scope of 'd' on patch line 320 can be moved deeper to patch line 331
  • The scope of 'renamed' on patch line 324 can be moved deeper to patch line 345
  • The scope of 'oldpath', 'newpath' on patch line 326, 327 can be moved deeper to patch line 345
  • On patch line 354, don't need to check for NULL before freeing the list
  • Two strings per file are leaked on patch line 346, 347

comment:13 Changed 5 years ago by x190

Just an oversight, I assure you. I've always been a firm believer in freeing C-Strings whenever possible (G-Strings too). :lol:

"I'm a little confused by the comment before tr_cpReset() -- tr_torrentVerify() doesn't give clean verification without this call?"

That's right. The sending peers get blamed for the resulting corrupt pieces but the fault occurs in Transmission. I believe this is an issue with manual deletion/verify as well. This can lead to a series of problems such as Transmission incorrectly banning peers and 'forgetting' to ask for pieces for certain files leading to unnecessarily 'stalled' transfers. #532 + #4262 avoid these issues. Besides, why are these features not considered essential for music torrents which may have 1000s of files?

Last edited 5 years ago by x190 (previous) (diff)

comment:14 Changed 5 years ago by cfpp2p

Thanks x190 for your recent fix! The patch has had a slew of memory leaks fixed, plus other minor issues fixed. A trash directory for embedded systems. Linux and Mac use trash for deleted files. A test version patched to 2.21+ (11889) is available at https://github.com/cfpp2p/transmission/commits/TurboT Wiki is here: https://github.com/cfpp2p/transmission/wiki/TurboT

comment:15 Changed 5 years ago by jordan

Why does SYS_DARWIN use per-torrent subdirectories under ~/.Trash/pcTMP but other platforms don't?

comment:16 Changed 5 years ago by cfpp2p

SYS_DARWIN ignores settings.json "trash-temp-dir" On other systems for example, if we set settings.json value "trash-temp-dir": "\user1\.local\share\Trash", the results are as follows and do include per-torrent subdirectories:

\user1\.local\share\Trash\test-torrent.5076aad395897e93\.Trash\pcTMP\ for deleted temporary pieces.

\user1\.local\share\Trash\test-torrent.5076aad395897e93\.Trash\test-torrent\ for deleted files.

embedded systems may not have a "Trash" so if settings.json value was set to "trash-temp-dir": "\user1\share\hdd\data\8gb\T-Trash", and we can use a pseudo trash directory for the embedded system.

comment:17 Changed 5 years ago by jordan

  1. Why does SYS_DARWIN ignore trash-temp-dir? It seems like the distinction is between OS X and embedded systems, but transmission-gtk and transmission-qt are end-user apps like the Mac client.
  1. If tr_sessionGetTrashTempDir() returned getenv("HOME") when compiled with -DSYS_DARWIN, you could get rid of a bunch of #ifdefs in usePieceTemp() and tr_torrentRemovePieceTemp(). For that matter you could move the #ifdef further up the chain to tr_sessionGetDefaultSettings() where the default values are generated.
Last edited 5 years ago by jordan (previous) (diff)

comment:18 Changed 5 years ago by mike.dld

  • Keywords patch-needed added; patch needed removed
Note: See TracTickets for help on using tickets.