mirror of
				https://github.com/Jonny007-MKD/OTR-SaneRename
				synced 2025-11-03 16:15:35 +01:00 
			
		
		
		
	Use ? in episode titles as placeholder
This commit is contained in:
		
							parent
							
								
									e70ffab4d7
								
							
						
					
					
						commit
						ad5cfe41ae
					
				
					 1 changed files with 10 additions and 5 deletions
				
			
		| 
						 | 
					@ -425,13 +425,18 @@ function funcGetEpisodeInfoByTitle {
 | 
				
			||||||
					fi
 | 
										fi
 | 
				
			||||||
					if [ -n "$episode_info" ]; then										# We have found something!
 | 
										if [ -n "$episode_info" ]; then										# We have found something!
 | 
				
			||||||
						break;
 | 
											break;
 | 
				
			||||||
					else																# Still nothing found. Shorten the title
 | 
										else
 | 
				
			||||||
						tmp=${title% *}
 | 
											episode_info=$(grep -Gi "sodeName>${title//\?/.}" "$wget_file" -B 10 | tail -11)	# Get XML data of episode with place holders. Sometime special characters are encoded as '?'
 | 
				
			||||||
						if [ ${#tmp} -le 4 ] || [ "$tmp" == "$title" ]; then			# Stop when the title is to short
 | 
											if [ -n "$episode_info" ]; then									# We have found something!
 | 
				
			||||||
							break;
 | 
												break;
 | 
				
			||||||
 | 
											else															# Still nothing found. Shorten the title
 | 
				
			||||||
 | 
												tmp=${title% *}
 | 
				
			||||||
 | 
												if [ ${#tmp} -le 4 ] || [ "$tmp" == "$title" ]; then		# Stop when the title is to short
 | 
				
			||||||
 | 
													break;
 | 
				
			||||||
 | 
												fi
 | 
				
			||||||
						fi
 | 
											fi
 | 
				
			||||||
 | 
											title="$(echo $tmp | sed -e 's/^[^a-zA-Z0-9.?]*//' -e 's/ *$//')"	# Remove special characters
 | 
				
			||||||
					fi
 | 
										fi
 | 
				
			||||||
					title="$(echo $tmp | sed -e 's/^[^a-zA-Z0-9]*//' -e 's/ *$//')"		# Remove special characters
 | 
					 | 
				
			||||||
				else
 | 
									else
 | 
				
			||||||
					break;
 | 
										break;
 | 
				
			||||||
				fi
 | 
									fi
 | 
				
			||||||
| 
						 | 
					@ -557,7 +562,7 @@ function doIt {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		funcConvertName "$file_title"
 | 
							funcConvertName "$file_title"
 | 
				
			||||||
		if [[ "$tmp" == $series_title_tvdb* ]] || [[ "$file_title" == $series_title_tvdb* ]] ||
 | 
							if [[ "$tmp" == $series_title_tvdb* ]] || [[ "$file_title" == $series_title_tvdb* ]] ||
 | 
				
			||||||
		   [[ "$tmp" == $series_alias* ]]      || [[ "$file_title" == $series_alias* ]]          ; then
 | 
							   [ -n "$series_alias" ] && ([[ "$tmp" == $series_alias* ]] || [[ "$file_title" == $series_alias* ]]) ; then
 | 
				
			||||||
			if $debug; then echo -e "\033[36mParsing file name only! \"$tmp\" == \"$series_title_tvdb*\" || \"$file_title\" == \"$series_title_tvdb*\" || \"$tmp\" == \"$series_alias*\" ||  \"$file_title\" == \"$series_alias*\"\033[37m"; fi
 | 
								if $debug; then echo -e "\033[36mParsing file name only! \"$tmp\" == \"$series_title_tvdb*\" || \"$file_title\" == \"$series_title_tvdb*\" || \"$tmp\" == \"$series_alias*\" ||  \"$file_title\" == \"$series_alias*\"\033[37m"; fi
 | 
				
			||||||
			episode_title="$(echo ${file_title#$series_title_tvdb} | sed -e 's/^[^a-zA-Z0-9]*//' -e 's/ *$//')"
 | 
								episode_title="$(echo ${file_title#$series_title_tvdb} | sed -e 's/^[^a-zA-Z0-9]*//' -e 's/ *$//')"
 | 
				
			||||||
			funcConvertName "$series_title_file"
 | 
								funcConvertName "$series_title_file"
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue