Skip to content

Commit

Permalink
Extra fallback
Browse files Browse the repository at this point in the history
  • Loading branch information
Metalit committed Apr 28, 2024
1 parent dbac4ea commit f2ca36d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/PlaylistCore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,13 @@ namespace PlaylistCore {
levelIds.insert(itr->LevelID);
if(auto search = Utils::GetLevelByID(itr->LevelID))
foundSongs.emplace_back(search);
else if(itr->Hash) {
LOG_INFO("level id {} not found, attempting to use hash", itr->LevelID);
if(auto search = Utils::GetLevelByID(*itr->Hash))
foundSongs.emplace_back(search);
else
LOG_ERROR("level id {} not found", *itr->Hash);
}
else
LOG_ERROR("level id {} not found", itr->LevelID);
}
Expand Down Expand Up @@ -599,6 +606,8 @@ namespace PlaylistCore {
for(auto& song : playlist->playlistJSON.Songs) {
if(Utils::GetLevelByID(song.LevelID))
existingSongs.push_back(song);
else if(song.Hash && Utils::GetLevelByID(*song.Hash))
existingSongs.push_back(song);
else if(song.SongName.has_value())
LOG_INFO("Removing song {} from playlist {}", song.SongName.value(), playlist->name);
else
Expand Down

0 comments on commit f2ca36d

Please sign in to comment.