fix 修复种子下载不填充bug

This commit is contained in:
thsrite
2024-04-24 11:39:25 +08:00
parent 12326f9456
commit 1137213eb4
3 changed files with 16 additions and 14 deletions

View File

@@ -33,5 +33,5 @@ MoviePilot三方插件市场https://github.com/thsrite/MoviePilot-Plugins/
- docker自定义任务 1.2
- 插件彻底卸载 1.0
- 实时软连接 1.3
- 订阅规则自动填充 1.7
- 订阅规则自动填充 1.8

View File

@@ -322,11 +322,12 @@
"SubscribeGroup": {
"name": "订阅规则自动填充",
"description": "电视剧下载后自动添加官组等信息到订阅;添加订阅后根据二级分类名称自定义订阅规则。",
"version": "1.7",
"version": "1.8",
"icon": "teamwork.png",
"author": "thsrite",
"level": 2,
"history": {
"v1.8": "修复种子下载不填充bug",
"v1.7": "操作历史Unicode编码转中文",
"v1.6": "支持一行配置多个二级分类名称",
"v1.5": "支持操作历史",

View File

@@ -20,7 +20,7 @@ class SubscribeGroup(_PluginBase):
# 插件图标
plugin_icon = "teamwork.png"
# 插件版本
plugin_version = "1.7"
plugin_version = "1.8"
# 插件作者
plugin_author = "thsrite"
# 作者主页
@@ -247,6 +247,9 @@ class SubscribeGroup(_PluginBase):
logger.warning(f"下载历史:{download_history.title} tmdbid:{download_history.tmdbid} 对应订阅记录不存在")
return
logger.info(
f"获取到tmdbid {download_history.tmdbid} season {int(download_history.seasons.replace('S', '')) if download_history.seasons and download_history.seasons.count('-') == 0 else None} 订阅记录:{len(subscribes)}")
for subscribe in subscribes:
if subscribe.type != '电视剧':
logger.warning(f"订阅记录:{subscribe.name} 不是电视剧,不进行官组填充")
@@ -258,29 +261,27 @@ class SubscribeGroup(_PluginBase):
# 分辨率
resource_pix = None
if "resource_pix" in self._update_details and not subscribe.resolution:
if "分辨率" in self._update_details and not subscribe.resolution:
resource_pix = _meta.resource_pix if _meta else None
if resource_pix:
resource_pix = self.__parse_pix(resource_pix)
# 资源类型
resource_type = None
if "resource_type" in self._update_details and not subscribe.quality:
if "资源类型" in self._update_details and not subscribe.quality:
resource_type = _meta.resource_type if _meta else None
if resource_type:
resource_type = self.__parse_type(resource_type)
# 特效
resource_effect = None
if "resource_effect" in self._update_details and not subscribe.effect:
if "特效" in self._update_details and not subscribe.effect:
resource_effect = _meta.resource_effect if _meta else None
if resource_effect:
resource_effect = self.__parse_effect(resource_effect)
resource_team = None
sites = None
logger.error(subscribe.include, subscribe.sites, json.loads(subscribe.sites),
len(json.loads(subscribe.sites)))
if ("group" in self._update_details and not subscribe.include
and (not subscribe.sites or len(json.loads(subscribe.sites)) == 0)):
if ("制作组" in self._update_details and not subscribe.include
and (not subscribe.sites or (subscribe.sites and len(json.loads(subscribe.sites)) == 0))):
logger.error("官组")
# 官组
resource_team = _meta.resource_team if _meta else None
@@ -463,19 +464,19 @@ class SubscribeGroup(_PluginBase):
'items': [
{
"title": "资源质量",
"vale": "resource_type"
"vale": "资源质量"
},
{
"title": "分辨率",
"vale": "resource_pix"
"vale": "分辨率"
},
{
"title": "特效",
"vale": "resource_effect"
"vale": "特效"
},
{
"title": "制作组",
"vale": "group"
"vale": "制作组"
}
]
}