1
0
Fork 0
mirror of https://github.com/Jonny007-MKD/OTR-SaneRename synced 2024-05-08 21:54:04 +02:00

Fix access to non-existent files: log & series.cache

This commit is contained in:
Jonny007-MKD 2014-10-28 16:27:48 +01:00
parent 95c32e74e6
commit e1a8347765

View file

@ -43,7 +43,7 @@ function eecho {
function logNexit {
str="$1 - $file_name - $series_title"
if ! grep -q "$str" "$PwD/log" ; then
if ! [ -f "$PwD/log" ] && ! grep -q "$str" "$PwD/log" ; then
echo "$str" >> "$PwD/log"
fi
exit $1
@ -155,10 +155,10 @@ function funcGetSeriesId {
local tmp;
if [ -f "$PwD/series.cache" ]; then # Search the series cache
funcGetSeriesIdFromCache "$file_title"
fi
if [ -z "$series_id" ]; then # Otherwise search the cache with translation
funcConvertName "$file_title"
funcGetSeriesIdFromCache "$tmp"
if [ -z "$series_id" ]; then # and 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
funcGetSeriesIdFromTvdb "$file_title"