Skip to content

Commit

Permalink
Update for newer anilist library
Browse files Browse the repository at this point in the history
  • Loading branch information
0x16c3 committed Jan 18, 2022
1 parent 45dc59d commit 8f66001
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
12 changes: 10 additions & 2 deletions cogs/api/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,15 @@ async def send_embed(
ch = matching[0]

# progress
if listitem.status in ["CURRENT", "REPEATING", "COMPLETED"]:
if (
listitem.status
in [
"CURRENT",
"REPEATING",
"COMPLETED",
]
or item.status in ["REWATCHED", "REREAD"]
):
if ch["list_block_progress"]:
return None
elif listitem.status == "PAUSED":
Expand Down Expand Up @@ -514,7 +522,7 @@ async def send_embed(
inline=False,
)

if listitem.status == "COMPLETED" or listitem.status == "PLANNING":
if listitem.status in ["COMPLETED", "PLANNING"]:
if is_manga:
cobj = CManga.create(item.media)
else:
Expand Down
2 changes: 1 addition & 1 deletion cogs/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -1190,7 +1190,7 @@ async def _get_profile(self, ctx: SlashContext, username: str, **kwargs):
)
async def _search(self, ctx: SlashContext, media: str, query: str) -> CAnime:
results: List[Union[CAnime, CManga]] = await anilist.search(
query, content_type=media, page=1, limit=5
query, content_type=media, page=1, limit=5, pagination=False
)
select = create_select(
custom_id="_search0",
Expand Down

0 comments on commit 8f66001

Please sign in to comment.