Skip to content

Commit

Permalink
refactor(ani2alist):提供更多类型标注、格式化文档
Browse files Browse the repository at this point in the history
  • Loading branch information
Akimio521 committed Jul 11, 2024
1 parent 49c1f44 commit 7356276
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions app/modules/ani2alist/ani2alist.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,9 @@ def merge_dicts(target_dict: dict, source_dict: dict) -> dict:
else:
logger.error(f"创建存储器后未找到存储器:{self.__target_dir}")

def __is_valid(self, year: int | None, month: int | None, key_word: str | None) -> bool:
def __is_valid(
self, year: int | None, month: int | None, key_word: str | None
) -> bool:
"""
判断传入的年月是否比当前时间更早
Expand Down Expand Up @@ -167,7 +169,7 @@ def __get_ani_season(self) -> str:
"""
if self.__key_word:
return self.__key_word

current_date = datetime.now()
if isinstance(self.__year, int) and isinstance(self.__month, int):
year = self.__year
Expand Down Expand Up @@ -201,11 +203,11 @@ async def parse_data(_url: str = url) -> dict:

_anime_dict = {}
for file in _result["files"]:
mimeType = file["mimeType"]
name = file["name"]
mimeType: str = file["mimeType"]
name: str = file["name"]

if mimeType in FILE_MINETYPE:
size = file["size"]
size: int = file["size"]
logger.debug(f"获取文件:{name},文件大小:{size}")
_anime_dict[name] = [
size,
Expand Down

0 comments on commit 7356276

Please sign in to comment.