diff --git a/albums.php b/albums.php index e5f98f69..ca15f01e 100644 --- a/albums.php +++ b/albums.php @@ -212,7 +212,6 @@ switch ($_REQUEST['action']) { case 'show': default: $album = new Album($_REQUEST['album']); - $album->allow_group_disks = true; $album->format(); if (!count($album->album_suite)) { diff --git a/lib/class/album.class.php b/lib/class/album.class.php index b8dfb617..34bd644c 100644 --- a/lib/class/album.class.php +++ b/lib/class/album.class.php @@ -440,17 +440,15 @@ class Album extends database_object $this->f_link_src = $web_path . '/albums.php?action=show&album=' . scrub_out($this->id); $this->f_name_link = "f_link_src . "\" title=\"" . scrub_out($this->full_name) . "\">" . scrub_out($this->f_name); - // Looking to combine disks + // Looking if we need to combine or display disks if ($this->disk && (!$this->allow_group_disks || ($this->allow_group_disks && !AmpConfig::get('album_group')))) { $this->f_name_link .= " [" . T_('Disk') . " " . $this->disk . "]"; - } elseif ($this->disk && $this->allow_group_disks && AmpConfig::get('album_group') && count($this->album_suite) > 1) { - $this->f_name_link .= " [#" . count($this->album_suite) . "]"; } $this->f_name_link .=""; $this->f_link = $this->f_name_link; - $this->f_title = $this->full_name; // FIXME: Legacy? + $this->f_title = $this->full_name; if ($this->artist_count == '1') { $artist = trim(trim($this->artist_prefix) . ' ' . trim($this->artist_name)); $this->f_artist_name = $artist; diff --git a/lib/class/artist.class.php b/lib/class/artist.class.php index d0ee5ab7..9f4255e7 100644 --- a/lib/class/artist.class.php +++ b/lib/class/artist.class.php @@ -148,7 +148,7 @@ class Artist extends database_object * gets the album ids that this artist is a part * of */ - public function get_albums($catalog = null) + public function get_albums($catalog = null, $ignoreAlbumGroups = false) { $catalog_where = ""; $catalog_join = "LEFT JOIN `catalog` ON `catalog`.`id` = `song`.`catalog`"; @@ -173,7 +173,11 @@ class Artist extends database_object $sql_sort = '`album`.`name` DESC'; } - $sql_group = "COALESCE(`album`.`mbid`, `album`.`id`)"; + $sql_group_type = '`album`.`id`'; + if (!$ignoreAlbumGroups && AmpConfig::get('album_group')) { + $sql_group_type = '`album`.`mbid`'; + } + $sql_group = "COALESCE($sql_group_type, `album`.`id`)"; $sql = "SELECT `album`.`id` FROM album LEFT JOIN `song` ON `song`.`album`=`album`.`id` $catalog_join " . "WHERE `song`.`artist`='$this->id' $catalog_where GROUP BY $sql_group ORDER BY $sql_sort"; @@ -477,7 +481,7 @@ class Artist extends database_object Tag::update_tag_list($tags_comma, 'artist', $current_id); if ($override_childs) { - $albums = $this->get_albums(); + $albums = $this->get_albums(null, true); foreach ($albums as $album_id) { $album = new Album($album_id); $album->update_tags($tags_comma, $override_childs); diff --git a/lib/javascript/tools.js b/lib/javascript/tools.js index d2425c9a..2b7d864b 100644 --- a/lib/javascript/tools.js +++ b/lib/javascript/tools.js @@ -175,20 +175,25 @@ function showEditDialog(edit_type, edit_id, edit_form_id, edit_title, refresh_ro type : 'POST', data : $(parent.editFormId).serializeArray(), success : function(resp){ - var new_id = $.trim(resp.lastChild.textContent); $("#editdialog").dialog("close"); - // resp should contain the new identifier, otherwise we take the same as the edited item - if (new_id == '') { - new_id = parent.editId; + if (parent.refreshAction != '') { + var new_id = $.trim(resp.lastChild.textContent); + + // resp should contain the new identifier, otherwise we take the same as the edited item + if (new_id == '') { + new_id = parent.editId; + } + + var url = jsAjaxServer + '/refresh_updated.server.php?action=' + parent.refreshAction + '&id=' + new_id; + // Reload only table + $('#' + parent.refreshRowPrefix + parent.editId).load(url, function() { + // Update the current row identifier with new id + $('#' + parent.refreshRowPrefix + parent.editId).attr("id", parent.refreshRowPrefix + new_id); + }); + } else { + location.reload(true); } - - var url = jsAjaxServer + '/refresh_updated.server.php?action=' + parent.refreshAction + '&id=' + new_id; - // Reload only table - $('#' + parent.refreshRowPrefix + parent.editId).load(url, function() { - // Update the current row identifier with new id - $('#' + parent.refreshRowPrefix + parent.editId).attr("id", parent.refreshRowPrefix + new_id); - }); }, error : function(resp){ $("#editdialog").dialog("close"); diff --git a/server/search.ajax.php b/server/search.ajax.php index 0e80e97a..35f02a3b 100644 --- a/server/search.ajax.php +++ b/server/search.ajax.php @@ -79,10 +79,14 @@ switch ($_REQUEST['action']) { foreach ($sres as $id) { $album = new Album($id); $album->format(); + $a_title = $album->f_title; + if ($album->disk) { + $a_title .= " [" . T_('Disk') . " " . $album->disk . "]"; + } $results[] = array( 'type' => T_('Albums'), 'link' => $album->f_link_src, - 'label' => $album->f_title, + 'label' => $a_title, 'value' => $album->f_title, 'rels' => $album->f_artist, ); diff --git a/templates/show_album.inc.php b/templates/show_album.inc.php index a93c2d0b..27b64e75 100644 --- a/templates/show_album.inc.php +++ b/templates/show_album.inc.php @@ -72,23 +72,23 @@ if (AmpConfig::get('show_played_times')) {