Allow to use an empty lms.conf file, default values are now all hardcoded, fixes #584

This commit is contained in:
emeric
2025-01-05 16:12:25 +01:00
parent a6ab9c5ff4
commit 3740c6f899
9 changed files with 42 additions and 40 deletions
@@ -32,7 +32,7 @@ namespace lms::recommendation
{
std::filesystem::path getCacheDirectory()
{
return core::Service<core::IConfig>::get()->getPath("working-dir") / "cache" / "features";
return core::Service<core::IConfig>::get()->getPath("working-dir", "/var/lms") / "cache" / "features";
}
std::filesystem::path getCacheNetworkFilePath()
@@ -230,7 +230,7 @@ namespace lms::recommendation
void FeaturesEngineCache::write() const
{
std::filesystem::create_directories(core::Service<core::IConfig>::get()->getPath("working-dir") / "cache" / "features");
std::filesystem::create_directories(core::Service<core::IConfig>::get()->getPath("working-dir", "/var/lms") / "cache" / "features");
if (!networkToCacheFile(_network, getCacheNetworkFilePath())
|| !objectPositionToCacheFile(_trackPositions, getCacheTrackPositionsFilePath()))