mirror of
https://github.com/amtoaer/bili-sync.git
synced 2026-06-26 09:52:20 +08:00
feat: tag 获取失败不影响主流程
This commit is contained in:
@@ -66,8 +66,6 @@ async def upper_thumb():
|
||||
async def refresh_tags():
|
||||
"""刷新已存在的视频的标签,从不支持标签的版本升级上来后需要手动调用一次"""
|
||||
items = await FavoriteItem.filter(
|
||||
type=MediaType.VIDEO,
|
||||
status=MediaStatus.NORMAL,
|
||||
downloaded=True,
|
||||
tags=None,
|
||||
).prefetch_related("upper")
|
||||
|
||||
11
processor.py
11
processor.py
@@ -194,7 +194,16 @@ async def process_video(
|
||||
if process_nfo:
|
||||
if not await aexists(fav_item.nfo_path):
|
||||
if fav_item.tags is None:
|
||||
fav_item.tags = [_["tag_name"] for _ in await v.get_tags()]
|
||||
try:
|
||||
fav_item.tags = [
|
||||
_["tag_name"] for _ in await v.get_tags()
|
||||
]
|
||||
except Exception:
|
||||
logger.exception(
|
||||
"Failed to get tags of video {} {}",
|
||||
fav_item.bvid,
|
||||
fav_item.name,
|
||||
)
|
||||
# 写入 nfo
|
||||
await EpisodeInfo(
|
||||
title=fav_item.name,
|
||||
|
||||
Reference in New Issue
Block a user