mirror of
https://github.com/Jonny007-MKD/OTR-SaneRename
synced 2025-01-22 08:49:48 +01:00
Fix errors in searching the cache
This commit is contained in:
parent
9155d75a91
commit
91638a319f
1 changed files with 8 additions and 5 deletions
|
@ -145,13 +145,16 @@ function funcConvertName {
|
||||||
function funcGetSeriesId {
|
function funcGetSeriesId {
|
||||||
local tmp;
|
local tmp;
|
||||||
if [ -f "$PwD/series.cache" ]; then # Search the series cache
|
if [ -f "$PwD/series.cache" ]; then # Search the series cache
|
||||||
funcGetSeriesIdFromCache
|
funcGetSeriesIdFromCache "$file_title"
|
||||||
|
fi
|
||||||
|
if [ -z "$series_id" ]; then # Otherwise search the cache with translation
|
||||||
|
funcConvertName "$file_title"
|
||||||
|
funcGetSeriesIdFromCache "$tmp"
|
||||||
fi
|
fi
|
||||||
if [ -z "$series_id" ]; then # Otherwise ask TvDB whether they do know the series
|
if [ -z "$series_id" ]; then # Otherwise ask TvDB whether they do know the series
|
||||||
funcGetSeriesIdFromTvdb "$file_title"
|
funcGetSeriesIdFromTvdb "$file_title"
|
||||||
fi
|
fi
|
||||||
if [ -z "$series_id" ]; then # Otherwise ask TvDB whether they do know the series
|
if [ -z "$series_id" ]; then # Otherwise ask TvDB with translation
|
||||||
funcConvertName "$file_title"
|
|
||||||
funcGetSeriesIdFromTvdb "$tmp"
|
funcGetSeriesIdFromTvdb "$tmp"
|
||||||
fi
|
fi
|
||||||
if [ -z "$series_id" ]; then # This series was not found anywhere :(
|
if [ -z "$series_id" ]; then # This series was not found anywhere :(
|
||||||
|
@ -168,7 +171,7 @@ function funcGetSeriesId {
|
||||||
function funcGetSeriesIdFromCache {
|
function funcGetSeriesIdFromCache {
|
||||||
local title;
|
local title;
|
||||||
local tmp;
|
local tmp;
|
||||||
title="$file_title";
|
title="$1";
|
||||||
while true; do
|
while true; do
|
||||||
series_id="$(grep "$title|" "$PwD/series.cache")" # Search for this title in the cache
|
series_id="$(grep "$title|" "$PwD/series.cache")" # Search for this title in the cache
|
||||||
if [ -n "$series_id" ]; then # Stop if we have found something
|
if [ -n "$series_id" ]; then # Stop if we have found something
|
||||||
|
|
Loading…
Reference in a new issue