Change series map value from a vector to an unordered set, remove series prefixing, ensure always defaulting to group disk name for sorting

This commit is contained in:
Crash Cringle
2025-03-03 23:25:32 -08:00
committed by teejusb
parent dd60d36093
commit 830bf1bb8d
4 changed files with 7 additions and 8 deletions
+1 -1
View File
@@ -77,7 +77,7 @@ Group::Group(const RString& sDir, const RString& sGroupDirName) {
ini.GetValue("Group", "SortTitle", sSortTitle);
Trim(sSortTitle);
if (sSortTitle.empty()) {
sSortTitle = sDisplayTitle;
sSortTitle = Basename(sGroupDirName);
}
ini.GetValue("Group", "TranslitTitle", sTranslitTitle);
+2 -2
View File
@@ -231,10 +231,10 @@ void MusicWheelItem::LoadFromWheelItemData( const WheelItemBaseData *pData, int
sTranslitName = SONGMAN->ShortenGroupName(pWID->m_pGroup->GetTranslitTitle());
}
else {
// This will eventually do something different when we eventually implement nested folders
// for now, use the same behavior.
sDisplayName = SONGMAN->ShortenGroupName(pWID->m_sText);
sTranslitName = SONGMAN->ShortenGroupName(pWID->m_pGroup->GetTranslitTitle());
// sDisplayName = SONGMAN->ShortenGroupName("[" + pWID->m_pGroup->GetSeries() +"] " + pWID->m_pGroup->GetDisplayTitle());
// sTranslitName = SONGMAN->ShortenGroupName("[" + pWID->m_pGroup->GetSeries() +"] " + pWID->m_pGroup->GetTranslitTitle());
}
}
if( GAMESTATE->sExpandedSectionName == pWID->m_sText )
+2 -3
View File
@@ -349,9 +349,8 @@ void SongManager::AddGroup( RString sDir, RString sGroupDirName, Group* group )
// Add the group to its series if the group has one and if the series exists
if( group->GetSeries() != "" )
{
std::vector<Group*>& series = m_mapSeriesToGroup[group->GetSeries()];
if( std::find(series.begin(), series.end(), group) == series.end() )
series.push_back(group);
std::unordered_set<Group*>& series = m_mapSeriesToGroup[group->GetSeries()];
series.insert(group);
}
//m_sSongGroupBackgroundPaths.push_back( sBackgroundPath );
}
+2 -2
View File
@@ -148,7 +148,7 @@ public:
std::map<RString, std::vector<Song*>> GetPreferredSortSongsMap() const { return m_mapPreferredSectionToSongs;};
RString SongToPreferredSortSectionName( const Song *pSong ) const;
std::map<RString, Group*> GetGroupGroupMap() const { return m_mapNameToGroup;};
std::map<RString, std::vector<Group*>> GetSeriesGroupMap() const { return m_mapSeriesToGroup;};
std::map<RString, std::unordered_set<Group*>> GetSeriesGroupMap() const { return m_mapSeriesToGroup;};
Group* GetGroupFromName( const RString &sGroupName ) const;
Group* GetGroup( const Song *pSong ) const;
std::vector<RString> GetPreferredSortSectionNames() const;
@@ -251,7 +251,7 @@ protected:
//vector<RString> m_sSongGroupBackgroundPaths; // each song group may have a background associated with it (very rarely)
std::map<RString, Group*> m_mapNameToGroup;
std::map<RString, std::vector<Group*>> m_mapSeriesToGroup;
std::map<RString, std::unordered_set<Group*>> m_mapSeriesToGroup;
struct Comp { bool operator()(const RString& s, const RString &t) const { return CompareRStringsAsc(s,t); } };
typedef std::vector<Song*> SongPointerVector;