summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKarl 'vollmerk' Vollmer <vollmer@ampache.org>2009-03-10 21:45:15 +0000
committerKarl 'vollmerk' Vollmer <vollmer@ampache.org>2009-03-10 21:45:15 +0000
commiteda8070b7f3dfb1a34c10afe72b6d3f387d6f235 (patch)
treee92d64e75ddf1e5d94d03af5e8302322bedf7a6c
parentc27481203cbe8f7b6bc407718c3abd8b3f9d6307 (diff)
downloadampache-eda8070b7f3dfb1a34c10afe72b6d3f387d6f235.tar.gz
ampache-eda8070b7f3dfb1a34c10afe72b6d3f387d6f235.tar.bz2
ampache-eda8070b7f3dfb1a34c10afe72b6d3f387d6f235.zip
fix tags in the api
-rw-r--r--lib/class/artist.class.php1
-rw-r--r--lib/class/database_object.abstract.php3
-rw-r--r--lib/class/xmldata.class.php6
-rw-r--r--server/xml.server.php1
4 files changed, 6 insertions, 5 deletions
diff --git a/lib/class/artist.class.php b/lib/class/artist.class.php
index d488e003..638c5998 100644
--- a/lib/class/artist.class.php
+++ b/lib/class/artist.class.php
@@ -243,7 +243,6 @@ class Artist extends database_object {
$this->f_tags = Tag::get_display($this->tags,$this->id,'artist');
-
return true;
} // format
diff --git a/lib/class/database_object.abstract.php b/lib/class/database_object.abstract.php
index e26b22df..d7408f4e 100644
--- a/lib/class/database_object.abstract.php
+++ b/lib/class/database_object.abstract.php
@@ -39,6 +39,9 @@ abstract class database_object {
$table_name = $table_name ? Dba::escape($table_name) : Dba::escape(strtolower(get_class($this)));
+ // Make sure we've got a real id
+ if (!is_numeric($id)) { return array(); }
+
if (self::is_cached($table_name,$id)) {
return self::get_from_cache($table_name,$id);
}
diff --git a/lib/class/xmldata.class.php b/lib/class/xmldata.class.php
index 71554464..cfb8805f 100644
--- a/lib/class/xmldata.class.php
+++ b/lib/class/xmldata.class.php
@@ -130,10 +130,10 @@ class xmlData {
$string = '';
- foreach ($tags as $tag_id) {
+ foreach ($tags as $tag_id=>$data) {
+
$tag = new Tag($tag_id);
- $tag->format($type,$object_id);
- $string .= "\t<tag id=\"$tag->id\" count=\"$tag->weight\"><![CDATA[$tag->name]]></tag>\n";
+ $string .= "\t<tag id=\"" . $tag->id . "\" count=\"" . $data['count'] . "\"><![CDATA[$tag->name]]></tag>\n";
}
return $string;
diff --git a/server/xml.server.php b/server/xml.server.php
index 9e978b82..4be31c56 100644
--- a/server/xml.server.php
+++ b/server/xml.server.php
@@ -149,7 +149,6 @@ switch ($_REQUEST['action']) {
Browse::reset_filters();
Browse::set_type('album');
Browse::set_sort('name','ASC');
-
$method = $_REQUEST['exact'] ? 'exact_match' : 'alpha_match';
Api::set_filter($method,$_REQUEST['filter']);
Api::set_filter('add',$_REQUEST['add']);