mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-09-04 23:17:20 +08:00
feat: Add search_imdbid to subscriptions and improve error message propagation and handling for existing subscriptions.
This commit is contained in:
@@ -108,6 +108,9 @@ class AddSubscribeTool(MoviePilotTool):
|
|||||||
**subscribe_kwargs
|
**subscribe_kwargs
|
||||||
)
|
)
|
||||||
if sid:
|
if sid:
|
||||||
|
if message and "已存在" in message:
|
||||||
|
return f"订阅已存在:{title} ({year})。如需修改参数请先删除旧订阅。"
|
||||||
|
|
||||||
result_msg = f"成功添加订阅:{title} ({year})"
|
result_msg = f"成功添加订阅:{title} ({year})"
|
||||||
if subscribe_kwargs:
|
if subscribe_kwargs:
|
||||||
params = []
|
params = []
|
||||||
|
|||||||
@@ -292,7 +292,7 @@ class SubscribeChain(ChainBase):
|
|||||||
"description": mediainfo.overview
|
"description": mediainfo.overview
|
||||||
})
|
})
|
||||||
# 返回结果
|
# 返回结果
|
||||||
return sid, ""
|
return sid, err_msg
|
||||||
|
|
||||||
async def async_add(self, title: str, year: str,
|
async def async_add(self, title: str, year: str,
|
||||||
mtype: MediaType = None,
|
mtype: MediaType = None,
|
||||||
@@ -469,7 +469,7 @@ class SubscribeChain(ChainBase):
|
|||||||
"description": mediainfo.overview
|
"description": mediainfo.overview
|
||||||
})
|
})
|
||||||
# 返回结果
|
# 返回结果
|
||||||
return sid, ""
|
return sid, err_msg
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def exists(mediainfo: MediaInfo, meta: MetaBase = None):
|
def exists(mediainfo: MediaInfo, meta: MetaBase = None):
|
||||||
|
|||||||
@@ -71,6 +71,7 @@ class SubscribeOper(DbOper):
|
|||||||
"backdrop": mediainfo.get_backdrop_image(),
|
"backdrop": mediainfo.get_backdrop_image(),
|
||||||
"vote": mediainfo.vote_average,
|
"vote": mediainfo.vote_average,
|
||||||
"description": mediainfo.overview,
|
"description": mediainfo.overview,
|
||||||
|
"search_imdbid": 1 if kwargs.get('search_imdbid') else 0,
|
||||||
"date": time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())
|
"date": time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())
|
||||||
})
|
})
|
||||||
if not subscribe:
|
if not subscribe:
|
||||||
|
|||||||
Reference in New Issue
Block a user