mirror of
https://github.com/StuffAnThings/qbit_manage.git
synced 2024-09-20 15:26:02 +08:00
Apply suggestions from code review (again)
Co-authored-by: bobokun <12660469+bobokun@users.noreply.github.com>
This commit is contained in:
parent
3f99488cd1
commit
ce044c9eab
|
@ -69,11 +69,6 @@ class RemoveOrphaned:
|
|||
if fullpath not in torrent_files
|
||||
]
|
||||
)
|
||||
for file in torrent.files:
|
||||
fullpath = os.path.join(torrent.save_path, file.name)
|
||||
# Replace fullpath with \\ if qbm is running in docker (linux) but qbt is on windows
|
||||
fullpath = fullpath.replace(r"/", "\\") if ":\\" in fullpath else fullpath
|
||||
torrent_files.append(fullpath)
|
||||
|
||||
orphaned_files = set(root_files) - set(torrent_files)
|
||||
|
||||
|
@ -140,3 +135,4 @@ def move_orphan(file):
|
|||
dest = os.path.join(_config.orphaned_dir, file.replace(_config.root_dir, ""))
|
||||
util.move_files(src, dest, True)
|
||||
return os.path.dirname(file).replace(_config.root_dir, _config.remote_dir) # Another candidate for micro optimizing
|
||||
|
||||
|
|
Loading…
Reference in a new issue