mirror of
				https://github.com/Jonny007-MKD/OTR-SaneRename
				synced 2025-11-03 16:15:35 +01:00 
			
		
		
		
	Search the series description also. I hope this does not lead to false positives!
This commit is contained in:
		
							parent
							
								
									dc2e036036
								
							
						
					
					
						commit
						90208697d3
					
				
					 1 changed files with 20 additions and 8 deletions
				
			
		| 
						 | 
					@ -346,15 +346,22 @@ function funcGetEpisodeInfo {
 | 
				
			||||||
	wget_file="$PwD/episodes-${series_id}.xml"
 | 
						wget_file="$PwD/episodes-${series_id}.xml"
 | 
				
			||||||
	while true; do
 | 
						while true; do
 | 
				
			||||||
		episode_info=$(grep -i "sodeName>$title" "$wget_file" -B 10)			# Get XML data of episode
 | 
							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
 | 
							if [ -z "$episode_info" ]; then											# Nothing found. Search the description
 | 
				
			||||||
			tmp=${title% *}
 | 
								if [ ${#title} -gt 10 ]; then										# If title is long enough
 | 
				
			||||||
			if [ ${#tmp} -le 4 ] || [ "$tmp" == "$title" ]; then
 | 
									episode_info=$(grep -i "verView>$title" "$wget_file" -B 16)
 | 
				
			||||||
				if $title1; then
 | 
								fi
 | 
				
			||||||
					funcConvertName "$episode_title"
 | 
								if [ -z "$episode_info" ]; then										# Still nothing found. Shorten the title
 | 
				
			||||||
					title1=false;
 | 
									tmp=${title% *}
 | 
				
			||||||
				else
 | 
									if [ ${#tmp} -le 4 ] || [ "$tmp" == "$title" ]; then
 | 
				
			||||||
					break;
 | 
										if $title1; then
 | 
				
			||||||
 | 
											funcConvertName "$episode_title"
 | 
				
			||||||
 | 
											title1=false;
 | 
				
			||||||
 | 
										else
 | 
				
			||||||
 | 
											break;
 | 
				
			||||||
 | 
										fi
 | 
				
			||||||
				fi
 | 
									fi
 | 
				
			||||||
 | 
								else
 | 
				
			||||||
 | 
									break;
 | 
				
			||||||
			fi
 | 
								fi
 | 
				
			||||||
			title="$(echo $tmp | sed -e 's/^[^a-zA-Z0-9]*//' -e 's/ *$//')"		# Remove special characters
 | 
								title="$(echo $tmp | sed -e 's/^[^a-zA-Z0-9]*//' -e 's/ *$//')"		# Remove special characters
 | 
				
			||||||
			eecho -e "        \tEpisode title:\t$title"
 | 
								eecho -e "        \tEpisode title:\t$title"
 | 
				
			||||||
| 
						 | 
					@ -368,6 +375,11 @@ function funcGetEpisodeInfo {
 | 
				
			||||||
		title="${episode_title#$tmp }"											# Remove it from the title
 | 
							title="${episode_title#$tmp }"											# Remove it from the title
 | 
				
			||||||
		eecho -e "        \tEpisode title:\t$title"
 | 
							eecho -e "        \tEpisode title:\t$title"
 | 
				
			||||||
		episode_info=$(grep -i "sodeName>$title" "$wget_file" -B 10)			# Get XML data of episode
 | 
							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
 | 
						fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if [ -n "$episode_info" ]; then												# If we have found something
 | 
						if [ -n "$episode_info" ]; then												# If we have found something
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue