mirror of
https://github.com/Jonny007-MKD/OTR-SaneRename
synced 2025-01-22 08:49:48 +01:00
Added caching for series IDs (file: series.cache, delimiter: |#|)
This commit is contained in:
parent
fab0b98d01
commit
44f599b7f0
1 changed files with 34 additions and 22 deletions
|
@ -107,6 +107,15 @@ eecho -e " Datum:\t$fieldsDateInv"
|
||||||
eecho -e " Uhrzeit:\t$fieldsTime"
|
eecho -e " Uhrzeit:\t$fieldsTime"
|
||||||
eecho -e " Titel:\t$fieldsTitle"
|
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 ID abrufen anhand vom Titel der Serie -------------------- ;;
|
||||||
series_db="https://www.thetvdb.com/api/GetSeries.php?seriesname=$fieldsTitle&language=$lang"
|
series_db="https://www.thetvdb.com/api/GetSeries.php?seriesname=$fieldsTitle&language=$lang"
|
||||||
wget "$series_db" -O "$PwD/series.xml" -o /dev/null
|
wget "$series_db" -O "$PwD/series.xml" -o /dev/null
|
||||||
|
@ -132,11 +141,14 @@ series_alias=${series_alias%<*}
|
||||||
series_alias=${series_alias#*>}
|
series_alias=${series_alias#*>}
|
||||||
|
|
||||||
eecho -e " TVDB:\tSeries found.\tID: $series_id"
|
eecho -e " TVDB:\tSeries found.\tID: $series_id"
|
||||||
|
fi
|
||||||
eecho -e "\t\t\t\tName: $series_title"
|
eecho -e "\t\t\t\tName: $series_title"
|
||||||
if [ -n "$series_alias" ]; then
|
if [ -n "$series_alias" ]; then
|
||||||
eecho -e "\t\t\t\tAlias: $series_alias"
|
eecho -e "\t\t\t\tAlias: $series_alias"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
echo "$series_title|#|$series_id" >> "$PwD/series.cache"
|
||||||
|
|
||||||
# ------------ EPG vom jeweiligen Tag herunterladen, durchsuchen anhand der Ausstrahlungszeit ------------- ;;
|
# ------------ EPG vom jeweiligen Tag herunterladen, durchsuchen anhand der Ausstrahlungszeit ------------- ;;
|
||||||
# Download OTR EPG data and search for series and time
|
# Download OTR EPG data and search for series and time
|
||||||
if [ ! -f "PwD/epg-$fieldsDate.csv" ]; then # didnt cache this file
|
if [ ! -f "PwD/epg-$fieldsDate.csv" ]; then # didnt cache this file
|
||||||
|
|
Loading…
Reference in a new issue