mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-01-29 00:33:01 +00:00
Game list: improve deduplication logic
This commit is contained in:
parent
439a78d12c
commit
13aa88c3c4
@ -423,8 +423,10 @@ void game_list_frame::Refresh(const bool fromDrive, const bool scrollAfter)
|
|||||||
path_list.back().resize(path_list.back().find_last_not_of('/') + 1);
|
path_list.back().resize(path_list.back().find_last_not_of('/') + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
// std::set is used to remove duplicates from the list
|
// Used to remove duplications from the list (serial -> set of cats)
|
||||||
for (const auto& dir : std::set<std::string>(std::make_move_iterator(path_list.begin()), std::make_move_iterator(path_list.end()))) { try
|
std::map<std::string, std::set<std::string>> serial_cat;
|
||||||
|
|
||||||
|
for (const auto& dir : path_list) { try
|
||||||
{
|
{
|
||||||
const std::string sfb = dir + "/PS3_DISC.SFB";
|
const std::string sfb = dir + "/PS3_DISC.SFB";
|
||||||
const std::string sfo = dir + (fs::is_file(sfb) ? "/PS3_GAME/PARAM.SFO" : "/PARAM.SFO");
|
const std::string sfo = dir + (fs::is_file(sfb) ? "/PS3_GAME/PARAM.SFO" : "/PARAM.SFO");
|
||||||
@ -448,6 +450,12 @@ void game_list_frame::Refresh(const bool fromDrive, const bool scrollAfter)
|
|||||||
game.resolution = psf::get_integer(psf, "RESOLUTION");
|
game.resolution = psf::get_integer(psf, "RESOLUTION");
|
||||||
game.sound_format = psf::get_integer(psf, "SOUND_FORMAT");
|
game.sound_format = psf::get_integer(psf, "SOUND_FORMAT");
|
||||||
|
|
||||||
|
// Detect duplication
|
||||||
|
if (!serial_cat[game.serial].emplace(game.category).second)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
bool bootable = false;
|
bool bootable = false;
|
||||||
auto cat = category::cat_boot.find(game.category);
|
auto cat = category::cat_boot.find(game.category);
|
||||||
if (cat != category::cat_boot.end())
|
if (cat != category::cat_boot.end())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user