From 556cdddceb7b906f488c61eef98d6d6c0bf76fce Mon Sep 17 00:00:00 2001 From: thsrite Date: Thu, 16 May 2024 09:16:34 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E8=B0=83=E6=95=B4=E8=AE=A2=E9=98=85?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E5=90=8D=EF=BC=8C=E9=BB=98=E8=AE=A4=EF=BC=9A?= =?UTF-8?q?=E7=83=AD=E9=97=A8=E8=AE=A2=E9=98=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- package.json | 3 ++- plugins/popularsubscribe/__init__.py | 29 ++++++++++++++++++++++++---- 3 files changed, 28 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index c657868..266f252 100644 --- a/README.md +++ b/README.md @@ -36,5 +36,5 @@ MoviePilot三方插件市场:https://github.com/thsrite/MoviePilot-Plugins/ - 订阅规则自动填充 2.6 - Emby元数据刷新 1.1 - Emby媒体标签 1.1 -- 热门媒体订阅 1.6 +- 热门媒体订阅 1.7 - [HomePage 1.0](docs%2FHomePage.md) diff --git a/package.json b/package.json index 51235a5..92571dd 100644 --- a/package.json +++ b/package.json @@ -412,11 +412,12 @@ "name": "热门媒体订阅", "description": "自定添加热门媒体到订阅。", "labels": "订阅", - "version": "1.6", + "version": "1.7", "icon": "https://raw.githubusercontent.com/thsrite/MoviePilot-Plugins/main/icons/popular.png", "author": "thsrite", "level": 1, "history": { + "v1.7": "调整订阅用户名,默认:热门订阅", "v1.6": "调整历史unique唯一索引(可删除本次更新后的历史)", "v1.5": "修复电视剧订阅、订阅历史展示", "v1.4": "动漫单独订阅(本子佬启动!)", diff --git a/plugins/popularsubscribe/__init__.py b/plugins/popularsubscribe/__init__.py index a0d4962..58ba1b9 100644 --- a/plugins/popularsubscribe/__init__.py +++ b/plugins/popularsubscribe/__init__.py @@ -27,7 +27,7 @@ class PopularSubscribe(_PluginBase): # 插件图标 plugin_icon = "https://raw.githubusercontent.com/thsrite/MoviePilot-Plugins/main/icons/popular.png" # 插件版本 - plugin_version = "1.6" + plugin_version = "1.7" # 插件作者 plugin_author = "thsrite" # 作者主页 @@ -57,6 +57,7 @@ class PopularSubscribe(_PluginBase): _onlyonce: bool = False _clear = False _clear_already_handle = False + _username = None downloadchain = None subscribechain = None @@ -85,6 +86,7 @@ class PopularSubscribe(_PluginBase): self._anime_popular_cnt = config.get("anime_popular_cnt") self._clear = config.get("clear") self._clear_already_handle = config.get("clear_already_handle") + self._username = config.get("username") or '热门订阅' _onlyonce2 = config.get("onlyonce") # 清理插件订阅历史 @@ -193,7 +195,8 @@ class PopularSubscribe(_PluginBase): "anime_popular_cnt": self._anime_popular_cnt, "clear": self._clear, "clear_already_handle": self._clear_already_handle, - "onlyonce": self._onlyonce + "onlyonce": self._onlyonce, + "username": self._username }) def __popular_subscribe(self, stype, page_cnt, popular_cnt): @@ -297,7 +300,7 @@ class PopularSubscribe(_PluginBase): season=media.season, doubanid=media.douban_id, exist_ok=True, - username=settings.SUPERUSER) + username=self._username) logger.info(f'{media.title_year} 订阅人数:{sub.get("count")} 添加订阅') # 存储历史记录 @@ -667,7 +670,24 @@ class PopularSubscribe(_PluginBase): } } ] - } + }, + { + 'component': 'VCol', + 'props': { + 'cols': 12, + 'md': 3 + }, + 'content': [ + { + 'component': 'VTextField', + 'props': { + 'model': 'username', + 'label': '订阅用户', + 'placeholder': '默认为`热门订阅`' + } + } + ] + }, ] } ] @@ -688,6 +708,7 @@ class PopularSubscribe(_PluginBase): "onlyonce": False, "clear": False, "clear_already_handle": False, + "username": "热门订阅" } def get_page(self) -> List[dict]: