1
0
Fork 0
mirror of https://github.com/Jonny007-MKD/OTR-SaneRename synced 2024-05-08 21:54:04 +02:00

Preserve HQ/HD suffixes

This commit is contained in:
Jonny007-MKD 2014-10-26 21:04:17 +01:00
parent aee856cf49
commit 893742c49e

View file

@ -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