projectgoav / E.Deezer

Unoffical asynchronous Deezer .NET API
16 stars 11 forks source link

track RealeaseDate #89

Open ghost opened 4 years ago

ghost commented 4 years ago

Good morning, sir,

There is a problem when retrieving the date when using the GetTracks() function which retrieves the tracklist via a playlist.

returned value = 01/01/2001

The problem does not exist with the GetTrackById() function.

Provisional repair : Retrieve the track id via the playlist then go through a GetTrackById()

projectgoav commented 4 years ago

Is there a particular TrackID you are seeing this with or is it all tracks?

If you could let me know what version of E.Deezer you are using it would also be a big help.

ghost commented 4 years ago

No all tracks, I use last version

projectgoav commented 4 years ago

Unfortunately the Deezer API doesn't have the release date property in any of the returned JSON, either in Playlist/[ID] or Playlist/[ID]/tracks.

There's not really anything I can do here except for requesting Deezer change the API.

However, in the most recent changes in V5 (currently in alpha) the release date returns NULL in this case. It's a bit better than 01/01/2001 but still not ideal.

ghost commented 4 years ago

Hi,

Sorry for the late response... The problem is the same for the search function...

It would be possible to use the Search.Track function and then search the data of each track one by one with a GetTrackByID in this same function? Let's say that we add a true/false chosen by the user when calling the function to know if he wants only the basic data (not precise) or all the data with date etc...

For example: I have a result of 5 tracks found in my search. This one does not contain a valid date.

I chose to have a result with all the data so before returning the basic data it will replace the ITrackOld (without date) by a new ITrackNew with a call of the GetTrackByID() function.

I can't compile your project, I'm missing NET packages. Framework... but I have a 200 Kb/s connection when it works so I can't test it by myself....

I guess the track search is done in the SearchEndpoint.cs file and then calls the FindTracks() function. If in this function before returning the value we redo a search of each track but all the values will be ? Certainly a longer search but with the necessary data ^^^.

I don't know if you really understand what I'm trying to do, but I'll try on my own if I can compile...

Have a nice day!

projectgoav commented 4 years ago

I don't know if you really understand what I'm trying to do

As far as I understand, you are looking to get as much information as possible on tracks regardless how you obtain them (Album tracklist, playlist tracklist, artist top tracks, search results etc).

It would be possible to use the Search.Track function and then search the data of each track one by one with a GetTrackByID in this same function?

This is entirely possible as you should be able to loop through the tracks, grabbing their ID and using the GetById() function.

I'm a little hesitant to add this as an option to the library as I think this is something consumers will implement themsevles. A method on the ITrack interface to populate all the properties might be a suitable trade-off. I'll have a think about this.