aboutsummaryrefslogtreecommitdiffstats
path: root/src/db
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-09-05 19:00:32 +0200
committerMax Kellermann <max@duempel.org>2013-09-05 19:07:27 +0200
commit662bed6a008e3f7115fa4401357cd96ac72829f9 (patch)
treec193fe37f7c377942d805557d76862b99a2376ce /src/db
parentae5e0cb02bdc82b5848dc1641f8cbc48dadc2d76 (diff)
downloadmpd-662bed6a008e3f7115fa4401357cd96ac72829f9.tar.gz
mpd-662bed6a008e3f7115fa4401357cd96ac72829f9.tar.xz
mpd-662bed6a008e3f7115fa4401357cd96ac72829f9.zip
db/proxy: use class TagBuilder
Diffstat (limited to 'src/db')
-rw-r--r--src/db/ProxyDatabasePlugin.cxx14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/db/ProxyDatabasePlugin.cxx b/src/db/ProxyDatabasePlugin.cxx
index 6cf7af13f..2b8850f26 100644
--- a/src/db/ProxyDatabasePlugin.cxx
+++ b/src/db/ProxyDatabasePlugin.cxx
@@ -27,7 +27,7 @@
#include "Song.hxx"
#include "gcc.h"
#include "ConfigData.hxx"
-#include "tag/Tag.hxx"
+#include "tag/TagBuilder.hxx"
#include "util/Error.hxx"
#include "util/Domain.hxx"
@@ -248,7 +248,7 @@ Visit(struct mpd_connection *connection,
}
static void
-Copy(Tag &tag, enum tag_type d_tag,
+Copy(TagBuilder &tag, enum tag_type d_tag,
const struct mpd_song *song, enum mpd_tag_type s_tag)
{
@@ -270,15 +270,13 @@ Convert(const struct mpd_song *song)
s->start_ms = mpd_song_get_start(song) * 1000;
s->end_ms = mpd_song_get_end(song) * 1000;
- Tag *tag = new Tag();
- tag->time = mpd_song_get_duration(song);
+ TagBuilder tag;
+ tag.SetTime(mpd_song_get_duration(song));
- tag->BeginAdd();
for (const auto *i = &tag_table[0]; i->d != TAG_NUM_OF_ITEM_TYPES; ++i)
- Copy(*tag, i->d, song, i->s);
- tag->EndAdd();
+ Copy(tag, i->d, song, i->s);
- s->tag = tag;
+ s->tag = tag.Commit();
return s;
}