db/upnp, playlist/pls: use AddItem(std::string_view)

This commit is contained in:
Max Kellermann 2023-09-06 16:08:38 +02:00
parent 44beae519d
commit 2f4e2935a3
3 changed files with 3 additions and 3 deletions

View File

@ -172,7 +172,7 @@ protected:
if (tag_type != TAG_NUM_OF_ITEM_TYPES) { if (tag_type != TAG_NUM_OF_ITEM_TYPES) {
assert(object.type != UPnPDirObject::Type::UNKNOWN); assert(object.type != UPnPDirObject::Type::UNKNOWN);
tag.AddItem(tag_type, value.c_str()); tag.AddItem(tag_type, value);
if (tag_type == TAG_TITLE) if (tag_type == TAG_TITLE)
object.name = TitleToPathSegment(std::move(value)); object.name = TitleToPathSegment(std::move(value));

View File

@ -113,7 +113,7 @@ ParsePls(TextInputStream &is, std::forward_list<DetachedSong> &songs)
TagBuilder tag; TagBuilder tag;
if (!entry.title.empty()) if (!entry.title.empty())
tag.AddItem(TAG_TITLE, entry.title.c_str()); tag.AddItem(TAG_TITLE, entry.title);
if (entry.length > 0) if (entry.length > 0)
tag.SetDuration(SignedSongTime::FromS(entry.length)); tag.SetDuration(SignedSongTime::FromS(entry.length));

View File

@ -210,7 +210,7 @@ SoundCloudJsonData::EndMap() noexcept
TagBuilder tag; TagBuilder tag;
tag.SetDuration(SignedSongTime::FromMS(duration)); tag.SetDuration(SignedSongTime::FromMS(duration));
if (!title.empty()) if (!title.empty())
tag.AddItem(TAG_NAME, title.c_str()); tag.AddItem(TAG_NAME, title);
songs.emplace_front(u.c_str(), tag.Commit()); songs.emplace_front(u.c_str(), tag.Commit());