1
0
Fork 0
mirror of https://github.com/Jonny007-MKD/OTR-SaneRename synced 2024-05-19 23:44:02 +02:00

Added caching for series IDs (file: series.cache, delimiter: |#|)

This commit is contained in:
Jonny007-MKD 2014-07-29 10:45:19 +02:00
parent fab0b98d01
commit 44f599b7f0

View file

@ -107,6 +107,15 @@ eecho -e " Datum:\t$fieldsDateInv"
eecho -e " Uhrzeit:\t$fieldsTime"
eecho -e " Titel:\t$fieldsTitle"
if [ -f "$PwD/series.cache" ]; then # Search the series cache
series_id=$(grep "$series_title" "$PwD/series.cache");
fi
if [ -n "$series_id" ]; then # And get the TvDB series ID from there
echo $series_id
series_title=${series_id%|#|*}
series_id=${series_id#*|#|}
eecho -e " Cache:\tSeries found.\tID: $series_id"
else # Otherwise ask TvDB whether they do know the series
# ------------ Series ID abrufen anhand vom Titel der Serie -------------------- ;;
series_db="https://www.thetvdb.com/api/GetSeries.php?seriesname=$fieldsTitle&language=$lang"
wget "$series_db" -O "$PwD/series.xml" -o /dev/null
@ -132,11 +141,14 @@ series_alias=${series_alias%<*}
series_alias=${series_alias#*>}
eecho -e " TVDB:\tSeries found.\tID: $series_id"
fi
eecho -e "\t\t\t\tName: $series_title"
if [ -n "$series_alias" ]; then
eecho -e "\t\t\t\tAlias: $series_alias"
fi
echo "$series_title|#|$series_id" >> "$PwD/series.cache"
# ------------ EPG vom jeweiligen Tag herunterladen, durchsuchen anhand der Ausstrahlungszeit ------------- ;;
# Download OTR EPG data and search for series and time
if [ ! -f "PwD/epg-$fieldsDate.csv" ]; then # didnt cache this file