mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-09-04 23:17:20 +08:00
Merge pull request #5451 from cddjr/fix_specials_season
This commit is contained in:
@@ -63,7 +63,7 @@ class SearchMediaTool(MoviePilotTool):
|
|||||||
if media_type:
|
if media_type:
|
||||||
if result.type != MediaType(media_type):
|
if result.type != MediaType(media_type):
|
||||||
continue
|
continue
|
||||||
if season and result.season != season:
|
if season is not None and result.season != season:
|
||||||
continue
|
continue
|
||||||
filtered_results.append(result)
|
filtered_results.append(result)
|
||||||
|
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ class SearchTorrentsTool(MoviePilotTool):
|
|||||||
if media_type and torrent.media_info:
|
if media_type and torrent.media_info:
|
||||||
if torrent.media_info.type != MediaType(media_type):
|
if torrent.media_info.type != MediaType(media_type):
|
||||||
continue
|
continue
|
||||||
if season and torrent.meta_info and torrent.meta_info.begin_season != season:
|
if season is not None and torrent.meta_info and torrent.meta_info.begin_season != season:
|
||||||
continue
|
continue
|
||||||
# 使用正则表达式过滤标题(分辨率、质量等关键字)
|
# 使用正则表达式过滤标题(分辨率、质量等关键字)
|
||||||
if regex_pattern and torrent.torrent_info and torrent.torrent_info.title:
|
if regex_pattern and torrent.torrent_info and torrent.torrent_info.title:
|
||||||
|
|||||||
@@ -195,7 +195,7 @@ async def seasons(mediaid: Optional[str] = None,
|
|||||||
tmdbid = int(mediaid[5:])
|
tmdbid = int(mediaid[5:])
|
||||||
seasons_info = await TmdbChain().async_tmdb_seasons(tmdbid=tmdbid)
|
seasons_info = await TmdbChain().async_tmdb_seasons(tmdbid=tmdbid)
|
||||||
if seasons_info:
|
if seasons_info:
|
||||||
if season:
|
if season is not None:
|
||||||
return [sea for sea in seasons_info if sea.season_number == season]
|
return [sea for sea in seasons_info if sea.season_number == season]
|
||||||
return seasons_info
|
return seasons_info
|
||||||
if title:
|
if title:
|
||||||
@@ -207,11 +207,11 @@ async def seasons(mediaid: Optional[str] = None,
|
|||||||
if settings.RECOGNIZE_SOURCE == "themoviedb":
|
if settings.RECOGNIZE_SOURCE == "themoviedb":
|
||||||
seasons_info = await TmdbChain().async_tmdb_seasons(tmdbid=mediainfo.tmdb_id)
|
seasons_info = await TmdbChain().async_tmdb_seasons(tmdbid=mediainfo.tmdb_id)
|
||||||
if seasons_info:
|
if seasons_info:
|
||||||
if season:
|
if season is not None:
|
||||||
return [sea for sea in seasons_info if sea.season_number == season]
|
return [sea for sea in seasons_info if sea.season_number == season]
|
||||||
return seasons_info
|
return seasons_info
|
||||||
else:
|
else:
|
||||||
sea = season or 1
|
sea = season if season is not None else 1
|
||||||
return [schemas.MediaSeason(
|
return [schemas.MediaSeason(
|
||||||
season_number=sea,
|
season_number=sea,
|
||||||
poster_path=mediainfo.poster_path,
|
poster_path=mediainfo.poster_path,
|
||||||
|
|||||||
@@ -199,7 +199,7 @@ async def subscribe_mediaid(
|
|||||||
# 使用名称检查订阅
|
# 使用名称检查订阅
|
||||||
if title_check and title:
|
if title_check and title:
|
||||||
meta = MetaInfo(title)
|
meta = MetaInfo(title)
|
||||||
if season:
|
if season is not None:
|
||||||
meta.begin_season = season
|
meta.begin_season = season
|
||||||
result = await Subscribe.async_get_by_title(db, title=meta.name, season=meta.begin_season)
|
result = await Subscribe.async_get_by_title(db, title=meta.name, season=meta.begin_season)
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -958,10 +958,10 @@ class MediaChain(ChainBase):
|
|||||||
year = None
|
year = None
|
||||||
if tmdbinfo.get('release_date'):
|
if tmdbinfo.get('release_date'):
|
||||||
year = tmdbinfo['release_date'][:4]
|
year = tmdbinfo['release_date'][:4]
|
||||||
elif tmdbinfo.get('seasons') and season:
|
elif tmdbinfo.get('seasons') and season is not None:
|
||||||
for seainfo in tmdbinfo['seasons']:
|
for seainfo in tmdbinfo['seasons']:
|
||||||
season_number = seainfo.get("season_number")
|
season_number = seainfo.get("season_number")
|
||||||
if not season_number:
|
if season_number is None:
|
||||||
continue
|
continue
|
||||||
air_date = seainfo.get("air_date")
|
air_date = seainfo.get("air_date")
|
||||||
if air_date and season_number == season:
|
if air_date and season_number == season:
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ class DoubanScraper:
|
|||||||
# 电影元数据文件
|
# 电影元数据文件
|
||||||
doc = self.__gen_movie_nfo_file(mediainfo=mediainfo)
|
doc = self.__gen_movie_nfo_file(mediainfo=mediainfo)
|
||||||
else:
|
else:
|
||||||
if season:
|
if season is not None:
|
||||||
# 季元数据文件
|
# 季元数据文件
|
||||||
doc = self.__gen_tv_season_nfo_file(mediainfo=mediainfo, season=season)
|
doc = self.__gen_tv_season_nfo_file(mediainfo=mediainfo, season=season)
|
||||||
else:
|
else:
|
||||||
@@ -41,7 +41,7 @@ class DoubanScraper:
|
|||||||
:param episode: 集号
|
:param episode: 集号
|
||||||
"""
|
"""
|
||||||
ret_dict = {}
|
ret_dict = {}
|
||||||
if season:
|
if season is not None:
|
||||||
# 豆瓣无季图片
|
# 豆瓣无季图片
|
||||||
return {}
|
return {}
|
||||||
if episode:
|
if episode:
|
||||||
|
|||||||
Reference in New Issue
Block a user