summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKarl 'vollmerk' Vollmer <vollmer@ampache.org>2007-12-06 06:05:32 +0000
committerKarl 'vollmerk' Vollmer <vollmer@ampache.org>2007-12-06 06:05:32 +0000
commitb3dcd437cb507774753659faa113d499e107e201 (patch)
treefaaaf999315b575f063c0564ea4d6d5aebb9ea5e
parentf7cfd87117fbd41911bb6823aec8ea3ffdd72350 (diff)
downloadampache-b3dcd437cb507774753659faa113d499e107e201.tar.gz
ampache-b3dcd437cb507774753659faa113d499e107e201.tar.bz2
ampache-b3dcd437cb507774753659faa113d499e107e201.zip
fixed lack of prefix on albums improves album art search results, thx darkside
-rwxr-xr-xdocs/CHANGELOG4
-rw-r--r--lib/class/album.class.php10
-rw-r--r--lib/class/catalog.class.php7
-rw-r--r--templates/show_edit_album.inc.php2
-rw-r--r--templates/show_edit_album_row.inc.php2
-rw-r--r--templates/show_random_albums.inc.php2
6 files changed, 17 insertions, 10 deletions
diff --git a/docs/CHANGELOG b/docs/CHANGELOG
index c0ae3b74..a6891cd9 100755
--- a/docs/CHANGELOG
+++ b/docs/CHANGELOG
@@ -4,6 +4,10 @@
--------------------------------------------------------------------------
v.3.4-Alpha4
+ - Added another layer of checking on catalog deletes to help
+ prevent orphaned elements
+ - Fixed lack of prefix on Albums, improves album art search
+ results (Thx darkside)
- Fixed problem with invalid urls populated to localplay methods
under certin conditions
- Fixed Album Art dump bin script
diff --git a/lib/class/album.class.php b/lib/class/album.class.php
index bbacf852..d0beedce 100644
--- a/lib/class/album.class.php
+++ b/lib/class/album.class.php
@@ -209,9 +209,9 @@ class Album {
foreach ($data as $key=>$value) { $this->$key = $value; }
/* Truncate the string if it's to long */
- $this->f_name = truncate_with_ellipsis($this->name,Config::get('ellipsis_threshold_album'));
+ $this->f_name = truncate_with_ellipsis($this->full_name,Config::get('ellipsis_threshold_album'));
- $this->f_name_link = "<a href=\"$web_path/albums.php?action=show&amp;album=" . scrub_out($this->id) . "\" title=\"" . scrub_out($this->name) . "\">" . $this->f_name;
+ $this->f_name_link = "<a href=\"$web_path/albums.php?action=show&amp;album=" . scrub_out($this->id) . "\" title=\"" . scrub_out($this->full_name) . "\">" . $this->f_name;
// If we've got a disk append it
if ($this->disk) {
$this->f_name_link .= " <span class=\"discnb disc" .$this->disk. "\">[" . _('Disk') . " " . $this->disk . "]</span>";
@@ -219,7 +219,7 @@ class Album {
$this->f_name_link .="</a>";
$this->f_link = $this->f_name_link;
- $this->f_title = $name;
+ $this->f_title = $full_name;
if ($this->artist_count == '1') {
$artist = scrub_out(truncate_with_ellipsis(trim($this->artist_prefix . ' ' . $this->artist_name),Config::get('ellipsis_threshold_album')));
$this->f_artist_link = "<a href=\"$web_path/artists.php?action=show&amp;artist=" . $this->artist_id . "\">" . $artist . "</a>";
@@ -334,7 +334,7 @@ class Album {
}
else {
$artist = $this->artist_name;
- $album = $this->name;
+ $album = $this->full_name;
}
$raw_data = $lastfm->search($artist,$album);
@@ -533,7 +533,7 @@ class Album {
set_time_limit(0);
if (empty($keywords)) {
- $keywords = $this->name;
+ $keywords = $this->full_name;
/* If this isn't a various album combine with artist name */
if ($this->artist_count == '1') { $keywords .= ' ' . $this->artist; }
}
diff --git a/lib/class/catalog.class.php b/lib/class/catalog.class.php
index e7942444..cfab9321 100644
--- a/lib/class/catalog.class.php
+++ b/lib/class/catalog.class.php
@@ -615,9 +615,9 @@ class Catalog {
// Define the options we want to use for the find art function
$options = array(
- 'album_name' => $album->name,
+ 'album_name' => $album->full_name,
'artist' => $album->artist_name,
- 'keyword' => $album->artist_name . ' ' . $album->name
+ 'keyword' => $album->artist_name . ' ' . $album->full_name
);
// Return results
@@ -2236,6 +2236,9 @@ class Catalog {
$sql = "DELETE FROM `song` WHERE `catalog` = '$catalog_id'";
$db_results = Dba::query($sql);
+ // Only if the previous one works do we go on
+ if (!$db_results) { return false; }
+
// Next Remove the Catalog Entry it's self
$sql = "DELETE FROM `catalog` WHERE `id` = '$catalog_id'";
$db_results = Dba::query($sql);
diff --git a/templates/show_edit_album.inc.php b/templates/show_edit_album.inc.php
index ca657672..e8f30373 100644
--- a/templates/show_edit_album.inc.php
+++ b/templates/show_edit_album.inc.php
@@ -26,7 +26,7 @@
<tr class="<?php echo flip_class(); ?>">
<td><?php echo _('Name'); ?></td>
<td>
- <input type="textbox" name="name" value="<?php echo scrub_out($album->name); ?>">
+ <input type="textbox" name="name" value="<?php echo scrub_out($album->full_name); ?>">
</td>
</tr>
<tr class="<?php echo flip_class(); ?>">
diff --git a/templates/show_edit_album_row.inc.php b/templates/show_edit_album_row.inc.php
index 341048c3..0e19c080 100644
--- a/templates/show_edit_album_row.inc.php
+++ b/templates/show_edit_album_row.inc.php
@@ -24,7 +24,7 @@
<table cellpadding="3" cellspacing="0">
<tr>
<td>
- <input type="textbox" name="name" value="<?php echo scrub_out($album->name); ?>" />
+ <input type="textbox" name="name" value="<?php echo scrub_out($album->full_name); ?>" />
</td>
<td>
<?php
diff --git a/templates/show_random_albums.inc.php b/templates/show_random_albums.inc.php
index 99d49bff..1c947fb7 100644
--- a/templates/show_random_albums.inc.php
+++ b/templates/show_random_albums.inc.php
@@ -26,7 +26,7 @@ $web_path = Config::get('web_path');
foreach ($albums as $album_id) {
$album = new Album($album_id);
$album->format();
- $name = scrub_out('[' . $album->f_artist . '] ' . $album->name);
+ $name = scrub_out('[' . $album->f_artist . '] ' . $album->full_name);
?>
<div class="random_album">
<a href="<?php echo $web_path; ?>/albums.php?action=show&amp;album=<?php echo $album_id; ?>">