From aee856cf495d80551b38a9b65f255e2de4809d40 Mon Sep 17 00:00:00 2001 From: Jonny007-MKD Date: Sun, 26 Oct 2014 20:09:03 +0100 Subject: [PATCH] Dont use empty epg and episode files --- saneRenamix.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/saneRenamix.sh b/saneRenamix.sh index 0428cfa..82d3e74 100755 --- a/saneRenamix.sh +++ b/saneRenamix.sh @@ -252,6 +252,8 @@ function funcGetEPG { wget_file_date=$(stat --format=%Y "$wget_file") if [ $(( $(date +%s) - $wget_file_date)) -gt $((60*60*24*7*2)) ]; then # if file is older than 2 weeks rm "$wget_file" + elif [ $(stat --format=%s "$wget_file") -eq 0 ]; then # if file is empty + rm "$wget_file" fi fi if [ ! -f "$wget_file" ]; then # This EPG file does not exist @@ -314,6 +316,8 @@ function funcGetEpisodes { wget_file_date=$(stat --format=%Y "$wget_file") if [ $(( $(date +%s) - $wget_file_date)) -gt $(( 60*60*24*7*2 )) ]; then # if file is older than 2 weeks rm "$wget_file" + elif [ $(stat --format=%s "$wget_file") -eq 0 ]; then # if file is empty + rm "$wget_file" fi fi if [ ! -f "$wget_file" ]; then