From 61c695b77dbd367ae812d73fe9dba084355b9669 Mon Sep 17 00:00:00 2001 From: InfinityPacer Date: Sat, 11 Apr 2026 22:33:50 +0800 Subject: [PATCH] fix(subscribe): reset tv episode counts in history response --- app/api/endpoints/subscribe.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/app/api/endpoints/subscribe.py b/app/api/endpoints/subscribe.py index 4a331f9a..ed347091 100644 --- a/app/api/endpoints/subscribe.py +++ b/app/api/endpoints/subscribe.py @@ -399,7 +399,15 @@ async def subscribe_history( """ 查询电影/电视剧订阅历史 """ - return await SubscribeHistory.async_list_by_type(db, mtype=mtype, page=page, count=count) + histories = await SubscribeHistory.async_list_by_type(db, mtype=mtype, page=page, count=count) + result = [] + for history in histories: + history_item = schemas.Subscribe.model_validate(history, from_attributes=True) + if history_item.type == MediaType.TV.value: + history_item.total_episode = 0 + history_item.lack_episode = 0 + result.append(history_item) + return result @router.delete("/history/{history_id}", summary="删除订阅历史", response_model=schemas.Response)