tvnamer icon indicating copy to clipboard operation
tvnamer copied to clipboard

Tidy download directory once tvshow video file renamed and moved.

Open bignellrp opened this issue 10 years ago • 4 comments

Not sure if i'm doing this correctly but i have a feature request.

Some tv show downloads have directories and other unneeded files left in the download dir. Could the tvnamer have an option to tidy the download dir once video file has been renamed and moved?

E.g. downloaded/Lost.S01.E01.folder/Lost.S01.E01.xrrp.720p.cloud.mkv

Renamed and moved:

tvshows/Lost/Season\ 01/Lost.S01.E01.mkv

Folder remains:

ls downloaded/ downloaded/Lost.S01.E01.folder/

Option to delete the folder:

rm -rf downloaded/Lost.S01.E01.folder/

bignellrp avatar Oct 19 '14 09:10 bignellrp

There is no way to safely recognize "unneeded" files (whatever it means). This would bring more problems than it would solve. You could try remove empty directories though.

lahwaacz avatar Oct 19 '14 09:10 lahwaacz

Yes, recognising unneeded files would be hard work but an option to delete empty directories would be handy. Thank you for such a fast reply!

bignellrp avatar Oct 19 '14 09:10 bignellrp

I think this would be much tidier done as part of a wrapper script, e.g

  1. Run tvnamer on the folder
  2. Have tvnamer move the good files into a specific folder
  3. Remove the original directory

As a separate script specific to your setup (file layout etc), it should be easy to script, however integrating this into tvnamer as a generically useful feature would be very difficult (and increases the scope of what tvnamer is, which shouldn't extend much beyond just "here's a filename, give it a better name")

SickBeard has features like this, might be worth looking into

dbr avatar Oct 26 '14 12:10 dbr

As a shell workaround, find ./foo/ -empty -delete will do what you want, recursively.

bensbrowning avatar Nov 29 '14 02:11 bensbrowning