Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
4b082e0930 | ||
|
891f39684d |
14
README.md
14
README.md
@ -82,13 +82,6 @@ choco install comictagger
|
||||
<sub><b>davide-romanini</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/fcanc">
|
||||
<img src="https://avatars.githubusercontent.com/u/4999486?v=4" width="100;" alt="fcanc"/>
|
||||
<br />
|
||||
<sub><b>fcanc</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/lordwelch">
|
||||
<img src="https://avatars.githubusercontent.com/u/7547075?v=4" width="100;" alt="lordwelch"/>
|
||||
@ -109,6 +102,13 @@ choco install comictagger
|
||||
<br />
|
||||
<sub><b>MichaelFitzurka</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/fcanc">
|
||||
<img src="https://avatars.githubusercontent.com/u/4999486?v=4" width="100;" alt="fcanc"/>
|
||||
<br />
|
||||
<sub><b>fcanc</b></sub>
|
||||
</a>
|
||||
</td></tr>
|
||||
<tr>
|
||||
<td align="center">
|
||||
|
@ -46,6 +46,12 @@ def identifier(parser: settngs.Manager) -> None:
|
||||
action=AppendAction,
|
||||
help="When enabled filters the listed publishers from all search results",
|
||||
)
|
||||
parser.add_setting(
|
||||
"--tpb-detection",
|
||||
default=False,
|
||||
action=argparse.BooleanOptionalAction,
|
||||
help="Enables TPB detection. May stop comics not marked as a TPB in ComicVine from being found.",
|
||||
)
|
||||
|
||||
|
||||
def dialog(parser: settngs.Manager) -> None:
|
||||
|
@ -48,6 +48,7 @@ class SearchKeys(TypedDict):
|
||||
month: int | None
|
||||
year: int | None
|
||||
issue_count: int | None
|
||||
page_count: int | None
|
||||
|
||||
|
||||
class Score(TypedDict):
|
||||
@ -101,6 +102,8 @@ class IssueIdentifier:
|
||||
# used to eliminate unlikely publishers
|
||||
self.publisher_filter = [s.strip().casefold() for s in config.identifier_publisher_filter]
|
||||
|
||||
self.tpb_detection = config.identifier_tpb_detection
|
||||
|
||||
self.additional_metadata = GenericMetadata()
|
||||
self.output_function: Callable[[str], None] = IssueIdentifier.default_write_output
|
||||
self.callback: Callable[[int, int], None] | None = None
|
||||
@ -224,6 +227,7 @@ class IssueIdentifier:
|
||||
year=self.additional_metadata.year,
|
||||
month=self.additional_metadata.month,
|
||||
issue_count=self.additional_metadata.issue_count,
|
||||
page_count=None,
|
||||
)
|
||||
return search_keys
|
||||
|
||||
@ -260,6 +264,7 @@ class IssueIdentifier:
|
||||
year=working_md.year,
|
||||
month=working_md.month,
|
||||
issue_count=working_md.issue_count,
|
||||
page_count=len(working_md.pages),
|
||||
)
|
||||
|
||||
return search_keys
|
||||
@ -645,19 +650,33 @@ class IssueIdentifier:
|
||||
self.match_list.remove(match_item)
|
||||
|
||||
# One more test for the case choosing limited series first issue vs a trade with the same cover:
|
||||
# if we have a given issue count > 1 and the series from CV has count==1, remove it from match list
|
||||
if len(self.match_list) >= 2 and keys["issue_count"] is not None and keys["issue_count"] != 1:
|
||||
new_list = []
|
||||
for match in self.match_list:
|
||||
if match["cv_issue_count"] != 1:
|
||||
new_list.append(match)
|
||||
else:
|
||||
self.log_msg(
|
||||
f"Removing series {match['series']} [{match['series_id']}] from consideration (only 1 issue)"
|
||||
)
|
||||
# if we have an issue count == 1 or a page count > 100, we only include TPBs
|
||||
if len(self.match_list) >= 2 and (keys["issue_count"] is not None or keys["page_count"] is not None):
|
||||
issue_count = keys["issue_count"] or 0
|
||||
page_count = keys["page_count"] or 0
|
||||
if issue_count == 1:
|
||||
if self.tpb_detection and page_count > 100:
|
||||
new_list = []
|
||||
for match in self.match_list:
|
||||
if "tpb" in match["issue_title"].casefold():
|
||||
new_list.append(match)
|
||||
else:
|
||||
self.log_msg(
|
||||
f"Removing series {match['series']} [{match['series_id']}] from consideration (not a tpb)"
|
||||
)
|
||||
# if we have a given issue count > 1 and the series from CV has count==1, remove it from match list
|
||||
else:
|
||||
new_list = []
|
||||
for match in self.match_list:
|
||||
if match["cv_issue_count"] == 1:
|
||||
self.log_msg(
|
||||
f"Removing series {match['series']} [{match['series_id']}] from consideration (only 1 issue)"
|
||||
)
|
||||
else:
|
||||
new_list.append(match)
|
||||
|
||||
if len(new_list) > 0:
|
||||
self.match_list = new_list
|
||||
if len(new_list) > 0:
|
||||
self.match_list = new_list
|
||||
|
||||
if len(self.match_list) == 1:
|
||||
self.log_msg("--------------------------------------------------------------------------")
|
||||
|
@ -72,6 +72,7 @@ metadata_keys = [
|
||||
"issue_count": 6,
|
||||
"issue_number": "1",
|
||||
"month": 10,
|
||||
"page_count": 24,
|
||||
"series": "Cory Doctorow's Futuristic Tales of the Here and Now",
|
||||
"year": 2007,
|
||||
},
|
||||
@ -82,6 +83,7 @@ metadata_keys = [
|
||||
"issue_count": 6,
|
||||
"issue_number": "1",
|
||||
"month": 10,
|
||||
"page_count": 24,
|
||||
"series": "test",
|
||||
"year": 2007,
|
||||
},
|
||||
@ -92,6 +94,7 @@ metadata_keys = [
|
||||
"issue_count": 6,
|
||||
"issue_number": "3",
|
||||
"month": 10,
|
||||
"page_count": 24,
|
||||
"series": "test",
|
||||
"year": 2007,
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user