Subsonic API: better compability with clients
This commit is contained in:
@@ -27,8 +27,6 @@
|
||||
|
||||
#include "RequestContext.hpp"
|
||||
|
||||
#define API_VERSION_MAJOR 1
|
||||
|
||||
namespace API::Subsonic
|
||||
{
|
||||
|
||||
@@ -205,6 +203,9 @@ class Response
|
||||
void addArrayChild(const std::string& key, Node node);
|
||||
|
||||
private:
|
||||
|
||||
void setVersionAttribute(ProtocolVersion version);
|
||||
|
||||
friend class Response;
|
||||
using Value = std::variant<std::string, bool, long long>;
|
||||
std::map<std::string, Value> _attributes;
|
||||
@@ -213,8 +214,8 @@ class Response
|
||||
std::map<std::string, std::vector<Node>> _childrenArrays;
|
||||
};
|
||||
|
||||
static Response createOkResponse(const RequestContext& context);
|
||||
static Response createFailedResponse(std::string_view clientName, const Error& error);
|
||||
static Response createOkResponse(ProtocolVersion protocolVersion);
|
||||
static Response createFailedResponse(ProtocolVersion protocolVersion, const Error& error);
|
||||
|
||||
virtual ~Response() {}
|
||||
Response(const Response&) = delete;
|
||||
@@ -228,9 +229,7 @@ class Response
|
||||
|
||||
void write(std::ostream& os, ResponseFormat format);
|
||||
|
||||
static unsigned getAPIMinorVersion(std::string_view clientName);
|
||||
private:
|
||||
|
||||
void writeJSON(std::ostream& os);
|
||||
void writeXML(std::ostream& os);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user