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

tagging: fix handling trackers without all fields #97

Merged
merged 1 commit into from
Jan 5, 2025

Conversation

Zariel
Copy link
Contributor

@Zariel Zariel commented Jan 5, 2025

Fix the test for required_seed_days and required_seed_ratio to check if the key is in object otherwise it just throws a KeyError when accessing.

This fixes this error when not specifying either key in the tracker config.

03:00:05 PM ERROR: Error executing command: tagging
Traceback (most recent call last):
  File "/app/qbtools.py", line 135, in main
    mod.__init__(app, logger)
    ~~~~~~~~~~~~^^^^^^^^^^^^^
  File "/app/commands/tagging.py", line 113, in __init__
    tracker["required_seed_ratio"]
    ~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^
KeyError: 'required_seed_ratio'

Fix the test for required_seed_days and required_seed_ratio
to check if the key is in object otherwise it just throws
a KeyError when accessing.
@Zariel Zariel requested review from buroa and onedr0p as code owners January 5, 2025 15:16
@buroa buroa merged commit e10be02 into buroa:master Jan 5, 2025
1 check passed
@Zariel Zariel deleted the tagging/fix-key-error branch January 5, 2025 15:23
@buroa
Copy link
Owner

buroa commented Jan 5, 2025

Thanks @Zariel!

@qlonik
Copy link
Contributor

qlonik commented Jan 12, 2025

Hey, sorry, but I think this is a breaking change.

Previously setting seed days or ratio to 0 value would mean it would never expire (because in the check tracker["required_seed_ratio"] the value 0 is falsy). Now the value of 0 will mean the torrents can expire a second after they are added.

@buroa
Copy link
Owner

buroa commented Jan 12, 2025

@qlonik I saw this immediately after merging and have fixed it: 644cd18

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

Successfully merging this pull request may close these issues.

3 participants