Project

General

Profile

Feature #1761

Possibility to also delete extra files when deleting recording

Added by Driss Louriagli over 11 years ago. Updated almost 11 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
PVR / DVR
Target version:
-
Start date:
2013-06-27
Due date:
% Done:

0%

Estimated time:

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

#1

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.

#2

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
#3

Updated by Adam Sutton almost 11 years ago

  • Category changed from Infrastructure to PVR / DVR

Also available in: Atom PDF