mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-09-05 23:47:41 +08:00
Merge pull request #3219 from mackerel-12138/s0_fix
This commit is contained in:
+5
-2
@@ -489,7 +489,10 @@ class MediaChain(ChainBase, metaclass=Singleton):
|
|||||||
if init_folder:
|
if init_folder:
|
||||||
# 识别文件夹名称
|
# 识别文件夹名称
|
||||||
season_meta = MetaInfo(filepath.name)
|
season_meta = MetaInfo(filepath.name)
|
||||||
if season_meta.begin_season:
|
# 当前文件夹为Specials或者SPs时,设置为S0
|
||||||
|
if filepath.name in settings.RENAME_FORMAT_S0_NAMES:
|
||||||
|
season_meta.begin_season = 0
|
||||||
|
if season_meta.begin_season is not None:
|
||||||
# 是否已存在
|
# 是否已存在
|
||||||
nfo_path = filepath / "season.nfo"
|
nfo_path = filepath / "season.nfo"
|
||||||
if not overwrite and self.storagechain.get_file_item(storage=fileitem.storage, path=nfo_path):
|
if not overwrite and self.storagechain.get_file_item(storage=fileitem.storage, path=nfo_path):
|
||||||
@@ -517,7 +520,7 @@ class MediaChain(ChainBase, metaclass=Singleton):
|
|||||||
if content:
|
if content:
|
||||||
__save_file(_fileitem=fileitem, _path=image_path, _content=content)
|
__save_file(_fileitem=fileitem, _path=image_path, _content=content)
|
||||||
# 判断当前目录是不是剧集根目录
|
# 判断当前目录是不是剧集根目录
|
||||||
if season_meta.name:
|
if not season_meta.season:
|
||||||
# 是否已存在
|
# 是否已存在
|
||||||
nfo_path = filepath / "tvshow.nfo"
|
nfo_path = filepath / "tvshow.nfo"
|
||||||
if not overwrite and self.storagechain.get_file_item(storage=fileitem.storage, path=nfo_path):
|
if not overwrite and self.storagechain.get_file_item(storage=fileitem.storage, path=nfo_path):
|
||||||
|
|||||||
@@ -232,6 +232,10 @@ class ConfigModel(BaseModel):
|
|||||||
SECURITY_IMAGE_SUFFIXES: List[str] = Field(
|
SECURITY_IMAGE_SUFFIXES: List[str] = Field(
|
||||||
default_factory=lambda: [".jpg", ".jpeg", ".png", ".webp", ".gif", ".svg"]
|
default_factory=lambda: [".jpg", ".jpeg", ".png", ".webp", ".gif", ".svg"]
|
||||||
)
|
)
|
||||||
|
# 重命名时支持的S0别名
|
||||||
|
RENAME_FORMAT_S0_NAMES: List[str] = Field(
|
||||||
|
default_factory=lambda: ["Specials", "SPs"]
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class Settings(BaseSettings, ConfigModel):
|
class Settings(BaseSettings, ConfigModel):
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ class TmdbScraper:
|
|||||||
# 电影元数据文件
|
# 电影元数据文件
|
||||||
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:
|
||||||
# 查询季信息
|
# 查询季信息
|
||||||
seasoninfo = self.tmdb.get_tv_season_detail(mediainfo.tmdb_id, meta.begin_season)
|
seasoninfo = self.tmdb.get_tv_season_detail(mediainfo.tmdb_id, meta.begin_season)
|
||||||
if episode:
|
if episode:
|
||||||
@@ -57,7 +57,7 @@ class TmdbScraper:
|
|||||||
:param episode: 集号
|
:param episode: 集号
|
||||||
"""
|
"""
|
||||||
images = {}
|
images = {}
|
||||||
if season:
|
if season is not None:
|
||||||
# 只需要集的图片
|
# 只需要集的图片
|
||||||
if episode:
|
if episode:
|
||||||
# 集的图片
|
# 集的图片
|
||||||
|
|||||||
Reference in New Issue
Block a user