projectgoav / E.Deezer

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

The UserEndpoint doesn't work well. #58

Closed tolbxela closed 5 years ago

tolbxela commented 5 years ago
Deezer deezer = DeezerSession.CreateNew();
if (!deezer.IsAuthenticated) {
      await deezer.Login(access_token);
}
IUser user = deezer.Browse.CurrentUser.User;

The user object is empty. The iClient Object is null.

IEnumerable tracks = await user.First().GetFavouriteTracks(); gets an exception:

NullReferenceException: Object reference not set to an instance of an object.
E.Deezer.Api.User.Get<TSource, TDest>(string aMethod, DeezerPermissions aPermisisons, uint aStart, uint aCount) in User.cs
+
            if (!Client.IsAuthenticated)
projectgoav commented 5 years ago

Thanks for reporting this. I'lI have a look into it asap!

projectgoav commented 5 years ago

Hi there,

Dug into it a little and found that if the call to Login(access_token) was to fail this wasn't being correctly picked up and resulted in the null-ref you saw. Also noticed another bug on the happy path in that area.

Both have been fixed in a new version (v3.1.1) which should be available on Nuget soon.

I'm going to close this issue off, but if you find that this hasn't fixed your issue or come across any more feel free to reopen this or open a new one :)

tolbxela commented 5 years ago

Thanks man! Good work! 👍

tolbxela commented 5 years ago

Unfortunately, it still does not work for me. :-( The login throws OAuthException You don't not have permission to access this information on Deezer. Deezer responded with result 200 - OAuthException' You didn't pass the params by the login. Look at the line 220 https://github.com/projectgoav/E.Deezer/blob/92ff47f9314bbc822601accfb9178bb7961d4cbe/E.Deezer/DeezerClient.cs#L220 The params aren't used! I have solved it in my fork here 9c33eb9ed440a353808d04f5de458bb73fb428fa

tolbxela commented 5 years ago

I'm going to close this issue off, but if you find that this hasn't fixed your issue or come across any more feel free to reopen this or open a new one :)

From: https://stackoverflow.com/questions/21333654/how-to-re-open-an-issue-in-github#21333938

projectgoav commented 5 years ago

Oops! I maybe removed that by accident when working in this area....

I'll give your PR a review and hopefully get it merged soon to fix this.