Chaned the way the inner dbo session is accessed + added exec wrappers for queries

This commit is contained in:
emeric
2024-03-31 13:13:01 +02:00
parent 4ba8330194
commit 418286a1f2
19 changed files with 386 additions and 423 deletions
+3 -2
View File
@@ -24,6 +24,7 @@
#include "database/MediaLibrary.hpp"
#include "database/Session.hpp"
#include "core/String.hpp"
#include "Utils.hpp"
namespace lms::db
{
@@ -34,14 +35,14 @@ namespace lms::db
if (pointer settings{ get(session) })
return;
session.getDboSession().add(std::make_unique<ScanSettings>());
session.getDboSession()->add(std::make_unique<ScanSettings>());
}
ScanSettings::pointer ScanSettings::get(Session& session)
{
session.checkReadTransaction();
return session.getDboSession().find<ScanSettings>().resultValue();
return utils::execSingleResultQuery(session.getDboSession()->find<ScanSettings>());
}
std::vector<std::filesystem::path> ScanSettings::getAudioFileExtensions() const