From d2f64d4a10caf1f820ee6bf97c2fd7025bb7ce41 Mon Sep 17 00:00:00 2001 From: thsrite Date: Tue, 2 Jan 2024 14:20:52 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E8=B1=86=E7=93=A3=E6=98=8E=E6=98=9F?= =?UTF-8?q?=E7=83=AD=E6=98=A0=E8=AE=A2=E9=98=85v1.1=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E8=87=AA=E5=AE=9A=E4=B9=89=E5=88=86=E8=BE=A8=E7=8E=87=E3=80=81?= =?UTF-8?q?=E8=B4=A8=E9=87=8F=E3=80=81=E7=89=B9=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- docs/ActorSubscribe.md | 1 + package.json | 2 +- plugins/actorsubscribe/__init__.py | 115 ++++++++++++++++++++++++++++- 4 files changed, 116 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 40dd5c7..4d57e28 100644 --- a/README.md +++ b/README.md @@ -23,5 +23,5 @@ MoviePilot三方插件市场:https://github.com/thsrite/MoviePilot-Plugins/ - [日程提醒 1.0](docs%2FScheduleReminder.md) - [订阅提醒 1.1](docs%2FSubscribeReminder.md) - [Emby观影报告 1.4](docs%2FEmbyReporter.md) -- [豆瓣明星热映订阅 1.0](docs%2FActorSubscribe.md) +- [豆瓣明星热映订阅 1.1](docs%2FActorSubscribe.md) diff --git a/docs/ActorSubscribe.md b/docs/ActorSubscribe.md index 8a23461..6d1bd01 100644 --- a/docs/ActorSubscribe.md +++ b/docs/ActorSubscribe.md @@ -2,4 +2,5 @@ ### 更新记录 +- 1.1 支持自定义分辨率、质量、特效 - 1.0 自动订阅豆瓣明星最新电影 diff --git a/package.json b/package.json index a3965ca..c4d36b8 100644 --- a/package.json +++ b/package.json @@ -114,7 +114,7 @@ "ActorSubscribe": { "name": "豆瓣明星热映订阅", "description": "自动订阅豆瓣明星最新电影。", - "version": "1.0", + "version": "1.1", "icon": "Mdcng_A.png", "author": "thsrite", "level": 1 diff --git a/plugins/actorsubscribe/__init__.py b/plugins/actorsubscribe/__init__.py index bb37ed3..e83c1a4 100644 --- a/plugins/actorsubscribe/__init__.py +++ b/plugins/actorsubscribe/__init__.py @@ -21,7 +21,7 @@ class ActorSubscribe(_PluginBase): # 插件图标 plugin_icon = "Mdcng_A.png" # 插件版本 - plugin_version = "1.0" + plugin_version = "1.1" # 插件作者 plugin_author = "thsrite" # 作者主页 @@ -40,6 +40,38 @@ class ActorSubscribe(_PluginBase): _actors = None subscribechain = None _scheduler: Optional[BackgroundScheduler] = None + _quality = None + _resolution = None + _effect = None + # 质量选择框数据 + _qualityOptions = { + '全部': '', + '蓝光原盘': 'Blu-?Ray.+VC-?1|Blu-?Ray.+AVC|UHD.+blu-?ray.+HEVC|MiniBD', + 'Remux': 'Remux', + 'BluRay': 'Blu-?Ray', + 'UHD': 'UHD|UltraHD', + 'WEB-DL': 'WEB-?DL|WEB-?RIP', + 'HDTV': 'HDTV', + 'H265': '[Hx].?265|HEVC', + 'H264': '[Hx].?264|AVC' + } + + # 分辨率选择框数据 + _resolutionOptions = { + '全部': '', + '4k': '4K|2160p|x2160', + '1080p': '1080[pi]|x1080', + '720p': '720[pi]|x720' + } + + # 特效选择框数据 + _effectOptions = { + '全部': '', + '杜比视界': 'Dolby[\\s.]+Vision|DOVI|[\\s.]+DV[\\s.]+', + '杜比全景声': 'Dolby[\\s.]*\\+?Atmos|Atmos', + 'HDR': '[\\s.]+HDR[\\s.]+|HDR10|HDR10\\+', + 'SDR': '[\\s.]+SDR[\\s.]+', + } def init_plugin(self, config: dict = None): self.subscribechain = SubscribeChain() @@ -51,6 +83,9 @@ class ActorSubscribe(_PluginBase): self._onlyonce = config.get("onlyonce") self._cron = config.get("cron") self._actors = config.get("actors") + self._quality = config.get("quality") + self._resolution = config.get("resolution") + self._effect = config.get("effect") if self._enabled or self._onlyonce: # 定时服务 @@ -127,6 +162,9 @@ class ActorSubscribe(_PluginBase): tmdbid=mediainfo.tmdb_id, doubanid=mediainfo.douban_id, exist_ok=True, + quality=self._quality, + resolution=self._resolution, + effect=self._effect, username=settings.SUPERUSER) # 存储历史记录 history.append({ @@ -149,7 +187,10 @@ class ActorSubscribe(_PluginBase): "enabled": self._enabled, "onlyonce": self._onlyonce, "cron": self._cron, - "actors": self._actors + "actors": self._actors, + "quality": self._quality, + "resolution": self._resolution, + "effect": self._effect }) def get_state(self) -> bool: @@ -166,6 +207,11 @@ class ActorSubscribe(_PluginBase): """ 拼装插件配置页面,需要返回两块数据:1、页面配置;2、数据结构 """ + qualityOptions = [{"title": i, "value": self._qualityOptions.get(i)} for i in self._qualityOptions.keys()] + resolutionOptions = [{"title": i, "value": self._resolutionOptions.get(i)} for i in + self._resolutionOptions.keys()] + effectOptions = [{"title": i, "value": self._effectOptions.get(i)} for i in self._effectOptions.keys()] + return [ { 'component': 'VForm', @@ -246,6 +292,68 @@ class ActorSubscribe(_PluginBase): }, ] }, + { + 'component': 'VRow', + 'content': [ + { + 'component': 'VCol', + 'props': { + 'cols': 12, + 'md': 4 + }, + 'content': [ + { + 'component': 'VSelect', + 'props': { + 'multiple': False, + 'chips': True, + 'model': 'quality', + 'label': '质量', + 'items': qualityOptions + } + } + ] + }, + { + 'component': 'VCol', + 'props': { + 'cols': 12, + 'md': 4 + }, + 'content': [ + { + 'component': 'VSelect', + 'props': { + 'multiple': False, + 'chips': True, + 'model': 'resolution', + 'label': '分辨率', + 'items': resolutionOptions + } + } + ] + }, + { + 'component': 'VCol', + 'props': { + 'cols': 12, + 'md': 4 + }, + 'content': [ + { + 'component': 'VSelect', + 'props': { + 'multiple': False, + 'chips': True, + 'model': 'effect', + 'label': '特效', + 'items': effectOptions + } + } + ] + }, + ] + }, ] } ], { @@ -253,6 +361,9 @@ class ActorSubscribe(_PluginBase): "onlyonce": False, "cron": "5 1 * * *", "actors": "", + "quality": "", + "resolution": "", + "effect": "", } def get_page(self) -> List[dict]: