Comments (7)
From what I can see the API methods are there, it's the endpoint that is not exposing the API for them. I believe it has been removed in #47 . Would love to know why it was removed since I cannot find a good alternative for getting that information anymore.
from e.deezer.
They should be there? Either that or I have implemented them locally and not pushed those changes...
from e.deezer.
I really can't find them. Can you please check, and if you have locally commit them?
Thanks
from e.deezer.
That must have been a mistake! I'll take a look at this asap.
from e.deezer.
I've had a look at the code and the PR you had linked.
TL;DR This is going to be quite hard. It might take me a few weeks to find some time and a solution to this (See below for a little more detail).
If you require an implementation right away and manage one, then please feel free tto submit a PR! :)
Deezer Developers Website
The developer website I used to use (https://developers.deezer.com) no longer lets me sign in. My account doesn't get past the login screen and trying to register does nothing for me.
I tried my old laptop I originally developed this code on but that browser is no longer signed in.
Deezer have recently undergone quite a serious re-brand. The developer website is using their old branding so I'm wondering if it has been left to rot... The offical developer twitter and dev link on their website still redirect here so there's nothing really to suggest this is the case.
If you can find active/working documentation then please let me know!
Responses
I found some saved postman queries so had a little play around getting single items from the API. I've found the reponses for single items can come in a number of different forms
By far the most common is structed like that below. This mirrors what 99% of the API is like and how E.Deezer expects things to be returned.
{
"data":
[
...
],
"error":
{
...
}
However, I've also found some items in the following formats:
{
...
}
{
"error":
{
...
}
}
{
...
"error_code": 800,
"error_message": "some deezer error message"
}
When I originally wrote this library I knew very little C# so the code isn't the most flexible or well structured. I've done my best to fix bits as I touch them but it's still not the best quality. I think fair bits could and should be re-written (but that's another task).
I did find a local dev branch where it appears I've hit a similiar pattern with some user methods I was implementing. Having not done much custom parsing in .NET I came up with the following code:
internal class PostResponseJsonConverter : JsonConverter
{ public override bool CanRead => true;
public override bool CanWrite => false;
public override bool CanConvert(Type objectType) => objectType == typeof(PostResponse);
public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
{
bool wasSuccess = false;
IResponseError error = null;
if (reader.TokenType == JsonToken.Boolean)
{
wasSuccess = (bool)reader.Value;
}
else
{
JObject value = JObject.Load(reader);
JObject errorJObject = value.Value<JObject>("error");
error = new ResponseError()
{
Code = errorJObject.Value<int>("code"),
Type = errorJObject.Value<string>("type"),
Message = errorJObject.Value<string>("message"),
};
}
return new PostResponse(wasSuccess, error);
}
public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
{
throw new NotImplementedException();
}
}
This would require a few modifications to support all types of items to parse. There would likely need to be some careful thinking in the already complex inheritance chain of API objects to make it generic enough for methods to throw correct exceptions or return the correct type of item but I think this could work.
Any thoughts?
from e.deezer.
I have implementation for get playlist, artist and track. Using everyday on my smarthouse deezer player and it's working great.
I will make pull request, so we can talk about it after.
from e.deezer.
Please see #68 for initial support of getting items by id.
I'd like to write some more tests for this and get some tests going against the live API before I merge the code in. It'll be a wee while before this is merged and available in Nuget.
If you have some time and wish to try it out then feel free to try the branch byId
. I'll also upload some binaries on the pull request for a simple drop-in replacement for testing. Please let me know if you find any bugs or issues and if possible the id of the item you were trying to fetch!
from e.deezer.
Related Issues (20)
- Query if Favourited
- The UserEndpoint doesn't work well. HOT 6
- Unfortunately, it still does not work for me. :-(
- Convert project to target .net standard HOT 5
- Stuck at getPlaylistById HOT 5
- Missing API errors / Exceptions mapped
- Radio -> `GetByGenre` invalid format HOT 1
- Negative GenreId can throw exception HOT 1
- Refactoring HOT 4
- Getting this error when im searching album name HOT 3
- Error when create new playlist HOT 2
- Comment listing without API key returns less data
- TimeAdd is processed wrong way HOT 4
- Release date return all time same value HOT 1
- track RealeaseDate HOT 5
- User/Playlists mixed response
- Getting the last track HOT 6
- DeezerSession does not have a "CreateNew()" method HOT 2
- playlist id longer than uint HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from e.deezer.