Skip to content

Commit

Permalink
added fix for mangapill having more than 1 updates in update_check.py
Browse files Browse the repository at this point in the history
  • Loading branch information
MooshiMochi committed Nov 25, 2024
1 parent 499a74b commit acefb45
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/ext/update_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,10 +216,17 @@ async def check_with_front_page_scraping(

grouped: list[list[MangaHeader | PartialManga]] = group_items_by([*mangas, *partial_mangas], ["id"])
# check and make sure that each list is of length 2.
for group in grouped:
for i, group in enumerate(grouped):
if len(group) != 2:
self.logger.error(f"Grouped list is not of length 2: {group}")
await scanlator.report_error(Exception(f"Grouped list is not of length 2: {group}"))
if len(group) > 2: # managpill has more than 1 update listed for the same manhwa
# group[0] = Manga
# group[1+] = PartialManga
for j in range(2, len(group)):
group[1].latest_chapters.extend(group[j].latest_chapters)
grouped[i] = group[:2]
else:
self.logger.error(f"Grouped list is not of length 2: {group}")
await scanlator.report_error(Exception(f"Grouped list is not of length 2: {group}"))

grouped = [x for x in grouped if len(x) == 2]

Expand Down

0 comments on commit acefb45

Please sign in to comment.