From 2f4e2935a370ab9be3c577a9edf1c990a44c62aa Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 6 Sep 2023 16:08:38 +0200 Subject: [PATCH] db/upnp, playlist/pls: use AddItem(std::string_view) --- src/db/plugins/upnp/Directory.cxx | 2 +- src/playlist/plugins/PlsPlaylistPlugin.cxx | 2 +- src/playlist/plugins/SoundCloudPlaylistPlugin.cxx | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/db/plugins/upnp/Directory.cxx b/src/db/plugins/upnp/Directory.cxx index 6e1d727a5..b31b99901 100644 --- a/src/db/plugins/upnp/Directory.cxx +++ b/src/db/plugins/upnp/Directory.cxx @@ -172,7 +172,7 @@ protected: if (tag_type != TAG_NUM_OF_ITEM_TYPES) { assert(object.type != UPnPDirObject::Type::UNKNOWN); - tag.AddItem(tag_type, value.c_str()); + tag.AddItem(tag_type, value); if (tag_type == TAG_TITLE) object.name = TitleToPathSegment(std::move(value)); diff --git a/src/playlist/plugins/PlsPlaylistPlugin.cxx b/src/playlist/plugins/PlsPlaylistPlugin.cxx index 070e4c237..d5593f9bb 100644 --- a/src/playlist/plugins/PlsPlaylistPlugin.cxx +++ b/src/playlist/plugins/PlsPlaylistPlugin.cxx @@ -113,7 +113,7 @@ ParsePls(TextInputStream &is, std::forward_list &songs) TagBuilder tag; if (!entry.title.empty()) - tag.AddItem(TAG_TITLE, entry.title.c_str()); + tag.AddItem(TAG_TITLE, entry.title); if (entry.length > 0) tag.SetDuration(SignedSongTime::FromS(entry.length)); diff --git a/src/playlist/plugins/SoundCloudPlaylistPlugin.cxx b/src/playlist/plugins/SoundCloudPlaylistPlugin.cxx index e017843c0..ff1638e17 100644 --- a/src/playlist/plugins/SoundCloudPlaylistPlugin.cxx +++ b/src/playlist/plugins/SoundCloudPlaylistPlugin.cxx @@ -210,7 +210,7 @@ SoundCloudJsonData::EndMap() noexcept TagBuilder tag; tag.SetDuration(SignedSongTime::FromMS(duration)); if (!title.empty()) - tag.AddItem(TAG_NAME, title.c_str()); + tag.AddItem(TAG_NAME, title); songs.emplace_front(u.c_str(), tag.Commit());