mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-09-05 15:38:19 +08:00
fix:统一调整文件类型支持
This commit is contained in:
@@ -332,9 +332,10 @@ class DownloadChain(ChainBase):
|
|||||||
if not file_meta.begin_episode \
|
if not file_meta.begin_episode \
|
||||||
or file_meta.begin_episode not in episodes:
|
or file_meta.begin_episode not in episodes:
|
||||||
continue
|
continue
|
||||||
# 只处理视频格式
|
# 只处理音视频、字幕格式
|
||||||
|
media_exts = settings.RMT_MEDIAEXT + settings.RMT_SUBEXT + settings.RMT_AUDIOEXT
|
||||||
if not Path(file).suffix \
|
if not Path(file).suffix \
|
||||||
or Path(file).suffix.lower() not in settings.RMT_MEDIAEXT:
|
or Path(file).suffix.lower() not in media_exts:
|
||||||
continue
|
continue
|
||||||
files_to_add.append({
|
files_to_add.append({
|
||||||
"download_hash": _hash,
|
"download_hash": _hash,
|
||||||
|
|||||||
@@ -301,7 +301,8 @@ class MetaVideo(MetaBase):
|
|||||||
return
|
return
|
||||||
else:
|
else:
|
||||||
# 后缀名不要
|
# 后缀名不要
|
||||||
if ".%s".lower() % token in settings.RMT_MEDIAEXT:
|
media_exts = settings.RMT_MEDIAEXT + settings.RMT_SUBEXT + settings.RMT_AUDIOEXT
|
||||||
|
if ".%s".lower() % token in media_exts:
|
||||||
return
|
return
|
||||||
# 英文或者英文+数字,拼装起来
|
# 英文或者英文+数字,拼装起来
|
||||||
if self.en_name:
|
if self.en_name:
|
||||||
|
|||||||
@@ -25,7 +25,8 @@ def MetaInfo(title: str, subtitle: Optional[str] = None, custom_words: List[str]
|
|||||||
# 获取标题中媒体信息
|
# 获取标题中媒体信息
|
||||||
title, metainfo = find_metainfo(title)
|
title, metainfo = find_metainfo(title)
|
||||||
# 判断是否处理文件
|
# 判断是否处理文件
|
||||||
if title and Path(title).suffix.lower() in settings.RMT_MEDIAEXT:
|
media_exts = settings.RMT_MEDIAEXT + settings.RMT_SUBEXT + settings.RMT_AUDIOEXT
|
||||||
|
if title and Path(title).suffix.lower() in media_exts:
|
||||||
isfile = True
|
isfile = True
|
||||||
# 去掉后缀
|
# 去掉后缀
|
||||||
title = Path(title).stem
|
title = Path(title).stem
|
||||||
|
|||||||
@@ -790,7 +790,8 @@ class TransHandler:
|
|||||||
continue
|
continue
|
||||||
if media_file.type != "file":
|
if media_file.type != "file":
|
||||||
continue
|
continue
|
||||||
if f".{media_file.extension.lower()}" not in settings.RMT_MEDIAEXT:
|
media_exts = settings.RMT_MEDIAEXT + settings.RMT_SUBEXT + settings.RMT_AUDIOEXT
|
||||||
|
if f".{media_file.extension.lower()}" not in media_exts:
|
||||||
continue
|
continue
|
||||||
# 识别文件中的季集信息
|
# 识别文件中的季集信息
|
||||||
filemeta = MetaInfoPath(media_path)
|
filemeta = MetaInfoPath(media_path)
|
||||||
|
|||||||
+1
-1
@@ -80,7 +80,7 @@ class Monitor(ConfigReloadMixin, metaclass=SingletonClass):
|
|||||||
# 快照文件缓存
|
# 快照文件缓存
|
||||||
self._snapshot_cache = FileCache(base=settings.CACHE_PATH / "snapshots")
|
self._snapshot_cache = FileCache(base=settings.CACHE_PATH / "snapshots")
|
||||||
# 监控的文件扩展名
|
# 监控的文件扩展名
|
||||||
self.all_exts = settings.RMT_MEDIAEXT
|
self.all_exts = settings.RMT_MEDIAEXT + settings.RMT_SUBEXT + settings.RMT_AUDIOEXT
|
||||||
# 启动目录监控和文件整理
|
# 启动目录监控和文件整理
|
||||||
self.init()
|
self.init()
|
||||||
|
|
||||||
|
|||||||
@@ -65,7 +65,8 @@ class ScanFileAction(BaseAction):
|
|||||||
for file in files:
|
for file in files:
|
||||||
if global_vars.is_workflow_stopped(workflow_id):
|
if global_vars.is_workflow_stopped(workflow_id):
|
||||||
break
|
break
|
||||||
if not file.extension or f".{file.extension.lower()}" not in settings.RMT_MEDIAEXT:
|
media_exts = settings.RMT_MEDIAEXT + settings.RMT_SUBEXT + settings.RMT_AUDIOEXT
|
||||||
|
if not file.extension or f".{file.extension.lower()}" not in media_exts:
|
||||||
continue
|
continue
|
||||||
# 添加文件到队列,而不是目录
|
# 添加文件到队列,而不是目录
|
||||||
self._fileitems.append(file)
|
self._fileitems.append(file)
|
||||||
|
|||||||
Reference in New Issue
Block a user