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

Search the series description also. I hope this does not lead to false positives!

This commit is contained in:
Jonny007-MKD 2014-10-15 17:17:01 +02:00
parent dc2e036036
commit 90208697d3

View file

@ -346,15 +346,22 @@ function funcGetEpisodeInfo {
wget_file="$PwD/episodes-${series_id}.xml"
while true; do
episode_info=$(grep -i "sodeName>$title" "$wget_file" -B 10) # Get XML data of episode
if [ -z "$episode_info" ]; then # Nothing found. Shorten the title
tmp=${title% *}
if [ ${#tmp} -le 4 ] || [ "$tmp" == "$title" ]; then
if $title1; then
funcConvertName "$episode_title"
title1=false;
else
break;
if [ -z "$episode_info" ]; then # Nothing found. Search the description
if [ ${#title} -gt 10 ]; then # If title is long enough
episode_info=$(grep -i "verView>$title" "$wget_file" -B 16)
fi
if [ -z "$episode_info" ]; then # Still nothing found. Shorten the title
tmp=${title% *}
if [ ${#tmp} -le 4 ] || [ "$tmp" == "$title" ]; then
if $title1; then
funcConvertName "$episode_title"
title1=false;
else
break;
fi
fi
else
break;
fi
title="$(echo $tmp | sed -e 's/^[^a-zA-Z0-9]*//' -e 's/ *$//')" # Remove special characters
eecho -e " \tEpisode title:\t$title"
@ -368,6 +375,11 @@ function funcGetEpisodeInfo {
title="${episode_title#$tmp }" # Remove it from the title
eecho -e " \tEpisode title:\t$title"
episode_info=$(grep -i "sodeName>$title" "$wget_file" -B 10) # Get XML data of episode
if [ -z "$episode_info" ]; then # Nothing found. Search the description
if [ ${#title} -gt 10 ]; then # If title is long enough
episode_info=$(grep -i "verView>$title" "$wget_file" -B 16)
fi
fi
fi
if [ -n "$episode_info" ]; then # If we have found something