chore: 整理代码逻辑,留出下载字幕的入口

This commit is contained in:
amtoaer
2023-12-05 23:59:46 +08:00
parent 46d1810e7c
commit de6eaeb4a6
5 changed files with 104 additions and 50 deletions

View File

@@ -133,6 +133,20 @@ class FavoriteItem(Model):
/ f"{self.bvid}-poster.jpg"
)
@property
def upper_path(self) -> list[Path]:
return [
self.upper.thumb_path,
self.upper.meta_path,
]
@property
def subtitle_path(self) -> Path:
return (
Path(settings.path_mapper[self.favorite_list_id])
/ f"{self.bvid}.zh-CN.default.ass"
)
async def init_model() -> None:
await Tortoise.init(config=TORTOISE_ORM)