diff options
author | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2009-03-09 22:31:24 +0000 |
---|---|---|
committer | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2009-03-09 22:31:24 +0000 |
commit | 80e16c888b961c95bcb5968b1534f3c61f53381c (patch) | |
tree | 5f0573bc074a99d26b3c9e93912572d3abebcc50 /lib/class/xmldata.class.php | |
parent | e4ad47579a65dadf9da009b525bf28c42bc7623a (diff) | |
download | ampache-80e16c888b961c95bcb5968b1534f3c61f53381c.tar.gz ampache-80e16c888b961c95bcb5968b1534f3c61f53381c.tar.bz2 ampache-80e16c888b961c95bcb5968b1534f3c61f53381c.zip |
add tags to the artist and album xml documents
Diffstat (limited to 'lib/class/xmldata.class.php')
-rw-r--r-- | lib/class/xmldata.class.php | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/lib/class/xmldata.class.php b/lib/class/xmldata.class.php index bdc1f5f6..e2a4ef2e 100644 --- a/lib/class/xmldata.class.php +++ b/lib/class/xmldata.class.php @@ -123,6 +123,23 @@ class xmlData { } // header /** + * tags_string + * This returns the formated 'tags' string for an xml document + */ + private static function tags_string($tags) { + + $string = ''; + + foreach ($tags as $tag_id) { + $tag = new Tag($tag_id); + $string .= "\t<tag id=\"$tag->id\"><![CDATA[$tag->name]]></tag>\n"; + } + + return $string; + + } // tags_string + + /** * keyed_array * This will build an xml document from a key'd array, */ @@ -171,9 +188,11 @@ class xmlData { $artist->format(); $rating = new Rating($artist_id,'artist'); + $tag_string = self::tags_string($artist->tags); $string .= "<artist id=\"$artist->id\">\n" . "\t<name><![CDATA[$artist->f_full_name]]></name>\n" . + $tag_string . "\t<albums>$artist->albums</albums>\n" . "\t<songs>$artist->songs</songs>\n" . "\t<preciserating>" . $rating->preciserating . "</preciserating>\n" . @@ -222,6 +241,7 @@ class xmlData { $string .= "\t<year>$album->year</year>\n" . "\t<tracks>$album->song_count</tracks>\n" . "\t<disk>$album->disk</disk>\n" . + self::tags_string($album->tags) . "\t<art><![CDATA[$art_url]]></art>\n" . "\t<preciserating>" . $rating->preciserating . "</preciserating>\n" . "\t<rating>" . $rating->rating . "</rating>\n" . @@ -290,6 +310,10 @@ class xmlData { $tag_string = ''; + $tag = new Tag($song->tags['0']); + $song->genre = $tag->id; + $song->f_genre = $tag->name; + // Build up the tag's text foreach ($song->tags as $tag_id) { $tag = new Tag($tag_id); |