Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: Why are not torrents added directly with the Tag? #314

Open
AN1MATEK opened this issue Feb 12, 2024 · 1 comment
Open

Question: Why are not torrents added directly with the Tag? #314

AN1MATEK opened this issue Feb 12, 2024 · 1 comment

Comments

@AN1MATEK
Copy link

Checking out the code, I can see that the tag is added after adding the torrent:

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}")

Why just don't add the tag in the torrents_add call as the API specifies it? From their docs:

torrents_add(urls=None, torrent_files=None, save_path=None, cookie=None, category=None, is_skip_checking=None, is_paused=None, is_root_folder=None, rename=None, upload_limit=None, download_limit=None, use_auto_torrent_management=None, is_sequential_download=None, is_first_last_piece_priority=None, tags=None, content_layout=None, ratio_limit=None, seeding_time_limit=None, download_path=None, use_download_path=None, stop_condition=None, **kwargs) → [str](https://docs.python.org/3/library/stdtypes.html#str)

I know it is not that important. I just would like to have to scripting when adding a torrent with a particular Tag. I checked the code and I wondered why? Is there a reason or should I just do a PR?

@AN1MATEK
Copy link
Author

Nobody? This hinders automation :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant