Skip to content

Commit f241871

Browse files
authored
v2.5.15
1 parent 72f147d commit f241871

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

Diff for: komga_cover_extractor.py

+7-10
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
import settings as settings_file
4747

4848
# Version of the script
49-
script_version = (2, 5, 14)
49+
script_version = (2, 5, 15)
5050
script_version_text = "v{}.{}.{}".format(*script_version)
5151

5252
# Paths = existing library
@@ -696,7 +696,6 @@ def send_message(
696696

697697

698698
# Determines the files library type
699-
# must apply to all files
700699
def get_library_type(files, required_match_percentage=90):
701700
results = []
702701
result = None
@@ -5763,11 +5762,6 @@ def get_identifiers(zip_comment):
57635762

57645763
# remove any whitespace
57655764
identifiers = [x.strip() for x in identifiers]
5766-
5767-
# remove any that are "NONE" - used to be the default vale for the identifier
5768-
# in my isbn script for other reasons
5769-
if identifiers:
5770-
metadata = [x for x in identifiers if "none" not in x.lower()]
57715765
return metadata
57725766

57735767

@@ -7245,6 +7239,9 @@ def remove_patterns(items, patterns):
72457239
# Remove specified patterns from the results
72467240
results = remove_patterns(results, patterns)
72477241

7242+
# Remove any possible dupcliates
7243+
results = list(dict.fromkeys(results))
7244+
72487245
# Generate file extension modifiers for keywords
72497246
modifiers = {
72507247
ext: (
@@ -10756,9 +10753,9 @@ def extract_all_numbers(string, subtitle=None):
1075610753

1075710754
# Remove the subtitle if present
1075810755
if subtitle:
10759-
string = re.sub(
10760-
rf"(-|:)\s*{re.escape(subtitle)}$", "", string, re.IGNORECASE
10761-
).strip()
10756+
string = remove_dual_space(
10757+
re.sub(rf"(-|:)\s*{re.escape(subtitle)}", "", string, re.IGNORECASE).strip()
10758+
)
1076210759

1076310760
numbers = re.findall(
1076410761
r"\b(?:%s)(\d+(?:[-_.]\d+|)+(?:x\d+)?(?:#\d+(?:[-_.]\d+|)+)?)"

0 commit comments

Comments
 (0)