-
Notifications
You must be signed in to change notification settings - Fork 89
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
Search API provides full Album info but only SimpleAlbum is returned #15
Comments
Hmm, in the docs they still state they return a simplified version of the album object. |
Yes, good call. I'm not entirely sure how to differentiate the two but strangely |
I've added a switch for when |
I think we need to have that check here, in order to populate the correct album object for track searches: https://github.com/rinukkusu/spotify-dart/blob/master/lib/src/models/_models.g.dart#L272 Also I think it should be https://github.com/rinukkusu/spotify-dart/blob/master/lib/src/models/_models.g.dart#L282 Thanks again for your help! |
Uh yeah - |
I've published version |
Awesome, thank you! The only issue I'm seeing now is that in the search track deserialization, SimpleAlbum is always returned (https://github.com/rinukkusu/spotify-dart/blob/master/lib/src/models/_models.g.dart#L272). I now realize that file wasn't coded by hand so I'm wondering how that case can be best handled. Would it be possible/reasonable to do some Track post-processing in search.dart where you had added the album search switch and replace the SimpleAlbum with the full version if appropriate? I know that doesn't sound ideal either... |
Ah, I see - well to be fair we are spending most of the time waiting on the spotify api anyway. I don't think it would hurt to add it there as well. |
@zacwolfe I've moved the check to the |
Great solution, I'll be testing it shortly! |
looking good, thanks again |
Okay, perfect! 😄 |
I don't know if the search api has changed recently or if this is true for only some queries but I'm seeing full album info being returned from track searches. The library should detect which type is returned and return the appropriate model rather than assuming AlbumSimple.
https://api.spotify.com/v1/search?q=track:sunny+artist:pat+martino&type=track
returns (summarized):The text was updated successfully, but these errors were encountered: