tvnamer
tvnamer copied to clipboard
Tidy download directory once tvshow video file renamed and moved.
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/
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.
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!
I think this would be much tidier done as part of a wrapper script, e.g
- Run tvnamer on the folder
- Have tvnamer move the good files into a specific folder
- 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
As a shell workaround, find ./foo/ -empty -delete
will do what you want, recursively.