mirror of
https://github.com/Jonny007-MKD/OTR-DecodeAll
synced 2025-01-22 08:49:50 +01:00
Fix syntax error
Get label before making all other variables
This commit is contained in:
parent
8f8273a8a7
commit
bddafa0705
1 changed files with 14 additions and 6 deletions
20
otrDecodeAll
20
otrDecodeAll
|
@ -12,6 +12,8 @@ logMsgColor=("\033[37m" "\033[31m" "\033[33m" "\033[37m" "\033[37m" "\033[37m")
|
||||||
logLevel=0
|
logLevel=0
|
||||||
echoLevel=5
|
echoLevel=5
|
||||||
lastXbmcCheck=0
|
lastXbmcCheck=0
|
||||||
|
umask 0002 # Set permissions 775/664 per default
|
||||||
|
|
||||||
|
|
||||||
PwD=$(readlink -e $0) # Get the path to this script
|
PwD=$(readlink -e $0) # Get the path to this script
|
||||||
PwD=$(dirname "$PwD")
|
PwD=$(dirname "$PwD")
|
||||||
|
@ -180,6 +182,11 @@ function funcUnlock {
|
||||||
rm -f /tmp/.otrDecodeAll.lock
|
rm -f /tmp/.otrDecodeAll.lock
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function funcGetLabel {
|
||||||
|
label="$(grep "$filename" $torrentDb | grep -o ' [a-zA-Z0-9_-]*$' | grep -o '[a-zA-Z0-9_-]*$')"
|
||||||
|
funcLog 5 "label: $label"
|
||||||
|
}
|
||||||
|
|
||||||
function funcMakeVars {
|
function funcMakeVars {
|
||||||
funcLog 5 "filename: $filename"
|
funcLog 5 "filename: $filename"
|
||||||
|
|
||||||
|
@ -192,9 +199,6 @@ function funcMakeVars {
|
||||||
pathCut="$cutDir/$filename.mkv"
|
pathCut="$cutDir/$filename.mkv"
|
||||||
funcLog 5 "pathCut: $pathCut"
|
funcLog 5 "pathCut: $pathCut"
|
||||||
|
|
||||||
label="$(grep "$filename" $torrentDb | grep -o ' [a-zA-Z0-9_-]*$' | grep -o '[a-zA-Z0-9_-]*$')"
|
|
||||||
funcLog 5 "label: $label"
|
|
||||||
|
|
||||||
sanename=$filename
|
sanename=$filename
|
||||||
bibname=${filename%%_[0-9][0-9].*}
|
bibname=${filename%%_[0-9][0-9].*}
|
||||||
bibname="${bibname//_/.}"
|
bibname="${bibname//_/.}"
|
||||||
|
@ -260,10 +264,10 @@ function funcProcessFiles {
|
||||||
filename="${filename%.otrkey}"
|
filename="${filename%.otrkey}"
|
||||||
echo;
|
echo;
|
||||||
funcLog 0 "Processing $filename";
|
funcLog 0 "Processing $filename";
|
||||||
funcMakeVars $file
|
funcGetLabel
|
||||||
echo -e " >> \033[32m$sanename\033[37m";
|
|
||||||
|
|
||||||
if [ -n "$labelFilter" ] && [[ "$labelFilter" != "$label" ]]
|
|
||||||
|
if [ -n "$labelFilter" ] && [[ "$labelFilter" != "$label" ]]; then
|
||||||
funcLog 4 "Label did not match filter. Skipping";
|
funcLog 4 "Label did not match filter. Skipping";
|
||||||
continue;
|
continue;
|
||||||
fi
|
fi
|
||||||
|
@ -272,6 +276,10 @@ function funcProcessFiles {
|
||||||
continue;
|
continue;
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
funcMakeVars
|
||||||
|
echo -e " >> \033[32m$sanename\033[37m";
|
||||||
|
|
||||||
|
|
||||||
if [ -f "$pathOut" ]; then
|
if [ -f "$pathOut" ]; then
|
||||||
funcLog 4 "File was already handled."
|
funcLog 4 "File was already handled."
|
||||||
funcRemove $file
|
funcRemove $file
|
||||||
|
|
Loading…
Reference in a new issue