From 53c208f892ad378efebba5974dda374f5575f6bf Mon Sep 17 00:00:00 2001 From: Britney Fransen Date: Wed, 24 Mar 2010 18:53:58 -0500 Subject: change name of removecommercials.sh script in twk_general.pl and remove removecommercials package because it was moved to linhes-scripts. Closes #459 --- abs/core-testing/tweaker/PKGBUILD | 4 +- abs/core-testing/tweaker/bin/twk_general.pl | 2 +- abs/extra-testing/removecommercials/PKGBUILD | 11 -- .../removecommercials/removecommercials | 195 --------------------- 4 files changed, 4 insertions(+), 208 deletions(-) delete mode 100755 abs/extra-testing/removecommercials/PKGBUILD delete mode 100755 abs/extra-testing/removecommercials/removecommercials diff --git a/abs/core-testing/tweaker/PKGBUILD b/abs/core-testing/tweaker/PKGBUILD index 79fc20d..85df000 100644 --- a/abs/core-testing/tweaker/PKGBUILD +++ b/abs/core-testing/tweaker/PKGBUILD @@ -1,6 +1,6 @@ pkgname=tweaker pkgver=1 -pkgrel=55 +pkgrel=56 pkgdesc="applies tweaks to the baseline configuration and attempts to optimize settings for the hardware it finds" arch=('i686' 'x86_64') @@ -41,3 +41,5 @@ build() { # Copy our tweaker Perl modules for general use install -m0555 lib/Tweaker/* $startdir/pkg/usr/lib/perl5/vendor_perl/Tweaker/ } +md5sums=('77fab526e866b273091e6816135ef25f' + 'e897b87dd308f9562d0867de9fab2de0') diff --git a/abs/core-testing/tweaker/bin/twk_general.pl b/abs/core-testing/tweaker/bin/twk_general.pl index 23572bc..f89912c 100755 --- a/abs/core-testing/tweaker/bin/twk_general.pl +++ b/abs/core-testing/tweaker/bin/twk_general.pl @@ -410,7 +410,7 @@ sub implement_option { change_or_make_setting('UserJob1', 'myth2ipod \"%DIR%\" \"%FILE%\"'); change_or_make_setting('UserJob2', 'myt2xvid3 \"%DIR%\" \"%FILE%\"'); change_or_make_setting('UserJob3', 'myth2x264 \"%DIR%/%FILE%\" \"%TITLE% - %SUBTITLE%\" \"%CHANID%\" \"%STARTTIME%\" \"%JOBID%\"'); - change_or_make_setting('UserJob4', 'removecommercials \"%DIR%\" \"%FILE%\" \"%CHANID%\" \"%STARTTIME%\" \"%JOBID%\"'); + change_or_make_setting('UserJob4', 'removecommercials.sh \"%DIR%\" \"%FILE%\" \"%CHANID%\" \"%STARTTIME%\" \"%JOBID%\"'); change_or_make_setting('UserJobDesc1', 'Transcode for iPod'); change_or_make_setting('UserJobDesc2', 'Transcode to xvid'); change_or_make_setting('UserJobDesc3', 'Transcode to h264'); diff --git a/abs/extra-testing/removecommercials/PKGBUILD b/abs/extra-testing/removecommercials/PKGBUILD deleted file mode 100755 index 312f965..0000000 --- a/abs/extra-testing/removecommercials/PKGBUILD +++ /dev/null @@ -1,11 +0,0 @@ -pkgname=removecommercials -pkgver=0.1 -pkgrel=1 -arch=("i686") -pkgdesc="A multimedia framework based on the MPEG-4 Systems standard" -source=( removecommercials ) - -build() { - cd $startdir - install -D -m 755 removecommercials $startdir/pkg/usr/bin/removecommercials -} diff --git a/abs/extra-testing/removecommercials/removecommercials b/abs/extra-testing/removecommercials/removecommercials deleted file mode 100755 index d7b910f..0000000 --- a/abs/extra-testing/removecommercials/removecommercials +++ /dev/null @@ -1,195 +0,0 @@ -#!/bin/sh -# remove commercials from recording -# version 0.1 - -# usage: -# first parameter must be %DIR% of the recording -# second parameter must be %FILE% of the recording -# third parameter must be %CHANID% -# fourth parameter must be %STARTTIME% -# fifth parameter must be %JOBID% for the User Job status to be updated in MythTV -# in the mythtv setup screen invoke this script like this: -# MYTHTV User Job Command: -# /usr/LH/bin/removecommercials "%DIR%" "%FILE%" "%CHANID%" "%STARTTIME%" "%JOBID%" - -# Auguments passed from command line -VIDEODIR=$1 -FILENAME=$2 -CHANID=$3 -STARTTIME=$4 -JOBID=$5 - -# database settings -BACKEND_HOSTNAME=${BACKEND_HOSTNAME:-"localhost"} -DBUSERNAME=${DBUSERNAME:-"mythtv"} -DBPASSWORD=${DBPASSWORD:-"mythtv"} -SQLCMD="mysql -u $DBUSERNAME --password=$DBPASSWORD -h $BACKEND_HOSTNAME mythconverg -e" - -#------FUNCTIONS--------------- -update_comment() -# Arg_1 = COMMENT -{ -if [ $NO_JOBID = 0 ]; then - `$SQLCMD "update jobqueue set comment=\"$1\" where id=\"$JOBID\";"` -fi -} - -update_status() -# Arg_1 = status code -{ -if [ $NO_JOBID = 0 ]; then - `$SQLCMD "update jobqueue set status=\"$1\" where id=\"$JOBID\";"` -fi -} - -check_myth_jobcmds() -# check the myth database for stop pause or resume commands -{ -if [ $NO_JOBID = 0 ]; then - CURRENT_CMD=`$SQLCMD "select cmds from jobqueue where id=\"$JOBID\";" | sed '/[0-9]/!d'` - case "$CURRENT_CMD" in - # JOB_RUN - 0) ;; - # JOB_PAUSE - 1) update_status 6 - kill -s STOP $TPID ;; - # JOB_RESUME - 2) update_status 4 - `$SQLCMD "update jobqueue set cmds=\"0\" where id=\"$JOBID\";"` - kill -s CONT $TPID ;; - # JOB_STOP - 4) update_status 5 - `$SQLCMD "update jobqueue set cmds=\"0\" where id=\"$JOBID\";"` - kill -9 $TPID - clean_up_files - echo "Cancelled" - update_status 320 - exit ;; - esac -fi -} - -check_background_progress() -#check progress in background -{ -while [ `tail -1 $STATUSFILE | grep -c "Done"` = 0 ] -do - sleep 5 - check_myth_jobcmds - current_status=`tail -1 $STATUSFILE` - if [ `expr match "$current_status" '.*\complete'` -ne 0 ]; then - prog_percent=`echo "$current_status" | awk '{print $3}'` - if [ -n "$prog_percent" ]; then - echo "Removing Commercials - $prog_percent Completed" - update_comment "Removing Commercials - $prog_percent Completed" - fi - fi -done -} - -get_pid() -{ -process_name="" -i1=1 -while [ "$process_name" != "found" ]; do - if [ "`ps $TPID | grep mythtranscode | sed 's_.*\(mythtranscode\).*_\1_'`" = "mythtranscode" ]; then - process_name="found" - else - TPID=`expr $TPID + 1` - fi - i1=`expr $i1 + 1` - if [ $i1 -gt 20 ]; then - break - fi -done -} - -clean_up_files() -# clean up left over files -{ -unlink $TMPFILE 2> /dev/null -unlink $TMPFILE.map 2> /dev/null -unlink $STATUSFILE 2> /dev/null -unlink $VIDEODIR/$FILENAME.tmp 2> /dev/null -} - -#-------MAIN SCRIPT------------ -# check if %JOBID% is passed from command line -JOBID=$5 -if [ -z "$JOBID" ]; then - NO_JOBID=1 -else - NO_JOBID=0 -fi -# check if file is a .mpg -if [ `expr match "$FILENAME" '.*\.mpg'` -ne 0 ]; then - MPEG="--mpeg2" -else - MPEG="" -fi - -# create temp filename so multiple instances won't conflict -TMPNAME=rmvCOMMS-$$ -TMPFILE=$VIDEODIR/$FILENAME-$$ -STATUSFILE=/myth/tmp/$TMPNAME-status.log - -touch $STATUSFILE - -update_status 4 - -check_myth_jobcmds - -# check for cutlist -MYTHCOMMFRAMES=`mythcommflag --getcutlist -f $VIDEODIR/$FILENAME | grep 'Cutlist:' | cut -d \ -f 2` -if [ -n "$MYTHCOMMFRAMES" ]; then - echo "Extracting cutlist..." - update_comment "Removing Commercials..." - ( /usr/bin/nice -n19 /usr/bin/mythtranscode -c $CHANID -s $STARTTIME -o $TMPFILE $MPEG --honorcutlist --showprogress > $STATUSFILE 2>&1 ; echo "Done" >> $STATUSFILE ) & - TPID=$! - get_pid - check_background_progress - ERROR=$? - if [ $ERROR -ne 0 ]; then - echo "Transcoding failed for ${FILENAME} with error $ERROR" - exit $ERROR - fi - - check_myth_jobcmds - # move temp file to output location - echo "Moving file..." - update_comment "Moving file..." - if [ `$SQLCMD "select data from settings where value='SaveTranscoding';" | sed '/[0-9]/!d'` = 1 ]; then - echo "DB is set to save transcodeing" - mv $VIDEODIR/$FILENAME $VIDEODIR/$FILENAME.old - fi - mv $TMPFILE $VIDEODIR/$FILENAME - - # file has changed, rebuild index - echo "Rebuilding index..." - update_comment "Rebuilding index..." - mythcommflag -c $CHANID -s $STARTTIME --rebuild - ERROR=$? - if [ $ERROR -ne 0 ]; then - echo "Rebuilding seek list failed for ${FILENAME} with error $ERROR" - exit $ERROR - fi - - # remove old cutlist - echo "Removing old cutlist..." - update_comment "Removing old cutlist..." - mythcommflag -c $CHANID -s $STARTTIME --clearcutlist - ERROR=$? - if [ $ERROR -eq 0 ]; then - # Fix the database entry for the file - `$SQLCMD UPDATE recorded SET cutlist = 0, filesize = $(ls -l $VIDEODIR/$FILENAME | awk '{print $5}') WHERE basename = '$FILENAME';` > /dev/null - else - echo "Clearing cutlist failed for ${FILENAME} with error $ERROR" - exit $ERROR - fi - clean_up_files - echo "Commercials Removed" - update_status 272 - update_comment "Sucessfully Completed." -else - echo "No cutlist found." -fi -- cgit v0.12