API Subsonic: first working version, still WIP (missing commands, no authentication)

This commit is contained in:
emeric
2019-04-01 13:57:14 +02:00
parent be6ca7cc1b
commit ab2ed24f75
22 changed files with 1245 additions and 34 deletions
+10 -1
View File
@@ -23,6 +23,7 @@
#include <Wt/WServer.h>
#include <Wt/WApplication.h>
#include "api/subsonic/SubsonicResource.hpp"
#include "av/AvInfo.hpp"
#include "av/AvTranscoder.hpp"
#include "cover/CoverArtGrabber.hpp"
@@ -132,9 +133,17 @@ int main(int argc, char* argv[])
getServices().mediaScanner->setAddon(similarityFeaturesScannerAddon);
getServices().coverArtGrabber = std::make_unique<CoverArt::Grabber>();
getServices().coverArtGrabber->setDefaultCover(server.appRoot() + "/images/unknown-cover.jpg");
getServices().similaritySearcher = std::make_unique<Similarity::Searcher>(similarityFeaturesScannerAddon);
// bind entry point
API::Subsonic::SubsonicResource subsonicResource {*connectionPool};
// bind API resources
for (const std::string& path : API::Subsonic::SubsonicResource::getPaths())
server.addResource(&subsonicResource, path);
// bind UI entry point
server.addEntryPoint(Wt::EntryPointType::Application,
std::bind(UserInterface::LmsApplication::create,
std::placeholders::_1, std::ref(*connectionPool), std::ref(appGroups)));