From 89e2567fef5f2ffae5824e5274462d06f8c03eaf Mon Sep 17 00:00:00 2001 From: amtoaer Date: Mon, 4 Dec 2023 01:35:29 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20tag=20=E8=8E=B7=E5=8F=96=E5=A4=B1?= =?UTF-8?q?=E8=B4=A5=E4=B8=8D=E5=BD=B1=E5=93=8D=E4=B8=BB=E6=B5=81=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- commands.py | 2 -- processor.py | 11 ++++++++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/commands.py b/commands.py index 836d488..d0c688c 100644 --- a/commands.py +++ b/commands.py @@ -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") diff --git a/processor.py b/processor.py index 3344014..e4714ba 100644 --- a/processor.py +++ b/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,