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
Error on retrieving playback when a local file is playing #200
Comments
Thank you for the report! Since it's a local track, it might be better off with similar "empty" artists as other members already are. Not sure yet. I'll take a look tomorrow and get back to you! |
Manually requesting the playback returned the following result for a local file: {
"timestamp" : 1596383702885,
"context" : null,
"progress_ms" : 2270,
"item" : {
"album" : {
"album_type" : null,
"artists" : [ ],
"available_markets" : [ ],
"external_urls" : { },
"href" : null,
"id" : null,
"images" : [ ],
"name" : "Manic (Deluxe)",
"release_date" : null,
"release_date_precision" : null,
"type" : "album",
"uri" : null
},
"artists" : [ {
"external_urls" : { },
"href" : null,
"id" : null,
"name" : "Halsey",
"type" : "artist",
"uri" : null
} ],
"available_markets" : [ ],
"disc_number" : 0,
"duration_ms" : 174000,
"explicit" : false,
"external_ids" : { },
"external_urls" : { },
"href" : null,
"id" : null,
"is_local" : true,
"name" : "929",
"popularity" : 0,
"preview_url" : null,
"track_number" : 0,
"type" : "track",
"uri" : "spotify:local:Halsey:Manic+%28Deluxe%29:929:174"
},
"currently_playing_type" : "track",
"actions" : {
"disallows" : {
"pausing" : true,
"skipping_prev" : true
}
},
"is_playing" : false
} Although many of the files are empty and have no data, that's not the case for all of them. For example |
Thanks a lot! This info helps a ton already 😄 |
Okay, so most likely we'll need to introduce similar "local" versions of objects to playback endpoints as we have for playlist items already. I managed to parse the response using the same |
Our test coverage will take a hit, as we have no way of testing this automatically by starting playback of a local track. But I'm A-OK with that. Also turns out that the local objects are already quite strict meaning they don't allow any missing attributes. So we're good to go. |
@allerter This fix is now released with the new version! |
Issue
If I try to get the user's playback using
playback()
orplayback_currently_playing()
, and the useris playing a local file at that moment, I get the following error:TypeError: __init__() missing 1 required positional argument: 'total_tracks'
Expected behavior
If the user is playing a local file, the fetched result should contain the track's name and artist, but the album should be empty.
Steps to reproduce
The text was updated successfully, but these errors were encountered: