mirror of
https://github.com/Dark98/threeSD.git
synced 2026-07-06 08:39:06 +00:00
Correctly load seeds
This commit is contained in:
@@ -48,6 +48,10 @@ bool SDMCImporter::Init() {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!config.seed_db_path.empty()) {
|
||||||
|
Seeds::Load(config.seed_db_path);
|
||||||
|
}
|
||||||
|
|
||||||
decryptor = std::make_unique<SDMCDecryptor>(config.sdmc_path);
|
decryptor = std::make_unique<SDMCDecryptor>(config.sdmc_path);
|
||||||
|
|
||||||
FileUtil::SetUserPath(config.user_path);
|
FileUtil::SetUserPath(config.user_path);
|
||||||
|
|||||||
@@ -119,17 +119,13 @@ namespace Seeds {
|
|||||||
static SeedDB g_seeddb;
|
static SeedDB g_seeddb;
|
||||||
static bool g_seeddb_loaded = false;
|
static bool g_seeddb_loaded = false;
|
||||||
|
|
||||||
void Init(bool force) {
|
void Load(const std::string& path) {
|
||||||
if (force || !g_seeddb_loaded) {
|
g_seeddb_loaded = g_seeddb.Load(path);
|
||||||
g_seeddb.Load(
|
|
||||||
fmt::format("{}/seeddb.bin", FileUtil::GetUserPath(FileUtil::UserPath::SysDataDir)));
|
|
||||||
}
|
|
||||||
g_seeddb_loaded = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
std::optional<Seed::Data> GetSeed(u64 title_id) {
|
std::optional<Seed::Data> GetSeed(u64 title_id) {
|
||||||
if (!g_seeddb_loaded) {
|
if (!g_seeddb_loaded) {
|
||||||
Init();
|
Load(fmt::format("{}/seeddb.bin", FileUtil::GetUserPath(FileUtil::UserPath::SysDataDir)));
|
||||||
}
|
}
|
||||||
return g_seeddb.Get(title_id);
|
return g_seeddb.Get(title_id);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ private:
|
|||||||
|
|
||||||
namespace Seeds {
|
namespace Seeds {
|
||||||
|
|
||||||
void Init(bool force = false);
|
void Load(const std::string& path);
|
||||||
std::optional<Seed::Data> GetSeed(u64 title_id);
|
std::optional<Seed::Data> GetSeed(u64 title_id);
|
||||||
|
|
||||||
} // namespace Seeds
|
} // namespace Seeds
|
||||||
|
|||||||
Reference in New Issue
Block a user