mirror of
https://github.com/Jonny007-MKD/OTR-SaneRename
synced 2025-01-22 08:49:48 +01:00
Preserve HQ/HD suffixes
This commit is contained in:
parent
aee856cf49
commit
893742c49e
1 changed files with 9 additions and 1 deletions
|
@ -100,9 +100,18 @@ function funcHeader {
|
|||
|
||||
# Get title, date and time
|
||||
function funcAnalyzeFilename {
|
||||
local tmp;
|
||||
|
||||
# Split filename into words, divided by _ (underscores)
|
||||
file="${file_name//_/ }"
|
||||
|
||||
file_suffix="${file_name##*.}" # Get file suffix
|
||||
tmp="${file_name//.$file_suffix}"
|
||||
case "${tmp##*.}" in # Prepend special suffixes
|
||||
HQ|HD)
|
||||
file_suffix="${tmp##*.}.$file_suffix";;
|
||||
esac
|
||||
|
||||
firstField="${file%% *}" # Get the first word
|
||||
test $firstField -eq 0 2>/dev/null # If first word is a number -> cutlist id
|
||||
if [ $? -ne 2 ]; then
|
||||
|
@ -442,7 +451,6 @@ function doIt {
|
|||
PwD=$(dirname "$PwD")
|
||||
|
||||
file_name="$(basename $path)" # Get file name
|
||||
file_suffix="${file_name##*.}" # Get file suffix
|
||||
file_dir="$(dirname $path)" # Get file directory
|
||||
|
||||
funcAnalyzeFilename # Get info from $file_name
|
||||
|
|
Loading…
Reference in a new issue