mirror of
https://github.com/Dark98/threeSD.git
synced 2026-07-03 00:38:58 +00:00
Correctly load seeds
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user