@@ -304,7 +304,6 @@ def on_postprocessor_task_results(data):
304304
305305 :param data:
306306 :return:
307-
308307 """
309308 # Get settings
310309 settings = Settings (library_id = data .get ('library_id' ))
@@ -315,11 +314,19 @@ def on_postprocessor_task_results(data):
315314 logger .error ("Provided 'source_data' is missing the source file abspath data." )
316315 return
317316
318- # Mark the source file to be ignored on subsequent scans if 'force_transcode' was enabled
317+ # Ensure destination_files is present and not empty
318+ if not data .get ('destination_files' ):
319+ logger .error ("No destination files found." )
320+ return
321+
322+ # Get the path of the transcoded file
323+ transcoded_file_path = data ['destination_files' ][0 ]
324+
325+ # Mark the transcoded file to be ignored on subsequent scans if 'force_transcode' was enabled
319326 if settings .get_setting ('force_transcode' ):
320327 cache_directory = os .path .dirname (data .get ('final_cache_path' ))
321328 if os .path .exists (os .path .join (cache_directory , '.force_transcode' )):
322- directory_info = UnmanicDirectoryInfo (os .path .dirname (original_source_path ))
323- directory_info .set ('video_transcoder' , os .path .basename (original_source_path ), 'force_transcoded' )
329+ directory_info = UnmanicDirectoryInfo (os .path .dirname (transcoded_file_path ))
330+ directory_info .set ('video_transcoder' , os .path .basename (transcoded_file_path ), 'force_transcoded' )
324331 directory_info .save ()
325- logger .debug ("Ignore on next scan written for '%s'." , original_source_path )
332+ logger .debug ("Ignore on next scan written for '%s'." , transcoded_file_path )
0 commit comments