MCPcopy Create free account
hub / github.com/PCSX2/pcsx2 / RescanPath

Method RescanPath

pcsx2/GameList.cpp:928–954  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

926}
927
928bool GameList::RescanPath(const std::string& path)
929{
930 FILESYSTEM_STAT_DATA sd;
931 if (!FileSystem::StatFile(path.c_str(), &sd))
932 return false;
933
934 std::unique_lock lock(s_mutex);
935
936 const PlayedTimeMap played_time(LoadPlayedTimeMap(GetPlayedTimeFile()));
937 INISettingsInterface custom_attributes_ini(GetCustomPropertiesFile());
938 custom_attributes_ini.Load();
939
940 {
941 // cancel if excluded
942 const std::vector<std::string> excluded_paths(Host::GetBaseStringListSetting("GameList", "ExcludedPaths"));
943 if (IsPathExcluded(excluded_paths, path))
944 return false;
945 }
946
947 // re-scan!
948 if (!ScanFile(path, sd.ModificationTime, lock, played_time, custom_attributes_ini))
949 return true;
950
951 // update cache.. this is far from ideal, but since everything's variable length, all we can do.
952 RewriteCacheFile();
953 return true;
954}
955
956bool GameList::GetSerialAndCRCForFilename(const char* filename, std::string* serial, u32* crc)
957{

Callers

nothing calls this directly

Calls 3

IsPathExcludedFunction · 0.85
c_strMethod · 0.45
LoadMethod · 0.45

Tested by

no test coverage detected