From 1b2f09b95f48d3bdd299bd775bbe8a9ce570a07b Mon Sep 17 00:00:00 2001 From: thsrite Date: Tue, 12 Sep 2023 12:45:39 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E8=87=AA=E5=AE=9A=E4=B9=89=E8=AE=A2?= =?UTF-8?q?=E9=98=85=E6=8F=92=E4=BB=B6=E5=A2=9E=E5=8A=A0=E8=AF=86=E5=88=AB?= =?UTF-8?q?=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/plugins/rsssubscribe/__init__.py | 54 ++++++++++++++++++++-------- 1 file changed, 40 insertions(+), 14 deletions(-) diff --git a/app/plugins/rsssubscribe/__init__.py b/app/plugins/rsssubscribe/__init__.py index 08c6f4b7..f6d755b7 100644 --- a/app/plugins/rsssubscribe/__init__.py +++ b/app/plugins/rsssubscribe/__init__.py @@ -65,6 +65,7 @@ class RssSubscribe(_PluginBase): _clear: bool = False _clearflag: bool = False _action: str = "subscribe" + _recognization: str = "Y" _save_path: str = "" def init_plugin(self, config: dict = None): @@ -89,6 +90,7 @@ class RssSubscribe(_PluginBase): self._filter = config.get("filter") self._clear = config.get("clear") self._action = config.get("action") + self._recognization = config.get("recognization") self._save_path = config.get("save_path") if self._enabled or self._onlyonce: @@ -219,7 +221,7 @@ class RssSubscribe(_PluginBase): 'component': 'VCol', 'props': { 'cols': 12, - 'md': 6 + 'md': 4 }, 'content': [ { @@ -236,7 +238,7 @@ class RssSubscribe(_PluginBase): 'component': 'VCol', 'props': { 'cols': 12, - 'md': 6 + 'md': 4 }, 'content': [ { @@ -251,6 +253,26 @@ class RssSubscribe(_PluginBase): } } ] + }, + { + 'component': 'VCol', + 'props': { + 'cols': 12, + 'md': 4 + }, + 'content': [ + { + 'component': 'VSelect', + 'props': { + 'model': 'recognization', + 'label': '识别', + 'items': [ + {'title': '是', 'value': 'Y'}, + {'title': '否', 'value': 'N'} + ] + } + } + ] } ] }, @@ -403,6 +425,7 @@ class RssSubscribe(_PluginBase): "clear": False, "filter": False, "action": "subscribe", + "recognization": "Y", "save_path": "" } @@ -525,7 +548,9 @@ class RssSubscribe(_PluginBase): "include": self._include, "exclude": self._exclude, "proxy": self._proxy, - "clear": self._clear + "clear": self._clear, + "action": self._action, + "recognization": self._recognization, }) def check(self): @@ -605,17 +630,18 @@ class RssSubscribe(_PluginBase): continue else: if self._action == "download": - if mediainfo.type == MediaType.TV: - if no_exists: - exist_info = no_exists.get(mediainfo.tmdb_id) - season_info = exist_info.get(meta.begin_season or 1) - if not season_info: - logger.info(f'{mediainfo.title_year} {meta.season} 己存在') - continue - if (season_info.episodes - and not set(meta.episode_list).issubset(set(season_info.episodes))): - logger.info(f'{mediainfo.title_year} {meta.season_episode} 己存在') - continue + if str(self._recognization) == "Y": + if mediainfo.type == MediaType.TV: + if no_exists: + exist_info = no_exists.get(mediainfo.tmdb_id) + season_info = exist_info.get(meta.begin_season or 1) + if not season_info: + logger.info(f'{mediainfo.title_year} {meta.season} 己存在') + continue + if (season_info.episodes + and not set(meta.episode_list).issubset(set(season_info.episodes))): + logger.info(f'{mediainfo.title_year} {meta.season_episode} 己存在') + continue # 添加下载 result = self.downloadchain.download_single( context=Context(