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:
+1
-1
@@ -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);
|
||||
|
||||
@@ -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
@@ -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
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user