Showing 1 changed files with 12 additions and 14 deletions
+12 -14
garmin_varia_transcode.sh
@@ -1842,22 +1842,20 @@ process_video_file() {
1842 1842
     return 3
1843 1843
   fi
1844 1844
 
1845
-  if [[ "$MOVE_SOURCE" == true ]]; then
1846
-    if ! validate_transcoded_output "$encode_input_file" "$temp_output_file"; then
1847
-      cleanup_transcode_artifacts "$temp_output_file" "$output_file"
1848
-      ERRORS=$((ERRORS + 1))
1849
-      if destination_cannot_accept_file "$input_file" "$out_dir" ""; then
1850
-        DESTINATION_FAILURES=$((DESTINATION_FAILURES + 1))
1851
-        cleanup_process_inputs "$staged_input_file" "$repacked_input_file"
1852
-        return 3
1853
-      fi
1854
-      # Validation failed but destination is healthy: the source or encoder produced
1855
-      # a corrupt/truncated output. Treat as source error so --keep-going can skip it.
1856
-      INVALID_SOURCES_SKIPPED=$((INVALID_SOURCES_SKIPPED + 1))
1857
-      log_msg "ERROR" "Encode produced invalid output (source may be corrupt): $input_file"
1845
+  if ! validate_transcoded_output "$encode_input_file" "$temp_output_file"; then
1846
+    cleanup_transcode_artifacts "$temp_output_file" "$output_file"
1847
+    ERRORS=$((ERRORS + 1))
1848
+    if destination_cannot_accept_file "$input_file" "$out_dir" ""; then
1849
+      DESTINATION_FAILURES=$((DESTINATION_FAILURES + 1))
1858 1850
       cleanup_process_inputs "$staged_input_file" "$repacked_input_file"
1859
-      return 2
1851
+      return 3
1860 1852
     fi
1853
+    # Validation failed but destination is healthy: the source or encoder produced
1854
+    # a corrupt/truncated output. Treat as source error so --keep-going can skip it.
1855
+    INVALID_SOURCES_SKIPPED=$((INVALID_SOURCES_SKIPPED + 1))
1856
+    log_msg "ERROR" "Encode produced invalid output (source may be corrupt): $input_file"
1857
+    cleanup_process_inputs "$staged_input_file" "$repacked_input_file"
1858
+    return 2
1861 1859
   fi
1862 1860
 
1863 1861
   touch -r "$input_file" "$temp_output_file" || true