diff options
Diffstat (limited to 'src/playlist/SoundCloudPlaylistPlugin.cxx')
-rw-r--r-- | src/playlist/SoundCloudPlaylistPlugin.cxx | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/playlist/SoundCloudPlaylistPlugin.cxx b/src/playlist/SoundCloudPlaylistPlugin.cxx index f6797b14d..f058b596b 100644 --- a/src/playlist/SoundCloudPlaylistPlugin.cxx +++ b/src/playlist/SoundCloudPlaylistPlugin.cxx @@ -24,7 +24,8 @@ #include "ConfigData.hxx" #include "InputStream.hxx" #include "Song.hxx" -#include "tag/Tag.hxx" +#include "tag/TagBuilder.hxx" +#include "util/StringUtil.hxx" #include "util/Error.hxx" #include "util/Domain.hxx" #include "Log.hxx" @@ -65,9 +66,9 @@ static char * soundcloud_resolve(const char* uri) { char *u, *ru; - if (g_str_has_prefix(uri, "http://")) { + if (StringStartsWith(uri, "http://")) { u = g_strdup(uri); - } else if (g_str_has_prefix(uri, "soundcloud.com")) { + } else if (StringStartsWith(uri, "soundcloud.com")) { u = g_strconcat("http://", uri, nullptr); } else { /* assume it's just a path on soundcloud.com */ @@ -214,11 +215,11 @@ static int handle_end_map(void *ctx) s = Song::NewRemote(u); g_free(u); - Tag *t = new Tag(); - t->time = data->duration / 1000; + TagBuilder tag; + tag.SetTime(data->duration / 1000); if (data->title != nullptr) - t->AddItem(TAG_NAME, data->title); - s->tag = t; + tag.AddItem(TAG_NAME, data->title); + s->tag = tag.Commit(); data->songs.emplace_front(s); |