Correctly load seeds

This commit is contained in:
zhupengfei
2020-05-01 15:05:01 +08:00
parent f60fc572be
commit 2c4dd84d49
3 changed files with 8 additions and 8 deletions
+4
View File
@@ -48,6 +48,10 @@ bool SDMCImporter::Init() {
return false;
}
if (!config.seed_db_path.empty()) {
Seeds::Load(config.seed_db_path);
}
decryptor = std::make_unique<SDMCDecryptor>(config.sdmc_path);
FileUtil::SetUserPath(config.user_path);
+3 -7
View File
@@ -119,17 +119,13 @@ namespace Seeds {
static SeedDB g_seeddb;
static bool g_seeddb_loaded = false;
void Init(bool force) {
if (force || !g_seeddb_loaded) {
g_seeddb.Load(
fmt::format("{}/seeddb.bin", FileUtil::GetUserPath(FileUtil::UserPath::SysDataDir)));
}
g_seeddb_loaded = true;
void Load(const std::string& path) {
g_seeddb_loaded = g_seeddb.Load(path);
}
std::optional<Seed::Data> GetSeed(u64 title_id) {
if (!g_seeddb_loaded) {
Init();
Load(fmt::format("{}/seeddb.bin", FileUtil::GetUserPath(FileUtil::UserPath::SysDataDir)));
}
return g_seeddb.Get(title_id);
}
+1 -1
View File
@@ -53,7 +53,7 @@ private:
namespace Seeds {
void Init(bool force = false);
void Load(const std::string& path);
std::optional<Seed::Data> GetSeed(u64 title_id);
} // namespace Seeds