Ensure the metadata proxy always references the local library.

This commit is contained in:
casey langen 2020-10-17 00:05:12 -07:00
parent 8200e7003e
commit 6f302cd374
2 changed files with 11 additions and 1 deletions

View File

@ -47,6 +47,7 @@
#include <musikcore/support/Preferences.h>
#include <musikcore/support/PreferenceKeys.h>
#include <musikcore/library/LocalMetadataProxy.h>
#include <musikcore/library/LibraryFactory.h>
#include <musikcore/runtime/Message.h>
#include <musikcore/support/Messages.h>
@ -367,9 +368,12 @@ namespace musik { namespace core { namespace plugin {
::messageQueue = messageQueue;
::defaultLibrary = library;
::playback = playback;
::metadataProxy = new LocalMetadataProxy(library);
::playbackPrefs = Preferences::ForComponent(prefs::components::Playback);
/* even if the local client is connected to a remote server, the metadata proxy
always uses the default local library. */
::metadataProxy = new LocalMetadataProxy(LibraryFactory::Instance().DefaultLocalLibrary());
PluginFactory::Instance().QueryFunction<SetMetadataProxy>(
"SetMetadataProxy",
[](musik::core::sdk::IPlugin* plugin, SetMetadataProxy func) {

View File

@ -607,6 +607,12 @@ int HttpServer::HandleAudioTrackRequest(
file = nullptr;
}
}
else {
status = MHD_HTTP_NOT_FOUND;
}
}
else {
status = MHD_HTTP_NOT_FOUND;
}
return status;