summaryrefslogtreecommitdiffstats
path: root/lib/class/xmldata.class.php
diff options
context:
space:
mode:
authorKarl 'vollmerk' Vollmer <vollmer@ampache.org>2009-03-09 21:38:27 +0000
committerKarl 'vollmerk' Vollmer <vollmer@ampache.org>2009-03-09 21:38:27 +0000
commite4ad47579a65dadf9da009b525bf28c42bc7623a (patch)
tree3049851031dedaea24b6747822f41a7c50119c24 /lib/class/xmldata.class.php
parentf3be18167cc3759a4079f53bec4cf826550fcb05 (diff)
downloadampache-e4ad47579a65dadf9da009b525bf28c42bc7623a.tar.gz
ampache-e4ad47579a65dadf9da009b525bf28c42bc7623a.tar.bz2
ampache-e4ad47579a65dadf9da009b525bf28c42bc7623a.zip
implement tag information on song xml document for the api, and put back genre (first tag) for backwards compatiblity
Diffstat (limited to 'lib/class/xmldata.class.php')
-rw-r--r--lib/class/xmldata.class.php11
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/class/xmldata.class.php b/lib/class/xmldata.class.php
index 01eb98cb..bdc1f5f6 100644
--- a/lib/class/xmldata.class.php
+++ b/lib/class/xmldata.class.php
@@ -288,6 +288,14 @@ class xmlData {
$song = new Song($song_id);
$song->format();
+ $tag_string = '';
+
+ // Build up the tag's text
+ foreach ($song->tags as $tag_id) {
+ $tag = new Tag($tag_id);
+ $tag_string .= "\t<tag id=\"$tag->id\"><![CDATA[$tag->name]]></tag>\n";
+ }
+
$rating = new Rating($song_id,'song');
$art_url = Config::get('web_path') . '/image.php?id=' . $song->album . '&auth=' . scrub_out($_REQUEST['auth']);
@@ -296,7 +304,8 @@ class xmlData {
"\t<title><![CDATA[$song->title]]></title>\n" .
"\t<artist id=\"$song->artist\"><![CDATA[$song->f_artist_full]]></artist>\n" .
"\t<album id=\"$song->album\"><![CDATA[$song->f_album_full]]></album>\n" .
- "\t<genre id=\"$song->genre\"><![CDATA[$song->genre]]></genre>\n" .
+ "\t<genre id=\"$song->genre\"><![CDATA[$song->f_genre]]></genre>\n" .
+ $tag_string .
"\t<track>$song->track</track>\n" .
"\t<time>$song->time</time>\n" .
"\t<mime>$song->mime</mime>\n" .