summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKarl 'vollmerk' Vollmer <vollmer@ampache.org>2007-08-06 04:59:55 +0000
committerKarl 'vollmerk' Vollmer <vollmer@ampache.org>2007-08-06 04:59:55 +0000
commit69b204fb1dcca77c177d3ac5ec7fb686fb5a5b58 (patch)
tree419bfea1ddff1df2569d3e652a94c2dcc653fded
parentfe077220bf08ac7ad466e6fdfe88197c6d4ed56e (diff)
downloadampache-69b204fb1dcca77c177d3ac5ec7fb686fb5a5b58.tar.gz
ampache-69b204fb1dcca77c177d3ac5ec7fb686fb5a5b58.tar.bz2
ampache-69b204fb1dcca77c177d3ac5ec7fb686fb5a5b58.zip
Added checking for local similars
-rw-r--r--images/icon_mystrands.pngbin0 -> 524 bytes
-rw-r--r--lib/class/artist.class.php1
-rw-r--r--lib/class/catalog.class.php17
-rw-r--r--lib/class/metadata.class.php11
-rw-r--r--server/stats.ajax.php2
5 files changed, 25 insertions, 6 deletions
diff --git a/images/icon_mystrands.png b/images/icon_mystrands.png
new file mode 100644
index 00000000..3022229a
--- /dev/null
+++ b/images/icon_mystrands.png
Binary files differ
diff --git a/lib/class/artist.class.php b/lib/class/artist.class.php
index 15258e66..b857c7b7 100644
--- a/lib/class/artist.class.php
+++ b/lib/class/artist.class.php
@@ -212,6 +212,7 @@ class Artist {
if ($this->_fake) { return true; }
$this->f_name_link = "<a href=\"" . Config::get('web_path') . "/artists.php?action=show&amp;artist=" . $this->id . "\" title=\"" . $this->full_name . "\">" . $name . "</a>";
+ $this->f_link = Config::get('web_path') . '/artists.php?action=show&amp;artist=' . $this->id;
// Get the counts
$this->get_count();
diff --git a/lib/class/catalog.class.php b/lib/class/catalog.class.php
index 839412a8..337a0696 100644
--- a/lib/class/catalog.class.php
+++ b/lib/class/catalog.class.php
@@ -1640,8 +1640,9 @@ class Catalog {
/**
* check_artist
* $artist checks if there then return id else insert and return id
+ * If readonly is passed then don't create, return false on not found
*/
- public static function check_artist($artist) {
+ public static function check_artist($artist,$readonly='') {
// Only get the var ones.. less func calls
$cache_limit = Config::get('artist_cache_limit');
@@ -1679,7 +1680,7 @@ class Catalog {
} //if found
/* If not found create */
- else {
+ elseif (!$readonly) {
$prefix_txt = 'NULL';
@@ -1696,6 +1697,10 @@ class Catalog {
}
} // not found
+ // If readonly, and not found return false
+ else {
+ return false;
+ }
if ($cache_limit) {
@@ -1718,7 +1723,7 @@ class Catalog {
* check_album
* Takes $album and checks if there then return id else insert and return id
*/
- public static function check_album($album,$album_year=0) {
+ public static function check_album($album,$album_year=0,$readonly='') {
/* Clean up the album name */
$album = trim($album);
@@ -1765,7 +1770,7 @@ class Catalog {
} //if found
/* If not found create */
- else {
+ elseif (!$readonly) {
$prefix_txt = 'NULL';
if ($prefix) {
@@ -1784,6 +1789,10 @@ class Catalog {
self::$_art_albums[$album_id] = 1;
} //not found
+ // If not readonly and not found
+ else {
+ return false;
+ }
if ($cache_limit > 0) {
diff --git a/lib/class/metadata.class.php b/lib/class/metadata.class.php
index f5e80626..39655f09 100644
--- a/lib/class/metadata.class.php
+++ b/lib/class/metadata.class.php
@@ -66,7 +66,16 @@ class metadata {
$data['name'] = $item['ArtistName'];
$data['uid'] = $item['__attributes']['ArtistID'];
$data['mystrands_url'] = $item['URI'];
- $data['links'] = "<a target=\"_blank\" href=\"" . $item['URI'] . "\">" . get_user_icon('mystrands','','MyStrands Link') . "</a>";
+ $data['links'] = "<a target=\"_blank\" href=\"" . $item['URI'] . "\">" . get_user_icon('mystrands','MyStrands Link') . "</a>";
+
+ // Do a search for this artist in our instance
+ $artist_id = Catalog::check_artist($data['name'],1);
+ if ($artist_id) {
+ $artist = new Artist($artist_id);
+ $artist->format();
+ $data['links'] .= "<a href=\"$artist->f_link\">" . get_user_icon('link','Ampache') . "</a>";
+ }
+
$objects[] = Artist::construct_from_array($data);
break;
} // end switch on type
diff --git a/server/stats.ajax.php b/server/stats.ajax.php
index cdb5a7cd..5054ce03 100644
--- a/server/stats.ajax.php
+++ b/server/stats.ajax.php
@@ -49,7 +49,7 @@ switch ($_REQUEST['action']) {
case 'recommend':
switch ($_REQUEST['type']) {
case 'artist':
- $headers = array('name'=>_('Name'),'links'=>' ');
+ $headers = array('name'=>_('Name'),'links'=>_('Links'));
break;
case 'album':
case 'track':