diff --git a/lib/decode/file b/lib/decode/file index ae33da8..aa3ce75 100644 --- a/lib/decode/file +++ b/lib/decode/file @@ -153,13 +153,13 @@ decodeFile() { done ) status 0 + cleanup $tmpfile.wav EOInsert ) progressSpin fi if (( sox_needed )) then - cleanup="$tempdir/$tmpfile" decodeSox "$tempdir/$tmpfile.wav" if ! soxtaskid=$( Select tasks id <<<"key = $tmpfile" @@ -183,7 +183,7 @@ decodeFile() { ) requires $decodetaskid status 0 - cleanup $cleanup + cleanup $tmpfile.wav EOInsert ) progressSpin diff --git a/lib/encode/mp3 b/lib/encode/mp3 index f2a91ee..4bb1845 100644 --- a/lib/encode/mp3 +++ b/lib/encode/mp3 @@ -65,7 +65,6 @@ encodeFile::mp3() { echo "cmd_arg$key $cleanedopts" done ) - cleanup $tempdir/$tmpfile.wav source_file $fileid status 0 rename_pattern ${destinationrenamepath[$destination]}/${destinationrename[$destination]} diff --git a/lib/encode/opus b/lib/encode/opus index d663339..06f2df8 100644 --- a/lib/encode/opus +++ b/lib/encode/opus @@ -33,7 +33,6 @@ encodeFile::opus() { echo "cmd_arg$key $cleanedopts" done ) - cleanup $tempdir/$tmpfile.wav source_file $fileid status 0 rename_pattern ${destinationrenamepath[$destination]}/${destinationrename[$destination]} diff --git a/lib/encode/vorbis b/lib/encode/vorbis index 660fd5f..e99cc0d 100644 --- a/lib/encode/vorbis +++ b/lib/encode/vorbis @@ -29,7 +29,6 @@ encodeFile::vorbis() { echo "cmd_arg$key ${oggencopts[key]}" done ) - cleanup $tempdir/$tmpfile.wav source_file $fileid status 0 rename_pattern ${destinationrenamepath[$destination]}/${destinationrename[$destination]} diff --git a/lib/workers/cleaner b/lib/workers/cleaner index 08f3c60..a4778e1 100644 --- a/lib/workers/cleaner +++ b/lib/workers/cleaner @@ -44,13 +44,13 @@ cleaner() { " FROM tasks" \ " WHERE id=$taskid" \ " )," \ - " fat32compat=(" \ + " fat32compat=(" \ " SELECT fat32compat" \ " FROM tasks" \ " WHERE id=$taskid" \ " )," \ - " ascii=(" \ - " SELECT ascii" \ + " ascii=(" \ + " SELECT ascii" \ " FROM tasks" \ " WHERE id=$taskid" \ " )" \ @@ -60,9 +60,12 @@ cleaner() { count=$(Select tasks required_by <<<"id = $taskid") if (( count == 0 )) then - rm -f "$cleanup" + [[ -n "$cleanup" ]] && rm -f "$tempdir/$cleanup" + Delete tasks <<<"id = $taskid" + unset finishedtasks[key] + else + Update tasks status 4 \ + <<<"id = $taskid" fi - Delete tasks <<<"id = $taskid" - unset finishedtasks[key] done }