Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Apr 1, 2024
1 parent c842fb2 commit 046605d
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions nazurin/sites/kemono/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@ async def get_post(self, service: str, user_id: str, post_id: str) -> dict:
return post

@network_retry
async def get_post_revision(self, service: str, user_id: str, post_id: str,
revision_id: str) -> dict:
async def get_post_revision(
self, service: str, user_id: str, post_id: str, revision_id: str
) -> dict:
"""Fetch a post revision."""
api = f"https://kemono.su/api/v1/{service}/user/{user_id}/post/{post_id}/revisions"

Check warning on line 37 in nazurin/sites/kemono/api.py

View workflow job for this annotation

GitHub Actions / build (3.8)

Line too long (91/88)
async with Request() as request:
Expand Down Expand Up @@ -63,8 +64,9 @@ async def get_username(self, service: str, user_id: str) -> str:
username = tag.get("content", "")
return username

async def fetch(self, service: str, user_id: str, post_id: str,
revision_id: Union[str, None]) -> Illust:
async def fetch(

Check warning on line 67 in nazurin/sites/kemono/api.py

View workflow job for this annotation

GitHub Actions / build (3.8)

Too many local variables (17/15)
self, service: str, user_id: str, post_id: str, revision_id: Union[str, None]
) -> Illust:
if revision_id:
post = await self.get_post_revision(service, user_id, post_id, revision_id)
else:
Expand Down Expand Up @@ -146,7 +148,11 @@ def build_caption(post) -> Caption:
"url": (
f"https://kemono.su/{post['service']}"
f"/user/{post['user']}/post/{post['id']}"
+ (f"/revision/{post['revision_id']}" if post.get('revision_id') else '')
+ (
f"/revision/{post['revision_id']}"
if post.get("revision_id")
else ""
)
),
}
)
Expand Down

0 comments on commit 046605d

Please sign in to comment.