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

Can't Pull Playlist Data #6

Open
ijabit opened this issue Oct 12, 2018 · 5 comments
Open

Can't Pull Playlist Data #6

ijabit opened this issue Oct 12, 2018 · 5 comments

Comments

@ijabit
Copy link

ijabit commented Oct 12, 2018

Great library!

When I call the method GetCatalogPlaylist it generates a response from the following URL:
https://api.music.apple.com/v1/catalog/us/playlists/pl.1c35ac10cfe848aaa19f68ebe62ea46e

The JSON serializer can't deserialize the result and throws the following exception:
"Could not create an instance of type AppleMusicAPI.NET.Models.Core.ResourceRoot. Type is an interface or abstract class and cannot be instantiated. Path 'data[0].relationships.tracks.data[0].id', line 1, position 1417."

I noticed that the properties on the relationship track object have a Meta property but no Attributes property to represent the attributes in the JSON data returned. Maybe that's part of the problem? I don't really know how to troubleshoot this issue.

Can you point me in the right direction at least?

@ijabit
Copy link
Author

ijabit commented Oct 15, 2018

Okay I did some digging and found a workaround:
https://github.com/MattPress/AppleMusicAPI.NET/blob/master/src/AppleMusicAPI.NET.Models/Relationships/TrackRelationship.cs

The Relationship class it is inheriting from doesn't have the Playlist generic type parameter. When I make that class inherit from Relationship<Playlist> it works! But I don't know if the intent was to have this class used from multiple relationships other than Playlist so I'll leave it up to the author to decide what to do about this.

@MattPress
Copy link
Owner

Hi, @ijabit apologies for the very late response, not ideal but been really busy!

This issue has been addressed but needs to be released. There are a few issues with the json serialising which need ironed out. So far the releases have essentially been pre-release but my eagerness to get everything up and running has resulted in incredibly poor quality management. I hope to have these additional issues fixed and proper tests in place to ensure everything is working as it should prior to the next release.

If you notice any other issues please let me know regardless of if you are using the nuget package or not, really appreciate the input.

Thanks,
Matt

@ijabit
Copy link
Author

ijabit commented Nov 5, 2018

Thanks for the response. I have a fork of the code anyways with the workaround I mentioned above in place. I also added the ability to initialize DI with a pre-generated key, instead of requiring the certificate and generating it on the fly. I think it's a nice enhancement if you're interested.

@MattPress
Copy link
Owner

Sure, just open a PR!

@MattPress
Copy link
Owner

Issue mentioned fixed in ongoing PR #7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants