Feature #1761
Possibility to also delete extra files when deleting recording
0%
Description
When deleting a recording it would be nice if any extra files (same name, different extension) would also be deleted.
Example:
I'm using comskip on all recordings and that generates (in my case) .edl, .txt and .log files.
They are currently not deleted when I delete a recording in the web frontend or via XBMC.
Perhaps an extra configuration field in the web frontend where we can specify file extensions to delete together with the recording?
Thanks for the awesome work!
History
Updated by Driss Louriagli over 11 years ago
Come to think of it, this could be handled by the "Post-processor command" script, if that function is changed slightly to be a "Recording event command", and is called for different recording events in tvh, e.g.:
- started
- finished
- cancelled
- deleted
That way it's up to the user, and no special handling is needed within tvh itself.
Updated by ruud - over 11 years ago
Hi,
not sure this is the best place to share this but here it comes :)
I created a script to do just that. Script is run daily via cronjob. The script that runs comskip already deletes all files exept the .txt file that holds the result.
Files deleted are .mkv or .ts (dependent in which format the recording was done / converted to)
Hope this helps
#!/bin/sh # Cleanup Comskip files for deleted recordings FILES=...your directory goes here.../*.txt for f_txt in $FILES do fext=${#f_txt} let fext-=4 f_ts=${f_txt:0:fext}.ts f_mkv=${f_txt:0:fext}.mkv if [ ! -f "$f_ts" ] && [ ! -f "$f_mkv" ]; then echo "${f_txt:0:fext} not found! Deleting Comskip file" rm "$f_txt" fi done