1
0
Fork 0
mirror of https://github.com/Jonny007-MKD/OTR-SaneRename synced 2024-05-01 20:44:04 +02:00

Added retreival of information from filename (Series_S00E00_)

This commit is contained in:
Jonny007-MKD 2015-03-22 17:14:50 +01:00
parent d93ed6160f
commit 3570f04577

View file

@ -107,7 +107,7 @@ function funcAnalyzeFilename {
local tmp;
# 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_number="${file_name:5:2}"
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_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_date##$file_title } # Cut off the title, now we do have the date and time
file_time=${file_date##* }