DylanCa / apple-music

A Rust Library to control local Apple Music player
MIT License
5 stars 4 forks source link

get_current_track() returns DeserializationError #10

Closed doEggi closed 15 hours ago

doEggi commented 4 months ago

While trying to parse the current running track with the function AppleMusic::get_current_track(), it always returns a "Deserialization failed". As I don't really know how the crate works I tried to hunt down the error a bit. While parsing some JSON data with the serve_json crate the error occurs.

script_controller.rs: line 48

This also appears when trying to call AppleMusic::get_application_data().

DylanCa commented 3 months ago

I'll take a look at that! By any chance, can you provide me with the track you're having the issue with ? To make sure I'm working with the same context as you.

doEggi commented 3 months ago

I was working with the most recent stable version of rustc / cargo and it happened with every track. I'll take a further look as soon as I got some time to provide more detailed information.

doEggi commented 3 months ago

I did some trial and error. It seems, that the deserialization of the ApplicationData and Track data structure fails. My guess is that the json data returned by the js script does not match the data structures of the library. Perhaps something changed in a recent version of the API / AppleMusic itself?

Edit: Sorry for all the recent edits, I hope I got it figured out now.