Fixed bad name truncations, fixes #861

This commit is contained in:
emeric
2026-07-12 12:09:12 +02:00
parent 8daa4a2e7b
commit 0cd6b1251a
16 changed files with 80 additions and 30 deletions
@@ -21,6 +21,8 @@
#include <Wt/Dbo/Impl.h>
#include "core/String.hpp"
#include "database/Session.hpp"
#include "database/objects/Genre.hpp"
#include "database/objects/Grouping.hpp"
@@ -38,7 +40,7 @@ DBO_INSTANTIATE_TEMPLATES(lms::db::MediaLibrary)
namespace lms::db
{
MediaLibrary::MediaLibrary(std::string_view name, const std::filesystem::path& p)
: _name{ std::string{ name, 0, maxNameLength } }
: _name{ core::stringUtils::utf8Truncate(name, maxNameLength) }
{
setPath(p);
}