Skip to content

Instantly share code, notes, and snippets.

@JasperE84
Created October 28, 2017 13:01
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JasperE84/2570dce43a4fe3e8e0feaa3791091d66 to your computer and use it in GitHub Desktop.
Save JasperE84/2570dce43a4fe3e8e0feaa3791091d66 to your computer and use it in GitHub Desktop.
TVHeadend post-remove script for automatic removal of edl, log and logo files as generated by comskip
#!/bin/bash
#
# TVHeadend post-remove script to remove log/edl/logo.txt files (generated by comskip) from recording dir
# TVHeadend config: Configuration -> Recording -> Select profile -> Add the following in setting "Post-remove command": /home/USER/PATH/comskip-pd.sh "%f"
#
INPUTVIDEO="$1" # Full path to recording, i.e. /home/user/Videos/News.ts
FILENAME=$(basename "$INPUTVIDEO")
BASENAME="${FILENAME%.*}"
DIRNAME=`/usr/bin/dirname "$INPUTVIDEO"`
EDLFILE="$DIRNAME/$BASENAME.edl"
LOGFILE="$DIRNAME/$BASENAME.log"
TXTFILE="$DIRNAME/$BASENAME.txt"
LOGOFILE="$DIRNAME/$BASENAME.logo.txt"
/bin/rm "$EDLFILE"
/bin/rm "$LOGFILE"
/bin/rm "$TXTFILE"
/bin/rm "$LOGOFILE"
@RKCRLR
Copy link

RKCRLR commented Dec 1, 2020

I have comskip set to only place a .txt file in the recordings folder. Does this script wait until the recording has been deleted before the comskip .txt file gets removed?

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment