1
0
Fork 0
mirror of https://github.com/Jonny007-MKD/OTR-DecodeAll synced 2024-05-02 20:54:06 +02:00

Merge cutDir and uncutDir into tempDir

This commit is contained in:
Jonny007-MKD 2015-02-25 17:33:16 +01:00
parent 356ca33e16
commit 3561156c46
2 changed files with 15 additions and 22 deletions

11
config
View file

@ -8,8 +8,7 @@ function funcConfigPre { # These values are set at the beginning of the script
delugeDir="/etc/deluged" # Config dir of DelugeD
inDir="/Multimedia/Video/.Downloaded" # Dir with .otrkeys
uncutDir="/Multimedia/Video/.Uncut" # Dir with uncut videos (output of decoder)
cutDir="/Multimedia/Video/.Uncut" # Dir with cut videos (output of cutter)
tempDir="/Multimedia/Video/.Temp" # Dir with decoded and cut videos (output of decoder and cutter)
outDir="/Multimedia/Video/" # Final dir with videos
torrentDb="/home/deluged/torrents.db" # File with file names and labels (see at github: OTR-TorrentDb)
@ -26,19 +25,19 @@ function funcConfigPre { # These values are set at the beginning of the script
# This way they can't be overridden, but can use the final config variables
function funcConfigPost {
cmdDecode="/usr/bin/otrtool" # path to otrkey decoder
cmdDecodeArgs="-x -e $user -p $pass -D $uncutDir" # for pyropeters otrdecoder
cmdDecodeArgs="-x -e $user -p $pass -D $tempDir" # for pyropeters otrdecoder
#cmdDecode="/home/pi/bin/qemu-x86_64 -L /home/pi/ /home/pi/bin64/otrdecoder-64"
#cmdDecodeArgs="-e $user -p $pass -o "$uncutDir" -i" # for original otrdecoder
#cmdDecodeArgs="-e $user -p $pass -o "$tempDir" -i" # for original otrdecoder
#cmdDecode="/usr/bin/otrpidecoder" # path to NYrks otrdecoder
#cmdDecodeArgs="-d -e $user -p $pass"
#uncutDir="$inDir" # no output dir supported!
#tempDir="$inDir" # no output dir supported!
cmdCut="/home/deluged/multicutmkv.sh" # path to multicut
cmdCutArgs=
cmdCutArgs="-o $tempDir"

View file

@ -94,7 +94,7 @@ function funcPerformKodiCheck {
# Parse the parameters
function funcParam {
while getopts "frkvh?e:p:i:o:d:t:l:" optval; do
while getopts "frkvh?e:p:i:o:t:l:" optval; do
case $optval in
"f")
funcLog 4 "Set forceRun = 1"
@ -120,13 +120,9 @@ function funcParam {
"o")
funcLog 4 "Set outDir = $OPTARG"
outDir=$OPTARG;; # different output dir
"d")
funcLog 4 "Set uncutDir = $OPTARG"
uncutDir=$OPTARG # different uncut dir
cutDir=$OPTARG;; # different cut dir
"c")
funcLog 4 "Set delugeDir = $OPTARG"
delugeDir=$OPTARG;; # different deluge dir
"t")
funcLog 4 "Set tempDir = $OPTARG"
tempDir=$OPTARG;; # different temp dir
"l")
funcLog 4 "Set labelFilter = $OPTARG"
labelFilter=$OPTARG;;
@ -204,11 +200,11 @@ function funcMakeVars {
funcLog 5 "pathAbsEncoded: $pathAbsEncoded"
# This is the absolute path to the decoded file (e.g. /stuff/Good_Wife_15.02.17_23-55_sixx_50_TVOON_DE.mpg.HQ.avi)
pathTmpAbsDecoded="$uncutDir/$filename"
pathTmpAbsDecoded="$tempDir/$filename"
funcLog 5 "pathTmpAbsDecoded: $pathTmpAbsDecoded"
# This is the absolute path to the cut file (e.g. /stuff/Good_Wife_15.02.17_23-55_sixx_50_TVOON_DE.mpg.HQ.avi-cut.mkv)
pathTmpAbsCut="$cutDir/$filename$cutAppendix"
pathTmpAbsCut="$tempDir/$filename$cutAppendix"
funcLog 5 "pathTmpAbsCut: $pathTmpAbsCut"
# Now we will determine the path where to put the file in the end (depends on label and saneRenamix)
@ -324,8 +320,8 @@ function funcProcessFiles {
# If file was already decoded
if [ $status -le 2 ]; then
if [ -n "$pathAbsOutDecodedInsane" -a -f "$pathAbsOutDecodedInsane" ]; then # Sanerenamix could not name this file before, but now it cans
funcLog 4 "Renamed decoded $filename to $sanename" # We were unable to cut the last time
if [ -n "$pathAbsOutDecodedInsane" -a -f "$pathAbsOutDecodedInsane" ]; then # Sanerenamix could not name this file before, but now it cans
funcLog 4 "Renamed decoded $filename to $sanename" # We were unable to cut the last time
mv $pathAbsOutDecodedInsane $pathAbsOutDecoded
status=2;
elif [ -f "$pathAbsOutDecoded" ]; then
@ -333,10 +329,8 @@ function funcProcessFiles {
status=2;
fi
if [ $status -eq 2 ]; then
pathTmpAbsDecoded="$pathAbsOutDecoded" # Cut the file in the output dir directly
pathTmpAbsDecoded="$pathAbsOutDecoded" # Use the decoded file in the output dir directly
funcLog 5 "pathTmpAbsDecoded: $pathTmpAbsDecoded"
pathTmpAbsCut="$pathTmpAbsDecoded$cutAppendix"
funcLog 5 "pathTmpAbsCut: $pathTmpAbsCut"
fi
fi
@ -396,7 +390,7 @@ function funcDecode {
if [ -f "$pathTmpAbsDecoded" ]; then
success=1
else # If we don't find the decoded file in $uncutDir
else # If we don't find the decoded file in $tempDir
funcLog 4 "Decoding $filename"
funcLog 5 " $cmdDecode $cmdDecodeArgs $pathAbsEncoded"