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
|
||||
echoLevel=5
|
||||
lastXbmcCheck=0
|
||||
umask 0002 # Set permissions 775/664 per default
|
||||
|
||||
|
||||
PwD=$(readlink -e $0) # Get the path to this script
|
||||
PwD=$(dirname "$PwD")
|
||||
|
@ -180,6 +182,11 @@ function funcUnlock {
|
|||
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 {
|
||||
funcLog 5 "filename: $filename"
|
||||
|
||||
|
@ -192,9 +199,6 @@ function funcMakeVars {
|
|||
pathCut="$cutDir/$filename.mkv"
|
||||
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
|
||||
bibname=${filename%%_[0-9][0-9].*}
|
||||
bibname="${bibname//_/.}"
|
||||
|
@ -260,10 +264,10 @@ function funcProcessFiles {
|
|||
filename="${filename%.otrkey}"
|
||||
echo;
|
||||
funcLog 0 "Processing $filename";
|
||||
funcMakeVars $file
|
||||
echo -e " >> \033[32m$sanename\033[37m";
|
||||
funcGetLabel
|
||||
|
||||
if [ -n "$labelFilter" ] && [[ "$labelFilter" != "$label" ]]
|
||||
|
||||
if [ -n "$labelFilter" ] && [[ "$labelFilter" != "$label" ]]; then
|
||||
funcLog 4 "Label did not match filter. Skipping";
|
||||
continue;
|
||||
fi
|
||||
|
@ -272,6 +276,10 @@ function funcProcessFiles {
|
|||
continue;
|
||||
fi
|
||||
|
||||
funcMakeVars
|
||||
echo -e " >> \033[32m$sanename\033[37m";
|
||||
|
||||
|
||||
if [ -f "$pathOut" ]; then
|
||||
funcLog 4 "File was already handled."
|
||||
funcRemove $file
|
||||
|
|
Loading…
Reference in a new issue