diff --git a/src/core/library/query/TrackMetadataQuery.cpp b/src/core/library/query/TrackMetadataQuery.cpp index 7a902f4a6..c14e3ec13 100644 --- a/src/core/library/query/TrackMetadataQuery.cpp +++ b/src/core/library/query/TrackMetadataQuery.cpp @@ -177,7 +177,7 @@ void TrackMetadataQuery::DeserializeResult(const std::string& data) { this->SetStatus(IQuery::Failed); auto input = nlohmann::json::parse(data); auto parsedResult = std::make_shared(-1LL, this->library); - TrackFromJson(input, parsedResult); + TrackFromJson(input["result"], parsedResult); this->result = parsedResult; this->SetStatus(IQuery::Finished); } diff --git a/src/core/library/query/util/Serialization.cpp b/src/core/library/query/util/Serialization.cpp index dd3f2e1e8..cb4ae51d1 100644 --- a/src/core/library/query/util/Serialization.cpp +++ b/src/core/library/query/util/Serialization.cpp @@ -161,7 +161,7 @@ namespace musik { namespace core { namespace library { namespace query { track->SetValue(field, json.value(field, "").c_str()); void TrackFromJson(const nlohmann::json& input, musik::core::TrackPtr output, bool onlyIds) { - output->SetId(input["id"].get()); + output->SetId(input["id"].get()); COPY_JSON_FIELD_TO_TRACK(input, output, constants::Track::EXTERNAL_ID) COPY_JSON_FIELD_TO_TRACK(input, output, constants::Track::SOURCE_ID)