Skip to content

Commit

Permalink
Revert "Update clients.py"
Browse files Browse the repository at this point in the history
This reverts commit 83d4799.
  • Loading branch information
Audionut committed Jun 20, 2024
1 parent 9f53d4b commit 3795c74
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/clients.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,18 @@ async def qbittorrent(self, path, torrent, local_path, remote_path, client, is_d

content_layout = client.get('content_layout', 'Original')

qbt_client.torrents_add(torrent_files=torrent.dump(), save_path=path, use_auto_torrent_management=auto_management, is_skip_checking=True, is_paused=False, content_layout=content_layout, category=qbt_category, tags=client.get('qbit_tag'))
qbt_client.torrents_add(torrent_files=torrent.dump(), save_path=path, use_auto_torrent_management=auto_management, is_skip_checking=True, content_layout=content_layout, category=qbt_category)
# Wait for up to 30 seconds for qbit to actually return the download
# there's an async race conditiion within qbt that it will return ok before the torrent is actually added
for _ in range(0, 30):
if len(qbt_client.torrents_info(torrent_hashes=torrent.infohash)) > 0:
break
await asyncio.sleep(1)
qbt_client.torrents_resume(torrent.infohash)
if client.get('qbit_tag', None) != None:
qbt_client.torrents_add_tags(tags=client.get('qbit_tag'), torrent_hashes=torrent.infohash)
if meta.get('qbit_tag') != None:
qbt_client.torrents_add_tags(tags=meta.get('qbit_tag'), torrent_hashes=torrent.infohash)
console.print(f"Added to: {path}")


Expand Down Expand Up @@ -400,4 +411,4 @@ async def remote_path_map(self, meta):
if local_path.endswith(os.sep):
remote_path = remote_path + os.sep

return local_path, remote_path
return local_path, remote_path

1 comment on commit 3795c74

@Audionut
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I finally investigated an issue with torrents failing to be successfully injected. Tracked it down to this commit, which also broke console feedback on warn/error with qbit.

Please sign in to comment.