Refactor carrier selection logic in __main__.py

This commit refactors the carrier selection logic in the `main` function in `__main__.py`. The code now uses the variable name `provider` instead of `api` for clarity. Additionally, the logic for filtering providers is updated to correctly check for other providers with a higher priority for a given carrier.
This commit is contained in:
Kumi 2023-09-12 07:48:33 +02:00
parent 4cddd70254
commit dafce82106
Signed by: kumi
GPG key ID: ECBCC9082395383F

View file

@ -111,12 +111,12 @@ def main():
carriers = set(
[
(api[0], (api[3] if len(api) > 3 else None))
(provider[0], (provider[3] if len(provider) > 3 else None))
for provider in tracker.providers
if not any(
[
others[1] > provider[1]
for others in filter(lambda x: x[0] == api[0], tracker.providers)
for others in filter(lambda x: x[0] == provider[0], tracker.providers)
]
)
]