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

Change log line for filtering accounts #1382

Merged
merged 2 commits into from
Sep 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion mapadroid/account_handler/AccountHandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,13 @@ async def get_account(self, device_id: int, purpose: AccountPurpose,
# TODO: Filter only unassigned or assigned to same device first
logins: Dict[int, SettingsPogoauth] = await SettingsPogoauthHelper.get_avail_accounts(
session, self._db_wrapper.get_instance_id(), auth_type=None, device_id=device_id)
logger.info("Got {} before filtering for burnt or not fitting the usage.", len(logins))
# Filter all burnt and all which do not match the purpose. E.g., if the purpose is mon scanning.
logins_filtered: List[SettingsPogoauth] = [auth_entry for auth_id, auth_entry in logins.items()
if not self._is_burnt(auth_entry)
and self._is_usable_for_purpose(auth_entry,
purpose, location_to_scan)]
logins_filtered.sort(key=lambda x: DatetimeWrapper.fromtimestamp(0) if x.last_burn is None else x.last_burn)
logger.info("Got {} before filtering and {} after (burnt, wrong level)", len(logins), len(logins_filtered))
login_to_use: Optional[SettingsPogoauth] = None
if not logins_filtered:
logger.warning("No auth found for {}", device_id)
Expand Down
Loading