fix rardar

This commit is contained in:
jxxghp
2023-06-13 20:20:02 +08:00
parent a743403faa
commit ac9dbb5239
5 changed files with 56 additions and 38 deletions
+1
View File
@@ -96,6 +96,7 @@ class DoubanSyncChain(ChainBase):
logger.info(f'{mediainfo.get_title_string()} 未下载未完整,添加订阅 ...')
# 添加订阅
self.subscribechain.process(title=mediainfo.title,
year=mediainfo.year,
mtype=mediainfo.type,
tmdbid=mediainfo.tmdb_id,
season=meta.begin_season,
+8 -4
View File
@@ -28,7 +28,7 @@ class SubscribeChain(ChainBase):
self.subscribes = Subscribes()
self.siteshelper = SitesHelper()
def process(self, title: str,
def process(self, title: str, year: str,
mtype: MediaType = None,
tmdbid: int = None,
season: int = None,
@@ -45,6 +45,8 @@ class SubscribeChain(ChainBase):
title, _ = result
# 识别元数据
metainfo = MetaInfo(title)
if year:
metainfo.year = year
if mtype:
metainfo.type = mtype
if season:
@@ -305,6 +307,7 @@ class SubscribeChain(ChainBase):
if no_exists \
and no_exists.get(tmdb_id) \
and (total_episode or start_episode):
index = 0
for no_exist in no_exists.get(tmdb_id):
# 替换原季值
if no_exist.get("season") == begin_season:
@@ -315,7 +318,7 @@ class SubscribeChain(ChainBase):
if total_episode and start_episode:
# 有开始集和总集数
episodes = list(range(start_episode, total_episode + 1))
no_exist = {
no_exists[tmdb_id][index] = {
"season": begin_season,
"episodes": episodes,
"total_episodes": total_episode,
@@ -324,7 +327,7 @@ class SubscribeChain(ChainBase):
elif not start_episode:
# 有总集数没有开始集
episodes = list(range(min(episode_list or [1]), total_episode + 1))
no_exist = {
no_exists[tmdb_id][index] = {
"season": begin_season,
"episodes": episodes,
"total_episodes": total_episode,
@@ -333,10 +336,11 @@ class SubscribeChain(ChainBase):
elif not total_episode:
# 有开始集没有总集数
episodes = list(range(start_episode, max(episode_list or [total]) + 1))
no_exist = {
no_exists[tmdb_id][index] = {
"season": begin_season,
"episodes": episodes,
"total_episodes": max(episode_list or [total]),
"start_episode": start_episode
}
index += 1
return no_exists
+2
View File
@@ -129,6 +129,7 @@ class UserMessageChain(ChainBase):
# 订阅媒体
mediainfo: MediaInfo = cache_list[int(text) - 1]
self.subscribechain.process(title=mediainfo.title,
year=mediainfo.year,
mtype=mediainfo.type,
tmdbid=mediainfo.tmdb_id,
season=self._current_meta.begin_season,
@@ -157,6 +158,7 @@ class UserMessageChain(ChainBase):
logger.info(f'{self._current_media.get_title_string()} 未下载未完整,添加订阅 ...')
# 添加订阅
self.subscribechain.process(title=self._current_media.title,
year=self._current_media.year,
mtype=self._current_media.type,
tmdbid=self._current_media.tmdb_id,
season=self._current_meta.begin_season,