diff --git a/app/api/endpoints/subscribe.py b/app/api/endpoints/subscribe.py index dc5b11cf..48f8102e 100644 --- a/app/api/endpoints/subscribe.py +++ b/app/api/endpoints/subscribe.py @@ -1,6 +1,7 @@ import json from typing import List, Any +import cn2an from fastapi import APIRouter, Request, BackgroundTasks, Depends, HTTPException, Header from sqlalchemy.orm import Session @@ -351,7 +352,14 @@ def popular_subscribes( for sub in subscribes: media = MediaInfo() media.type = MediaType(sub.get("type")) - media.title = sub.get("name") + # 处理标题 + title = sub.get("name") + season = sub.get("season") + if season and int(season) > 1: + # 小写数据转大写 + season_str = cn2an.an2cn(season, "low") + title = f"{title} 第{season_str}季" + media.title = title media.year = sub.get("year") media.tmdb_id = sub.get("tmdbid") media.douban_id = sub.get("doubanid") diff --git a/app/helper/plugin.py b/app/helper/plugin.py index 12309418..23aaae53 100644 --- a/app/helper/plugin.py +++ b/app/helper/plugin.py @@ -81,6 +81,8 @@ class PluginHelper(metaclass=Singleton): """ 获取插件安装统计 """ + if not settings.PLUGIN_STATISTIC_SHARE: + return {} res = RequestUtils(timeout=10).get_res(self._install_statistic) if res and res.status_code == 200: return res.json() diff --git a/app/helper/subscribe.py b/app/helper/subscribe.py index 3c70ddb1..abe4875e 100644 --- a/app/helper/subscribe.py +++ b/app/helper/subscribe.py @@ -29,11 +29,13 @@ class SubscribeHelper(metaclass=Singleton): if self.sub_report(): self.systemconfig.set(SystemConfigKey.SubscribeReport, "1") - @cached(cache=TTLCache(maxsize=10, ttl=1800)) + @cached(cache=TTLCache(maxsize=20, ttl=1800)) def get_statistic(self, stype: str, page: int = 1, count: int = 30) -> List[dict]: """ 获取订阅统计数据 """ + if not settings.SUBSCRIBE_STATISTIC_SHARE: + return [] res = RequestUtils(timeout=15).get_res(self._sub_statistic, params={ "stype": stype, "page": page,