Fix TrackMetadataQuery.

This commit is contained in:
casey langen 2020-10-03 22:17:00 -07:00
parent 5a08277603
commit 6cbe4ca758
2 changed files with 2 additions and 2 deletions

View File

@ -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<LibraryTrack>(-1LL, this->library);
TrackFromJson(input, parsedResult);
TrackFromJson(input["result"], parsedResult);
this->result = parsedResult;
this->SetStatus(IQuery::Finished);
}

View File

@ -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<long long>());
output->SetId(input["id"].get<int64_t>());
COPY_JSON_FIELD_TO_TRACK(input, output, constants::Track::EXTERNAL_ID)
COPY_JSON_FIELD_TO_TRACK(input, output, constants::Track::SOURCE_ID)