mirror of
https://github.com/Jonny007-MKD/OTR-SaneRename
synced 2025-01-22 08:49:48 +01:00
If no episode was found with the episode title from the file name we will search the EPG for an appropriate title
This commit is contained in:
parent
b99dc140b9
commit
97589364f9
1 changed files with 17 additions and 6 deletions
|
@ -203,7 +203,7 @@ function funcGetEPG {
|
|||
# Download OTR EPG data and search for series and time
|
||||
wget_file="$PwD/epg-${file_date}.csv"
|
||||
if [ ! -f "$wget_file" ]; then # This EPG file does not exist
|
||||
rm -f ${PwD// /\\ }/epg-*.csv 2> /dev/null # Delete all old files
|
||||
#rm -f ${PwD// /\\ }/epg-*.csv 2> /dev/null # Delete all old files
|
||||
epg_csv="https://www.onlinetvrecorder.com/epg/csv/epg_20${file_date//./_}.csv"
|
||||
wget_running=true;
|
||||
wget "$epg_csv" -O "$wget_file" -o /dev/null # Download the csv
|
||||
|
@ -272,7 +272,7 @@ function funcGetEpisodeInfo {
|
|||
break;
|
||||
fi
|
||||
title="$tmp"
|
||||
eecho -e " EPG:\tEpisode title:\t$title"
|
||||
eecho -e " \tEpisode title:\t$title"
|
||||
else
|
||||
break;
|
||||
fi
|
||||
|
@ -280,7 +280,7 @@ function funcGetEpisodeInfo {
|
|||
if [ -z "$episode_info" ]; then # If we have not found anything
|
||||
tmp="${episode_title%% *}" # Get the first wird
|
||||
title="${episode_title#$tmp }" # Remove it from the title
|
||||
eecho -e " EPG:\tEpisode title:\t$title"
|
||||
eecho -e " \tEpisode title:\t$title"
|
||||
episode_info=$(grep "Name>$title" "$wget_file" -B 10) # Get XML data of episode
|
||||
fi
|
||||
episode_title="$title"
|
||||
|
@ -357,6 +357,16 @@ function doIt {
|
|||
fi
|
||||
|
||||
doItEpisodes $lang # Search for the episode in the specified language
|
||||
if [ -z "$episode_info" ]; then # Episode was not found!
|
||||
if [ "$lang" != "en" ]; then
|
||||
doItEpisodes "en" # Try it again with english
|
||||
fi
|
||||
fi
|
||||
|
||||
if $episode_title_set && [ -z "$episode_info" ]; then # Episode was not found!
|
||||
episode_title_set=false # Do not use file name as episode title
|
||||
funcGetEPG # Download epg file
|
||||
doItEpisodes $lang # Search for the episode in the specified language and get title from EPG
|
||||
if [ -z "$episode_info" ]; then # Episode was not found!
|
||||
if [ "$lang" != "en" ]; then
|
||||
doItEpisodes "en" # Try it again with english
|
||||
|
@ -366,6 +376,7 @@ function doIt {
|
|||
exit 20
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
if [ -n "$episode_info" ]; then
|
||||
|
|
Loading…
Reference in a new issue