Describe the Bug
when no subtitle is present in a video, it will be recorded in .unmanic file as an empty string
{
"extract_srt_subtitles_to_files": {
"path/to/video.mp4": ""
}
}
and when the plugin tests if it should run, it will evaluate an empty string to a False, causing the file to be added to the pending list again.
quick fix would be to distinguish between errors and an empty string as well
try:
already_extracted = directory_info.get('extract_srt_subtitles_to_files', os.path.basename(path))
except NoSectionError as e:
already_extracted = False
except NoOptionError as e:
already_extracted = False
except Exception as e:
already_extracted = False
if already_extracted:
logger.debug("File's srt subtitle streams were previously extracted with {}.".format(already_extracted))
return True
elif already_extracted == "":
logger.debug("Plugin has previously run on this file and found no subtitle streams to extract.")
return True
return False
or to use the mapper in on_library_management_file_test
mapper = PluginStreamMapper()
mapper.set_settings(settings)
mapper.set_probe(probe)
if len(mapper.sub_streams) != 0:
Steps to Reproduce
- add extract_srt_subtitles_to_files plugin to library
- run on library
- wait for files to be processed
- run again
- all files will be processed again
Expected Behavior
file should not be processed again by the plugin
Screenshots
No response
Relevant Settings
No response
Version
0.0.11
Platform
Relevant log output
Describe the Bug
when no subtitle is present in a video, it will be recorded in .unmanic file as an empty string
{ "extract_srt_subtitles_to_files": { "path/to/video.mp4": "" } }and when the plugin tests if it should run, it will evaluate an empty string to a False, causing the file to be added to the pending list again.
quick fix would be to distinguish between errors and an empty string as well
or to use the mapper in on_library_management_file_test
Steps to Reproduce
Expected Behavior
file should not be processed again by the plugin
Screenshots
No response
Relevant Settings
No response
Version
0.0.11
Platform
Relevant log output