This commit is contained in:
jxxghp
2024-05-14 11:43:51 +08:00
parent 4b74cf49e6
commit 0f774c3d98
2 changed files with 12 additions and 9 deletions

View File

@@ -164,10 +164,13 @@
"name": "收藏洗版",
"description": "Jellyfin/Emby/Plex点击收藏电影后自动订阅洗版。",
"labels": "订阅",
"version": "2.1",
"version": "2.2",
"icon": "like.jpg",
"author": "wlj",
"level": 2
"level": 2,
"history": {
"v2.2": "修复运行报错问题"
}
},
"MediaServerMsg": {
"name": "媒体库服务器通知",

View File

@@ -34,7 +34,7 @@ class BestFilmVersion(_PluginBase):
# 插件图标
plugin_icon = "like.jpg"
# 插件版本
plugin_version = "2.1"
plugin_version = "2.2"
# 插件作者
plugin_author = "wlj"
# 作者主页
@@ -448,7 +448,7 @@ class BestFilmVersion(_PluginBase):
continue
# 获取tmdb_id
tmdb_id = item_info_resp.tmdbid
tmdb_id = item_info_resp.get("tmdbid")
if not tmdb_id:
continue
# 识别媒体信息
@@ -594,7 +594,7 @@ class BestFilmVersion(_PluginBase):
return []
@staticmethod
def plex_get_iteminfo(itemid):
def plex_get_iteminfo(itemid) -> dict:
url = f"https://metadata.provider.plex.tv/library/metadata/{itemid}" \
f"?X-Plex-Token={settings.PLEX_TOKEN}"
ids = []
@@ -614,14 +614,14 @@ class BestFilmVersion(_PluginBase):
ids.append({'Name': 'TheMovieDb', 'Url': id_list[0]})
if not ids:
return []
return {}
return {'ExternalUrls': ids}
else:
logger.error(f"Plex/Items 未获取到返回数据")
return []
return {}
except Exception as e:
logger.error(f"连接Plex/Items 出错:" + str(e))
return []
return {}
@eventmanager.register(EventType.WebhookMessage)
def webhook_message_action(self, event):
@@ -662,7 +662,7 @@ class BestFilmVersion(_PluginBase):
if info.item_type not in ['Movie', 'MOV', 'movie']:
return
# 获取tmdb_id
tmdb_id = info.tmdbid
tmdb_id = info.get("tmdbid")
else:
tmdb_id = data.tmdb_id
if (data.channel == 'jellyfin'