fix: key users by account_id and tolerate candidate count variance
This commit is contained in:
parent
1a0712144e
commit
ce652d3114
3 changed files with 23 additions and 4 deletions
|
|
@ -72,7 +72,7 @@ def parse_saved_track_page(payload: object) -> list[Track]:
|
|||
def parse_current_user(payload: object) -> CurrentUser:
|
||||
"""Map a Spotify current-user response into stable identity fields."""
|
||||
root = _as_mapping(payload)
|
||||
account_id = _required_string(root, "id") or _required_string(root, "account_id")
|
||||
account_id = _required_string(root, "account_id") or _required_string(root, "id")
|
||||
display_name = _required_string(root, "display_name")
|
||||
if account_id is None or display_name is None:
|
||||
raise ValueError("Spotify returned an invalid current-user response")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue