Skip to content

Commit

Permalink
Use user ID for group if scan group is missing. #8
Browse files Browse the repository at this point in the history
  • Loading branch information
funkyhippo committed Dec 21, 2021
1 parent 5402f9a commit 9a0f8b1
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion proxy/sources/mangadex.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,18 @@ def md_api_common(self, meta_id):

# Bandaid fix but it should resolve most resolution issues
if chapter_group is None:
continue
for relationship in chapter["relationships"]:
if relationship["type"] == "user":
chapter_group = relationship["id"]
break
# If at this point it still doesn't have a group, fail the processing
if chapter_group is None:
raise ProxyException(
"A chapter is missing a scanlator or user uploader."
)
groups_set.add(chapter_group)
groups_dict[str(len(groups_set))] = chapter_group
groups_map[chapter_group] = str(len(groups_set))

if chapter_number in chapter_dict:
chapter_obj = chapter_dict[chapter_number]
Expand Down

0 comments on commit 9a0f8b1

Please sign in to comment.