Feature #1761
open
Possibility to also delete extra files when deleting recording
Added by Driss Louriagli about 12 years ago.
Updated over 11 years ago.
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!
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.
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
- Category changed from Infrastructure to PVR / DVR
Also available in: Atom
PDF