summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/class/song.class.php8
-rw-r--r--lib/class/xmldata.class.php11
2 files changed, 18 insertions, 1 deletions
diff --git a/lib/class/song.class.php b/lib/class/song.class.php
index 029d45a4..9ce008b4 100644
--- a/lib/class/song.class.php
+++ b/lib/class/song.class.php
@@ -688,6 +688,14 @@ class Song extends database_object implements media {
// Get the top tags
$tags = Tag::get_top_tags('song',$this->id);
+ $this->tags = $tags;
+
+ $tag = new Tag($tags['0']);
+
+ // Emulate the genre information for legacy crap (API)
+ $this->f_genre = $tag->name;
+ $this->genre = $tag->id;
+
$this->f_tags = Tag::get_display($tags,$this->id,'song');
// Format the size
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" .