potential fix for windows

This commit is contained in:
bobokun 2022-05-20 17:19:41 -04:00
parent f0ce11572f
commit edbeec5e2a
No known key found for this signature in database
GPG key ID: 9665BA6CF5DC2671

View file

@ -766,6 +766,9 @@ class Qbt:
torrent_list = self.get_torrents({'sort': 'added_on'})
for torrent in alive_it(torrent_list):
for file in torrent.files:
fullpath = os.path.join(torrent.save_path, file.name)
# Replace fullpath with \\ if qbm is runnig in docker (linux) but qbt is on windows
fullpath = fullpath.replace(r'/', '\\') if ':\\' in fullpath else fullpath
torrent_files.append(os.path.join(torrent.save_path, file.name))
orphaned_files = set(root_files) - set(torrent_files)