From dafce821064ea19a2906138846feb3b2c454e301 Mon Sep 17 00:00:00 2001 From: Kumi Date: Tue, 12 Sep 2023 07:48:33 +0200 Subject: [PATCH] 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. --- src/trackbert/__main__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/trackbert/__main__.py b/src/trackbert/__main__.py index 7037063..2278302 100644 --- a/src/trackbert/__main__.py +++ b/src/trackbert/__main__.py @@ -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) ] ) ]