Skip to content

Commit

Permalink
Fix Osu files failing to set a combined filename properly for ssc saving
Browse files Browse the repository at this point in the history
should fix issues people have with using sync on them
basically without this change, sync changes didnt apply and if you tried to do it, it would produce an empty .ssc file in the install directory, completely useless
  • Loading branch information
poco0317 committed Sep 9, 2020
1 parent 50fde44 commit eb1585c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 4 additions & 0 deletions src/Etterna/Models/NoteLoaders/NotesLoaderOSU.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,10 @@ OsuLoader::LoadFromDir(const std::string& sPath_, Song& out)
out.AddSteps(chart);
}

// the metadata portion saves the filename/path wrong, this corrects it
if (!out.m_sSongFileName.empty())
out.m_sSongFileName = sPath_ + out.m_sSongFileName;

// out.Save(false);

return true;
Expand Down
7 changes: 5 additions & 2 deletions src/Etterna/Models/Songs/Song.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1136,6 +1136,7 @@ Song::Save()
GetDirListing(m_sSongDir + "*.ksf", arrayOldFileNames);
GetDirListing(m_sSongDir + "*.sm", arrayOldFileNames);
GetDirListing(m_sSongDir + "*.dwi", arrayOldFileNames);
GetDirListing(m_sSongDir + "*.osu", arrayOldFileNames);
for (auto& arrayOldFileName : arrayOldFileNames) {
const auto sOldPath = m_sSongDir + arrayOldFileName;
const auto sNewPath = sOldPath + ".old";
Expand Down Expand Up @@ -1182,8 +1183,10 @@ Song::GetStepsToSave(bool bSavingCache, const std::string& path)
vector<Steps*> vpStepsToSave;
for (auto& s : m_vpSteps) {

if (!bSavingCache)
s->SetFilename(path);
if (!bSavingCache) {
if (GetExtension(s->GetFilename()) != "osu")
s->SetFilename(path);
}
vpStepsToSave.push_back(s);
}
for (auto& s : m_UnknownStyleSteps) {
Expand Down

0 comments on commit eb1585c

Please sign in to comment.