mirror of
https://github.com/Jonny007-MKD/OTR-SaneRename
synced 2025-01-22 08:49:48 +01:00
Dont use empty epg and episode files
This commit is contained in:
parent
ed70025341
commit
aee856cf49
1 changed files with 4 additions and 0 deletions
|
@ -252,6 +252,8 @@ function funcGetEPG {
|
||||||
wget_file_date=$(stat --format=%Y "$wget_file")
|
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
|
if [ $(( $(date +%s) - $wget_file_date)) -gt $((60*60*24*7*2)) ]; then # if file is older than 2 weeks
|
||||||
rm "$wget_file"
|
rm "$wget_file"
|
||||||
|
elif [ $(stat --format=%s "$wget_file") -eq 0 ]; then # if file is empty
|
||||||
|
rm "$wget_file"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
if [ ! -f "$wget_file" ]; then # This EPG file does not exist
|
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")
|
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
|
if [ $(( $(date +%s) - $wget_file_date)) -gt $(( 60*60*24*7*2 )) ]; then # if file is older than 2 weeks
|
||||||
rm "$wget_file"
|
rm "$wget_file"
|
||||||
|
elif [ $(stat --format=%s "$wget_file") -eq 0 ]; then # if file is empty
|
||||||
|
rm "$wget_file"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
if [ ! -f "$wget_file" ]; then
|
if [ ! -f "$wget_file" ]; then
|
||||||
|
|
Loading…
Reference in a new issue