From 484dfaba46ab1f1fcc46c65d08620d73f16b62b3 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Tue, 4 Sep 2018 23:54:24 +0200 Subject: [PATCH] - pr-auto-timer: upgrade to v0.41 --- .../auto-record-cleaner.rules.template | 2 +- archive-sources/pr-auto-timer/pr-auto-timer | 74 +++++++++++-------- .../pr-auto-timer.rules.template | 2 +- make/image-update.mk | 7 +- 4 files changed, 51 insertions(+), 34 deletions(-) diff --git a/archive-sources/pr-auto-timer/auto-record-cleaner.rules.template b/archive-sources/pr-auto-timer/auto-record-cleaner.rules.template index 2d0286ad..944cfe11 100644 --- a/archive-sources/pr-auto-timer/auto-record-cleaner.rules.template +++ b/archive-sources/pr-auto-timer/auto-record-cleaner.rules.template @@ -44,4 +44,4 @@ ## the custom directory 'oldest' #/mnt/autofs/record/sky/,1000;oldest -# Don't forget the the newline after the last entry. +# Don't forget the newline after the last entry. diff --git a/archive-sources/pr-auto-timer/pr-auto-timer b/archive-sources/pr-auto-timer/pr-auto-timer index 35fa7564..2a201c3e 100755 --- a/archive-sources/pr-auto-timer/pr-auto-timer +++ b/archive-sources/pr-auto-timer/pr-auto-timer @@ -5,7 +5,7 @@ # Copyright (C) 2012-2013 Patrick Reinhardt, pr-cs reinhardtweb.de # 2013-2014 nadine # 2014 LtCmdrLuke -# 2013-2017 NI-Team +# 2013-2018 NI-Team # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -26,10 +26,20 @@ # Timer rules: /var/tuxbox/config/pr-auto-timer.rules # Neutrino plugin: /lib/tuxbox/plugins/pr-auto-timer.{sh,cfg} -VERSION=0.40a +VERSION=0.41 # Changelog: # +# 0.41 by vanhofen (NI-Team) +# -fix search-code in find_show_by_regex() +# -minor format changes in logging +# -fix new movies on Sky Cinema; align to new format on website again +# -fix another arithmetic syntax error +# +# 0.40b by tewsbo (NI-Team) +# -add Sky Stars to sky_exclude_channels +# -fix arithmetic syntax error +# # 0.40a by tewsbo (NI-Team) # -fix msgbox-calls for larger OSD-resolutions # @@ -561,14 +571,8 @@ scale2res() ####################################################################################### #BEGIN SECTION "Initialization" -init_config() { - #Parse config file (default: /var/tuxbox/config/pr-auto-timer.conf) - if [ -e $CONFIG_FILE ]; then - source $CONFIG_FILE 2>/dev/null - fi - - - # Initialize the logfile first, so we can write to it... +init_log() { + # Initialize the logfile, so we can write to it ... if [ ! -d "${LOG_FILE%/*}" ]; then case $LOG_FILE in [oO][fF][fF]) @@ -579,7 +583,18 @@ init_config() { ;; esac fi - echo -e "\n\n========================== New log started at $(date) ======================================" >> $LOG_FILE + + if [ "$LOG_FILE" != "" -a ! -e "$LOG_FILE" ]; then + # Create logfile + touch $LOG_FILE + fi +} + +init_config() { + #Parse config file (default: /var/tuxbox/config/pr-auto-timer.conf) + if [ -e $CONFIG_FILE ]; then + source $CONFIG_FILE 2>/dev/null + fi # Check the settings and reset them to default if unset or invalid case $MAX_DIFF_MINS in @@ -670,7 +685,7 @@ init_config() { # Prepare some internal variables RULE_FILES="$RULE_FILE $RULE_FILE_EXT" - max_diff_secs=$(( $MAX_DIFF_MINS \* 60 )) + max_diff_secs=$(( $MAX_DIFF_MINS * 60 )) } init_temp() { @@ -1261,7 +1276,7 @@ find_show_by_regex() { } } - if (find_option = "all") + if (find_option == "all") { if ( (exclude_matches > 0) && (exclude_counter == exclude_matches) ) { @@ -1269,7 +1284,7 @@ find_show_by_regex() { show_found = false; } } - else if (find_option = "one") + else if (find_option == "one") { if ( (exclude_matches > 0) && (exclude_counter >= 1) ) { @@ -1293,7 +1308,7 @@ find_show_by_regex() { } } - if (find_option = "all") + if (find_option == "all") { if ( (include_counter > 0) && (include_counter != include_matches) ) { @@ -1301,7 +1316,7 @@ find_show_by_regex() { show_found = false; } } - else if (find_option = "one") + else if (find_option == "one") { if ( (include_counter > 0) && (include_matches < 1) ) { @@ -2219,7 +2234,7 @@ get_sky_moviedata() { next; } - /

