Skip to content

Commit

Permalink
debug
Browse files Browse the repository at this point in the history
  • Loading branch information
FlafyDev committed May 30, 2024
1 parent afc6158 commit 538dc60
Showing 1 changed file with 17 additions and 15 deletions.
32 changes: 17 additions & 15 deletions src/managers/auto_nong_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,15 @@ void AutoNongManager::loadIndexes() {
if (isGzip) {
log::info("3");
jsonString = decompressGz(rVec);
log::info("4");
log::info("4 {}", jsonString);
} else {
log::info("5");
jsonString = std::string(rVec.begin(), rVec.end());
log::info("6");
}

matjson::Value jsonObj = matjson::parse(jsonString);
log::info("7");
log::info("7");

for (const auto &songData : jsonObj.as_array()) {
log::info("8-");
Expand All @@ -64,37 +64,39 @@ void AutoNongManager::loadIndexes() {
std::shared_ptr<ANSong> song;
log::info("12");
if (source == "youtube") {
log::info("13");
log::info("13");
std::string yt_id = songData["yt-id"].as_string();
log::info("14");
log::info("14");
song = std::make_shared<ANYTSong>(name, artist, index, yt_id);
log::info("15");
log::info("15");
} else if (source == "host") {
log::info("16");
log::info("16");
std::string url = songData["url"].as_string();
log::info("17");
log::info("17");
song = std::make_shared<ANHostSong>(name, artist, index, url);
log::info("18");
log::info("18");
} else {
log::info("19");
log::info("19");
log::warn("Unsupported source: {}", source);
log::info("20");
log::info("20");
continue;
}

log::info("21");
if (songData.contains("songs")) {
log::info("22");
log::info("22");
for (matjson::Value songID : songData["songs"].as_array()) {
log::info("23");
log::info("23");
m_songIDToNongs[songID.as_int()].push_back(song);
log::info("24");
log::info("24");
}
}
}
log::info("25");
Loader::get()->queueInMainThread(
[this, index]() { log::info("25.5"); log::info("Loaded index: {}", index); });
Loader::get()->queueInMainThread([this, index]() {
log::info("25.5");
log::info("Loaded index: {}", index);
});
log::info("26");
})
.send();
Expand Down

0 comments on commit 538dc60

Please sign in to comment.