Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Interruption in Matching Process #140

Merged
merged 1 commit into from
Aug 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 5 additions & 8 deletions metrontagger/talker.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,14 +326,11 @@ def _print_metadata_message(src: InfoSource, comic: Comic) -> None:
if result_count > 1:
LOGGER.debug("Check Hamming for '%s'", ca)
hamming_lst = self._get_hamming_results(ca, i_list)
if hamming_lst:
if len(hamming_lst) == 1:
self.match_results.add_good_match(fn)
return hamming_lst[0].id, False
issue_id = self._select_choice_from_matches(fn, hamming_lst)
if issue_id:
self.match_results.add_good_match(fn)
return issue_id, False
# Matched single cover within hamming distance from multiple results
if hamming_lst and len(hamming_lst) == 1:
self.match_results.add_good_match(fn)
return hamming_lst[0].id, False
# No hamming match, let's ask the user later.
self.match_results.add_multiple_match(MultipleMatch(fn, i_list))
return None, True

Expand Down
Loading