|\/serie\// { + /|\/serie\// { next; } @@ -2322,7 +2337,7 @@ parse_sky_cinema() { end_ifs_block sky_start_sec_add=0 - sky_exclude_channels="Active Action Comedy Emotion Family Hits Nostalgie Uno" + sky_exclude_channels="Active Action Comedy Emotion Family Hits Nostalgie Uno Stars" case $(echo $sky_cinema | awk '{print toupper($0)}') in SD) @@ -2362,29 +2377,29 @@ parse_sky_cinema() { # set the signal handler trap signal_handler INT TERM -# First initialize the values from the config, otherwise we cannot log anywhere +# Initialize the logfile first +init_log + +# We happily started ... +log "$ME V$VERSION started." + +# Initialize the values from the config, otherwise we cannot log anywhere init_config init_temp HISTORY_IDX_TMP_FILE="$temp_dir/history_index" TIMER_IDX_TMP_FILE="$temp_dir/timer_index" - # Now get command line option, as these might override some values from the config or default variables parse_options $@ if [ -e $PID_FILE ]; then - log "$ME ist already running. Exiting..." + log "$ME ist already running. Exiting." exit $EXIT_ALREADY_RUNNING else echo $$ > $PID_FILE fi -# We happily started.. -log "" -log "$ME V$VERSION started." - - if [ $DEBUG_TEMP == 1 ]; then log "\tmain: !!! WARNING: DEBUG_TEMP is enabled. Temporary files will not be removed !!!" fi @@ -2439,7 +2454,7 @@ if [ $opt_menu ]; then fi for rule_file in $RULE_FILES; do - log "\tmain: processing '${rule_file}'" + log "\tmain: Processing '${rule_file}'" rule_line=0 cat $rule_file | while read line ;do rule_line=$((${rule_line}+1)) @@ -2576,7 +2591,7 @@ parse_sky_cinema if [ ! "$sky_cinema" = "" ]; then log "" - log "\tmain: processing new movies at \"$sky_cinema\"" + log "\tmain: Processing new movies at \"$sky_cinema\"" parse_timespan "$timespan" parse_recdir @@ -2589,7 +2604,7 @@ if [ ! "$sky_cinema" = "" ]; then if [ $sky_start_sec -lt $now ]; then continue fi - sky_start_sec=$((sky_start_sec \+ sky_start_sec_add)) + sky_start_sec=$((sky_start_sec + sky_start_sec_add)) sky_show_data=$(find_show_by_start_sec "$sky_cinema" "$sky_start_sec") if [ ! "$sky_show_data" = "" ]; then # split sky_show_data @@ -2707,6 +2722,7 @@ else fi log "$ME V$VERSION exiting." +log "==================================================" #END SECTION "Main" ####################################################################################### diff --git a/archive-sources/pr-auto-timer/pr-auto-timer.rules.template b/archive-sources/pr-auto-timer/pr-auto-timer.rules.template index 742cfc7b..7c5cedad 100644 --- a/archive-sources/pr-auto-timer/pr-auto-timer.rules.template +++ b/archive-sources/pr-auto-timer/pr-auto-timer.rules.template @@ -114,4 +114,4 @@ ## The regular expression includes only episodes where the string "5. Staffel" was found in the description #Fox HD;*;Walking Dead,+5\\.[[:blank:]]Staffel;D -# Don't forget the the newline after the last entry. +# Don't forget the newline after the last entry. diff --git a/make/image-update.mk b/make/image-update.mk index b4714d8d..ffb1acf8 100644 --- a/make/image-update.mk +++ b/make/image-update.mk @@ -102,12 +102,13 @@ u-pr-auto-timer: install -m644 $(SOURCES)/pr-auto-timer/pr-auto-timer.rules.template $(UPDATE_INST_DIR)/var/tuxbox/config/ install -m644 $(SOURCES)/pr-auto-timer/auto-record-cleaner.conf.template $(UPDATE_INST_DIR)/var/tuxbox/config/ install -m644 $(SOURCES)/pr-auto-timer/auto-record-cleaner.rules.template $(UPDATE_INST_DIR)/var/tuxbox/config/ + VERSION_STRING=`cat $(SOURCES)/pr-auto-timer/pr-auto-timer | grep '^VERSION' | cut -d= -f2`; \ $(MAKE) u-update-bin \ UPDATE_MD5FILE=pr-auto-timer.txt \ UPDATE_URL=$(NI-SERVER)/plugins/pr-auto-timer \ - UPDATE_NAME=pr-auto-timer_040 \ - UPDATE_DESC="Auto-Timer" \ - UPDATE_VERSION_STRING=0.40 + UPDATE_NAME=pr-auto-timer_$${VERSION_STRING//./} \ + UPDATE_DESC=Auto-Timer \ + UPDATE_VERSION_STRING=$$VERSION_STRING u-neutrino: neutrino-clean $(MAKE) u-init