diff --git a/app/api/endpoints/transfer.py b/app/api/endpoints/transfer.py index 64bd05ef..b791af15 100644 --- a/app/api/endpoints/transfer.py +++ b/app/api/endpoints/transfer.py @@ -70,10 +70,6 @@ def manual_transfer(path: str = None, if history.dest and str(history.dest) != "None": # 删除旧的已整理文件 transfer.delete_files(Path(history.dest)) - if not target: - target = transfer.get_root_path(path=history.dest, - type_name=history.type, - category=history.category) elif path: in_path = Path(path) else: diff --git a/app/chain/transfer.py b/app/chain/transfer.py index b50351dc..e20459b3 100644 --- a/app/chain/transfer.py +++ b/app/chain/transfer.py @@ -490,24 +490,6 @@ class TransferChain(ChainBase): text=errmsg, userid=userid)) return - @staticmethod - def get_root_path(path: str, type_name: str, category: str) -> Optional[Path]: - """ - 计算媒体库目录的根路径 - """ - if not path or path == "None": - return None - index = -2 - if type_name != '电影': - index = -3 - if category: - index -= 1 - if '/' in path: - retpath = '/'.join(path.split('/')[:index]) - else: - retpath = '\\'.join(path.split('\\')[:index]) - return Path(retpath) - def re_transfer(self, logid: int, mtype: MediaType = None, mediaid: str = None) -> Tuple[bool, str]: """ @@ -525,7 +507,6 @@ class TransferChain(ChainBase): src_path = Path(history.src) if not src_path.exists(): return False, f"源目录不存在:{src_path}" - dest_path = self.get_root_path(path=history.dest, type_name=history.type, category=history.category) # 查询媒体信息 if mtype and mediaid: mediainfo = self.recognize_media(mtype=mtype, tmdbid=int(mediaid) if str(mediaid).isdigit() else None, @@ -548,7 +529,6 @@ class TransferChain(ChainBase): state, errmsg = self.do_transfer(path=src_path, mediainfo=mediainfo, download_hash=history.download_hash, - target=dest_path, force=True) if not state: return False, errmsg