mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-09-06 16:07:01 +08:00
Fix AttributeError when mediainfo.type is None
Co-authored-by: jxxghp <51039935+jxxghp@users.noreply.github.com>
This commit is contained in:
co-authored by
jxxghp
parent
79710310ce
commit
f3b910d55a
@@ -464,7 +464,7 @@ class FileManagerModule(_ModuleBase):
|
|||||||
else:
|
else:
|
||||||
# 未找到有效的媒体库目录
|
# 未找到有效的媒体库目录
|
||||||
logger.error(
|
logger.error(
|
||||||
f"{mediainfo.type.value} {mediainfo.title_year} 未找到有效的媒体库目录,无法整理文件,源路径:{fileitem.path}")
|
f"{mediainfo.type.value if mediainfo.type else '未知类型'} {mediainfo.title_year} 未找到有效的媒体库目录,无法整理文件,源路径:{fileitem.path}")
|
||||||
return TransferInfo(success=False,
|
return TransferInfo(success=False,
|
||||||
fileitem=fileitem,
|
fileitem=fileitem,
|
||||||
message="未找到有效的媒体库目录")
|
message="未找到有效的媒体库目录")
|
||||||
|
|||||||
@@ -708,7 +708,7 @@ class TransHandler:
|
|||||||
"""
|
"""
|
||||||
获取目标路径
|
获取目标路径
|
||||||
"""
|
"""
|
||||||
if need_type_folder:
|
if need_type_folder and mediainfo.type:
|
||||||
target_path = target_path / mediainfo.type.value
|
target_path = target_path / mediainfo.type.value
|
||||||
if need_category_folder and mediainfo.category:
|
if need_category_folder and mediainfo.category:
|
||||||
target_path = target_path / mediainfo.category
|
target_path = target_path / mediainfo.category
|
||||||
@@ -728,7 +728,7 @@ class TransHandler:
|
|||||||
need_type_folder = target_dir.library_type_folder
|
need_type_folder = target_dir.library_type_folder
|
||||||
if need_category_folder is None:
|
if need_category_folder is None:
|
||||||
need_category_folder = target_dir.library_category_folder
|
need_category_folder = target_dir.library_category_folder
|
||||||
if not target_dir.media_type and need_type_folder:
|
if not target_dir.media_type and need_type_folder and mediainfo.type:
|
||||||
# 一级自动分类
|
# 一级自动分类
|
||||||
library_dir = Path(target_dir.library_path) / mediainfo.type.value
|
library_dir = Path(target_dir.library_path) / mediainfo.type.value
|
||||||
elif target_dir.media_type and need_type_folder:
|
elif target_dir.media_type and need_type_folder:
|
||||||
|
|||||||
Reference in New Issue
Block a user