mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-08-28 19:47:41 +08:00
feat:手动转移文件增加从历史记录获取相关信息
This commit is contained in:
@@ -63,6 +63,7 @@ def manual_transfer(fileitem: FileItem = None,
|
|||||||
episode_offset: int = 0,
|
episode_offset: int = 0,
|
||||||
min_filesize: int = 0,
|
min_filesize: int = 0,
|
||||||
scrape: bool = None,
|
scrape: bool = None,
|
||||||
|
from_history: bool = None,
|
||||||
db: Session = Depends(get_db),
|
db: Session = Depends(get_db),
|
||||||
_: schemas.TokenPayload = Depends(get_current_active_superuser)) -> Any:
|
_: schemas.TokenPayload = Depends(get_current_active_superuser)) -> Any:
|
||||||
"""
|
"""
|
||||||
@@ -82,6 +83,7 @@ def manual_transfer(fileitem: FileItem = None,
|
|||||||
:param episode_offset: 剧集识别偏移量
|
:param episode_offset: 剧集识别偏移量
|
||||||
:param min_filesize: 最小文件大小(MB)
|
:param min_filesize: 最小文件大小(MB)
|
||||||
:param scrape: 是否刮削元数据
|
:param scrape: 是否刮削元数据
|
||||||
|
:param from_history: 从历史记录中获取tmdbid、season、episode_detail等信息
|
||||||
:param db: 数据库
|
:param db: 数据库
|
||||||
:param _: Token校验
|
:param _: Token校验
|
||||||
"""
|
"""
|
||||||
@@ -106,6 +108,15 @@ def manual_transfer(fileitem: FileItem = None,
|
|||||||
# 删除旧的已整理文件
|
# 删除旧的已整理文件
|
||||||
dest_fileitem = FileItem(**json.loads(history.dest_fileitem))
|
dest_fileitem = FileItem(**json.loads(history.dest_fileitem))
|
||||||
transfer.delete_files(dest_fileitem)
|
transfer.delete_files(dest_fileitem)
|
||||||
|
|
||||||
|
# 从历史数据获取信息
|
||||||
|
if from_history:
|
||||||
|
type_name = history.type if history.type else type_name
|
||||||
|
tmdbid = int(history.tmdbid) if history.tmdbid else tmdbid
|
||||||
|
doubanid = str(history.doubanid) if history.doubanid else doubanid
|
||||||
|
season = int(str(history.seasons).replace("S", "")) if history.seasons else season
|
||||||
|
episode_detail = str(history.episodes) if history.episodes else episode_detail
|
||||||
|
|
||||||
elif fileitem:
|
elif fileitem:
|
||||||
src_fileitem = fileitem
|
src_fileitem = fileitem
|
||||||
else:
|
else:
|
||||||
|
|||||||
Reference in New Issue
Block a user