Closed rhcpfan closed 6 years ago
Or even better, use list comprehension
if opt_search_overwrite == 'off':
videoPathList = [path for path in videoPathList if not checkSubtitlesExists(path)]
Thanks man, it works great and it's also cleaner than before. We hacked so many features into this script that it's hard to test them all...
Next time send a pull request directly ;)
In the following code block, for every call to
videoPathList.remove(videoPathDispatch)
, an item invideoPathList
will be skipped (removing elements while iterating).A simple solution would be to use a second array to hold the paths to remove later:
Hope it helps, keep up the good work!