diff options
author | benadha <benawiadha@gmail.com> | 2022-01-08 07:46:32 +0700 |
---|---|---|
committer | benadha <benawiadha@gmail.com> | 2022-01-08 07:46:32 +0700 |
commit | 323ba80f262ba4ffa93664ec598a7954ae50dd71 (patch) | |
tree | 2edc9bc09ba7badb501fcd40edde05c57589bb08 /epy.py | |
parent | 280eba48ee382cfe41f0deab1a6898ce0e803351 (diff) | |
download | epy-323ba80f262ba4ffa93664ec598a7954ae50dd71.tar.gz |
Change history matching key from filepath to title author
Diffstat (limited to 'epy.py')
-rwxr-xr-x | epy.py | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -3642,24 +3642,24 @@ def parse_cli_args() -> str: if (not candidate[0]) or candidate[1]: matching_value = 0 for item in library: - file = item.filepath - this_file_match_value = sum( + tomatch = f"{item.title} - {item.author}" # item.filepath + this_item_match_value = sum( [ i.size for i in SM( - None, file.lower(), " ".join(args).lower() + None, tomatch.lower(), " ".join(args).lower() ).get_matching_blocks() ] ) - if this_file_match_value >= matching_value: - matching_value = this_file_match_value - candidate = (file, None) + if this_item_match_value >= matching_value: + matching_value = this_item_match_value + candidate = (item.filepath, None) if matching_value == 0: candidate = (None, "\nERROR: No matching file found in history.") if (not candidate[0]) or candidate[1] or "-r" in args: - print("Reading history:") + print("Reading History:") # dig = len(str(len(STATE["States"].keys()) + 1)) dig = len(str(len(library) + 1)) tcols = termc - dig - 2 |