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
@@ -23,6 +23,8 @@
#include <Wt/Dbo/WtSqlTraits.h>
#include "core/ILogger.hpp"
#include "core/String.hpp"
#include "database/Session.hpp"
#include "database/objects/Artwork.hpp"
#include "database/objects/Directory.hpp"
@@ -171,7 +173,7 @@ namespace lms::db
void PlayListFile::setName(std::string_view name)
{
_name = std::string{ name, 0, _maxNameLength };
_name = core::stringUtils::utf8Truncate(name, _maxNameLength);
LMS_LOG_IF(DB, WARNING, name.size() > _maxNameLength, "PlaylistFile name too long, truncated to '" << _name << "'");
}