mirror of
				https://github.com/Jonny007-MKD/OTR-SaneRename
				synced 2025-11-03 16:15:35 +01:00 
			
		
		
		
	Added retreival of information from filename (Series_S00E00_)
This commit is contained in:
		
							parent
							
								
									d93ed6160f
								
							
						
					
					
						commit
						3570f04577
					
				
					 1 changed files with 9 additions and 1 deletions
				
			
		| 
						 | 
					@ -107,7 +107,7 @@ function funcAnalyzeFilename {
 | 
				
			||||||
	local tmp;
 | 
						local tmp;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	# Remove series and episode information
 | 
						# Remove series and episode information
 | 
				
			||||||
	if [[ "$file_name" == S[0-9][0-9]_E[0-9][0-9]_* ]]; then
 | 
						if [[ "$file_name" == S[0-9][0-9]_E[0-9][0-9]_* ]]; then			# S00_E00_Series_
 | 
				
			||||||
		episode_season="${file_name:1:2}"		   # Retreive information
 | 
							episode_season="${file_name:1:2}"		   # Retreive information
 | 
				
			||||||
		episode_number="${file_name:5:2}"
 | 
							episode_number="${file_name:5:2}"
 | 
				
			||||||
		episode_season=${episode_season#0}		   # Remove leading 0
 | 
							episode_season=${episode_season#0}		   # Remove leading 0
 | 
				
			||||||
| 
						 | 
					@ -134,6 +134,14 @@ function funcAnalyzeFilename {
 | 
				
			||||||
	file_title=${file%% [0-9][0-9].*}						# Cut off everything after the title: date, hour, sender, ...
 | 
						file_title=${file%% [0-9][0-9].*}						# Cut off everything after the title: date, hour, sender, ...
 | 
				
			||||||
	file_sender=${file##*-[0-9][0-9]}						# Cut off everything bevor the sender: title, date, time, ...
 | 
						file_sender=${file##*-[0-9][0-9]}						# Cut off everything bevor the sender: title, date, time, ...
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if [[ "$file_title" == *S[0-9][0-9]E[0-9][0-9] ]]; then				# Series_S00E00_
 | 
				
			||||||
 | 
							episode_season="${file_title:(-5):2}"	   # Retreive information
 | 
				
			||||||
 | 
							episode_number="${file_title:(-2):2}"
 | 
				
			||||||
 | 
							episode_season=${episode_season#0}		   # Remove leading 0
 | 
				
			||||||
 | 
							episode_number=${episode_number#0}
 | 
				
			||||||
 | 
							file_title="${file_title:0:-7}"
 | 
				
			||||||
 | 
						fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	file_date=${file%%$file_sender}							# Cut off the sender
 | 
						file_date=${file%%$file_sender}							# Cut off the sender
 | 
				
			||||||
	file_date=${file_date##$file_title }					# Cut off the title, now we do have the date and time
 | 
						file_date=${file_date##$file_title }					# Cut off the title, now we do have the date and time
 | 
				
			||||||
	file_time=${file_date##* }
 | 
						file_time=${file_date##* }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue