The line 823 "if ('filename' in opt_search_mode) or ('hash_then_filename' in opt_search_mode and len(subtitlesResultList['data']) == 0):" can incorrectly be executed if opt_search_mode = 'hash_then_filename'.
For example, subtitlesResultList correctly returns result from hash search, but still get executed by the "'filename' in opt_search_mode" part of the condition. As a result, valid result from hash is deleted with "0" result from filename search method.
The substring search is ambiguous and covers both cases: "hash_and_filename" and "hash_then_filename".
The first part of the condition in line 823 should specify exactly "hash_and_filename" instead of the ambiguous "filename" string only.
The line 823 "if ('filename' in opt_search_mode) or ('hash_then_filename' in opt_search_mode and len(subtitlesResultList['data']) == 0):" can incorrectly be executed if opt_search_mode = 'hash_then_filename'.
For example, subtitlesResultList correctly returns result from hash search, but still get executed by the "'filename' in opt_search_mode" part of the condition. As a result, valid result from hash is deleted with "0" result from filename search method.
The substring search is ambiguous and covers both cases: "hash_and_filename" and "hash_then_filename".
The first part of the condition in line 823 should specify exactly "hash_and_filename" instead of the ambiguous "filename" string only.