mirror of
https://github.com/Yetangitu/ampache
synced 2025-10-04 10:19:25 +02:00
Implementation for #136 started. Album is now ready to be grouped by disks.
Need to create the new view in the album details. Group only works for album with musicbrainz identifiers.
This commit is contained in:
parent
cd2e33cb1f
commit
7d22e8d466
15 changed files with 190 additions and 49 deletions
11
batch.php
11
batch.php
|
@ -57,9 +57,16 @@ switch ($_REQUEST['action']) {
|
||||||
$name = $search->name;
|
$name = $search->name;
|
||||||
break;
|
break;
|
||||||
case 'album':
|
case 'album':
|
||||||
$album = new Album($_REQUEST['id']);
|
foreach ($_REQUEST['id'] as $a) {
|
||||||
$media_ids = $album->get_songs();
|
$album = new Album($a);
|
||||||
|
if (empty($name)) {
|
||||||
$name = $album->name;
|
$name = $album->name;
|
||||||
|
}
|
||||||
|
$asongs = $album->get_songs();
|
||||||
|
foreach ($asongs as $song_id) {
|
||||||
|
$media_ids[] = $song_id;
|
||||||
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case 'artist':
|
case 'artist':
|
||||||
$artist = new Artist($_REQUEST['id']);
|
$artist = new Artist($_REQUEST['id']);
|
||||||
|
|
|
@ -42,6 +42,7 @@ function get_song_files($media_ids)
|
||||||
$total_size += sprintf("%.2f",($media->size/1048576));
|
$total_size += sprintf("%.2f",($media->size/1048576));
|
||||||
$media->format();
|
$media->format();
|
||||||
$dirname = $media->f_album_full;
|
$dirname = $media->f_album_full;
|
||||||
|
//debug_event('batch.lib.php', 'Songs file {'.$media->file.'}...', '5');
|
||||||
if (!array_key_exists($dirname, $media_files)) {
|
if (!array_key_exists($dirname, $media_files)) {
|
||||||
$media_files[$dirname] = array();
|
$media_files[$dirname] = array();
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,6 +44,9 @@ class Album extends database_object
|
||||||
public $_songs = array();
|
public $_songs = array();
|
||||||
private static $_mapcache = array();
|
private static $_mapcache = array();
|
||||||
|
|
||||||
|
public $album_suite = array();
|
||||||
|
public $allow_group_disks = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* __construct
|
* __construct
|
||||||
* Album constructor it loads everything relating
|
* Album constructor it loads everything relating
|
||||||
|
@ -66,6 +69,11 @@ class Album extends database_object
|
||||||
// Little bit of formatting here
|
// Little bit of formatting here
|
||||||
$this->full_name = trim(trim($info['prefix']) . ' ' . trim($info['name']));
|
$this->full_name = trim(trim($info['prefix']) . ' ' . trim($info['name']));
|
||||||
|
|
||||||
|
// Looking for other albums with same mbid, ordering by disk ascending
|
||||||
|
if ($this->disk && !empty($this->mbid) && AmpConfig::get('album_group')) {
|
||||||
|
$this->album_suite = $this->get_album_suite();
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
} // constructor
|
} // constructor
|
||||||
|
@ -177,15 +185,31 @@ class Album extends database_object
|
||||||
"`artist`.`id` AS `artist_id` " .
|
"`artist`.`id` AS `artist_id` " .
|
||||||
"FROM `song` INNER JOIN `artist` " .
|
"FROM `song` INNER JOIN `artist` " .
|
||||||
"ON `artist`.`id`=`song`.`artist` ";
|
"ON `artist`.`id`=`song`.`artist` ";
|
||||||
|
|
||||||
if (AmpConfig::get('catalog_disable')) {
|
if (AmpConfig::get('catalog_disable')) {
|
||||||
$sql .= "LEFT JOIN `catalog` ON `catalog`.`id` = `song`.`catalog` ";
|
$sql .= "LEFT JOIN `catalog` ON `catalog`.`id` = `song`.`catalog` ";
|
||||||
}
|
}
|
||||||
$sql .= "WHERE `song`.`album` = ? ";
|
|
||||||
|
$suite_array = $this->album_suite;
|
||||||
|
if (!count($suite_array)) {
|
||||||
|
$suite_array[] = $this->id;
|
||||||
|
}
|
||||||
|
|
||||||
|
$idlist = '(' . implode(',', $suite_array) . ')';
|
||||||
|
$sql .= "WHERE `song`.`album` IN $idlist ";
|
||||||
|
|
||||||
if (AmpConfig::get('catalog_disable')) {
|
if (AmpConfig::get('catalog_disable')) {
|
||||||
$sql .= "AND `catalog`.`enabled` = '1' ";
|
$sql .= "AND `catalog`.`enabled` = '1' ";
|
||||||
}
|
}
|
||||||
|
if (!count($this->album_suite)) {
|
||||||
$sql .= "GROUP BY `song`.`album`";
|
$sql .= "GROUP BY `song`.`album`";
|
||||||
$db_results = Dba::read($sql, array($this->id));
|
} else {
|
||||||
|
$sql .= "GROUP BY `song`.`artist`";
|
||||||
|
}
|
||||||
|
|
||||||
|
debug_event("Album", "$sql", "6");
|
||||||
|
|
||||||
|
$db_results = Dba::read($sql);
|
||||||
|
|
||||||
$results = Dba::fetch_assoc($db_results);
|
$results = Dba::fetch_assoc($db_results);
|
||||||
|
|
||||||
|
@ -322,6 +346,54 @@ class Album extends database_object
|
||||||
|
|
||||||
} // get_songs
|
} // get_songs
|
||||||
|
|
||||||
|
/**
|
||||||
|
* get_http_album_query_ids
|
||||||
|
* return the html album parameters with all album suite ids
|
||||||
|
*/
|
||||||
|
public function get_http_album_query_ids($url_param_name)
|
||||||
|
{
|
||||||
|
if ($this->allow_group_disks) {
|
||||||
|
$suite_array = $this->album_suite;
|
||||||
|
if (!count($suite_array)) {
|
||||||
|
$suite_array[] = $this->id;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$suite_array = array ($this->id);
|
||||||
|
}
|
||||||
|
|
||||||
|
return http_build_query(array($url_param_name => $suite_array));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* get_album_suite
|
||||||
|
* gets the album ids with the same musicbrainz identifier
|
||||||
|
*/
|
||||||
|
public function get_album_suite()
|
||||||
|
{
|
||||||
|
$results = array();
|
||||||
|
|
||||||
|
$catalog_where = "";
|
||||||
|
$catalog_join = "LEFT JOIN `catalog` ON `catalog`.`id` = `song`.`catalog`";
|
||||||
|
if ($catalog) {
|
||||||
|
$catalog_where .= " AND `catalog`.`id` = '$catalog'";
|
||||||
|
}
|
||||||
|
if (AmpConfig::get('catalog_disable')) {
|
||||||
|
$catalog_where .= " AND `catalog`.`enabled` = '1'";
|
||||||
|
}
|
||||||
|
|
||||||
|
$sql = "SELECT DISTINCT `album`.`id` FROM album LEFT JOIN `song` ON `song`.`album`=`album`.`id` $catalog_join " .
|
||||||
|
"WHERE `album`.`mbid`='$this->mbid' $catalog_where ORDER BY `album`.`disk` ASC";
|
||||||
|
|
||||||
|
$db_results = Dba::read($sql);
|
||||||
|
|
||||||
|
while ($r = Dba::fetch_assoc($db_results)) {
|
||||||
|
$results[] = $r['id'];
|
||||||
|
}
|
||||||
|
|
||||||
|
return $results;
|
||||||
|
|
||||||
|
} // get_album_suite
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* has_track
|
* has_track
|
||||||
* This checks to see if this album has a track of the specified title
|
* This checks to see if this album has a track of the specified title
|
||||||
|
@ -356,10 +428,14 @@ class Album extends database_object
|
||||||
|
|
||||||
$this->f_link_src = $web_path . '/albums.php?action=show&album=' . scrub_out($this->id);
|
$this->f_link_src = $web_path . '/albums.php?action=show&album=' . scrub_out($this->id);
|
||||||
$this->f_name_link = "<a href=\"" . $this->f_link_src . "\" title=\"" . scrub_out($this->full_name) . "\">" . scrub_out($this->f_name);
|
$this->f_name_link = "<a href=\"" . $this->f_link_src . "\" title=\"" . scrub_out($this->full_name) . "\">" . scrub_out($this->f_name);
|
||||||
// If we've got a disk append it
|
|
||||||
if ($this->disk) {
|
// Looking to combine disks
|
||||||
$this->f_name_link .= " <span class=\"discnb disc" .$this->disk. "\">[" . T_('Disk') . " " . $this->disk . "]</span>";
|
if ($this->disk && (!$this->allow_group_disks || ($this->allow_group_disks && !AmpConfig::get('album_group')))) {
|
||||||
|
$this->f_name_link .= " <span class=\"discnb\">[" . T_('Disk') . " " . $this->disk . "]</span>";
|
||||||
|
} elseif ($this->disk && $this->allow_group_disks && AmpConfig::get('album_group') && count($this->album_suite) > 1) {
|
||||||
|
$this->f_name_link .= " <span class=\"discnb\">[#" . count($this->album_suite) . "]</span>";
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->f_name_link .="</a>";
|
$this->f_name_link .="</a>";
|
||||||
|
|
||||||
$this->f_link = $this->f_name_link;
|
$this->f_link = $this->f_name_link;
|
||||||
|
|
|
@ -161,13 +161,22 @@ class Artist extends database_object
|
||||||
|
|
||||||
$results = array();
|
$results = array();
|
||||||
|
|
||||||
$sql_sort = 'ORDER BY `album`.`name`,`album`.`disk`,`album`.`year`';
|
|
||||||
|
|
||||||
$sort_type = AmpConfig::get('album_sort');
|
$sort_type = AmpConfig::get('album_sort');
|
||||||
if ($sort_type == 'year_asc') { $sql_sort = 'ORDER BY `album`.`year` ASC'; } elseif ($sort_type == 'year_desc') { $sql_sort = 'ORDER BY `album`.`year` DESC'; } elseif ($sort_type == 'name_asc') { $sql_sort = 'ORDER BY `album`.`name` ASC'; } elseif ($sort_type == 'name_desc') { $sql_sort = 'ORDER BY `album`.`name` DESC'; }
|
$sql_sort = '`album`.`name`,`album`.`disk`,`album`.`year`';
|
||||||
|
if ($sort_type == 'year_asc') {
|
||||||
|
$sql_sort = '`album`.`year` ASC';
|
||||||
|
} elseif ($sort_type == 'year_desc') {
|
||||||
|
$sql_sort = '`album`.`year` DESC';
|
||||||
|
} elseif ($sort_type == 'name_asc') {
|
||||||
|
$sql_sort = '`album`.`name` ASC';
|
||||||
|
} elseif ($sort_type == 'name_desc') {
|
||||||
|
$sql_sort = '`album`.`name` DESC';
|
||||||
|
}
|
||||||
|
|
||||||
|
$sql_group = "COALESCE(`album`.`mbid`, `album`.`id`)";
|
||||||
|
|
||||||
$sql = "SELECT `album`.`id` FROM album LEFT JOIN `song` ON `song`.`album`=`album`.`id` $catalog_join " .
|
$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 `album`.`id` $sql_sort";
|
"WHERE `song`.`artist`='$this->id' $catalog_where GROUP BY $sql_group ORDER BY $sql_sort";
|
||||||
|
|
||||||
debug_event("Artist", "$sql", "6");
|
debug_event("Artist", "$sql", "6");
|
||||||
$db_results = Dba::read($sql);
|
$db_results = Dba::read($sql);
|
||||||
|
|
|
@ -148,6 +148,7 @@ class Browse extends Query
|
||||||
case 'album':
|
case 'album':
|
||||||
$box_title = T_('Albums') . $match;
|
$box_title = T_('Albums') . $match;
|
||||||
Album::build_cache($object_ids, 'extra');
|
Album::build_cache($object_ids, 'extra');
|
||||||
|
$allow_group_disks = $argument;
|
||||||
$box_req = AmpConfig::get('prefix') . '/templates/show_albums.inc.php';
|
$box_req = AmpConfig::get('prefix') . '/templates/show_albums.inc.php';
|
||||||
break;
|
break;
|
||||||
case 'user':
|
case 'user':
|
||||||
|
|
|
@ -391,6 +391,9 @@ class Update
|
||||||
$update_string = '- Add concerts options.<br />';
|
$update_string = '- Add concerts options.<br />';
|
||||||
$version[] = array('version' => '360048','description' => $update_string);
|
$version[] = array('version' => '360048','description' => $update_string);
|
||||||
|
|
||||||
|
$update_string = '- Add album group multiple disks setting.<br />';
|
||||||
|
$version[] = array('version' => '360049','description' => $update_string);
|
||||||
|
|
||||||
return $version;
|
return $version;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2360,4 +2363,21 @@ class Update
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* update_360049
|
||||||
|
*
|
||||||
|
* Add album group multiple disks setting
|
||||||
|
*/
|
||||||
|
public static function update_360049()
|
||||||
|
{
|
||||||
|
$sql = "INSERT INTO `preference` (`name`,`value`,`description`,`level`,`type`,`catagory`) " .
|
||||||
|
"VALUES ('album_group','0','Album - Group multiple disks',25,'boolean','interface')";
|
||||||
|
Dba::write($sql);
|
||||||
|
$id = Dba::insert_id();
|
||||||
|
$sql = "INSERT INTO `user_preference` VALUES (-1,?,'0')";
|
||||||
|
Dba::write($sql, array($id));
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,13 +34,12 @@ function showFilters(element) {
|
||||||
/************************************************************/
|
/************************************************************/
|
||||||
|
|
||||||
var closeplaylist;
|
var closeplaylist;
|
||||||
function showPlaylistDialog(e, item_type, item_id) {
|
function showPlaylistDialog(e, item_type, item_ids) {
|
||||||
$("#playlistdialog").dialog("close");
|
$("#playlistdialog").dialog("close");
|
||||||
|
|
||||||
var parent = this;
|
var parent = this;
|
||||||
parent.itemType = item_type;
|
parent.itemType = item_type;
|
||||||
parent.itemId = item_id;
|
parent.contentUrl = jsAjaxServer + '/show_edit_playlist.server.php?action=show_edit_object&item_type=' + item_type + '&item_id=' + item_ids;
|
||||||
parent.contentUrl = jsAjaxServer + '/show_edit_playlist.server.php?action=show_edit_object&item_type=' + item_type + '&item_id=' + item_id;
|
|
||||||
parent.editDialogId = '<div id="playlistdialog"></div>';
|
parent.editDialogId = '<div id="playlistdialog"></div>';
|
||||||
|
|
||||||
$(parent.editDialogId).dialog({
|
$(parent.editDialogId).dialog({
|
||||||
|
|
|
@ -179,6 +179,7 @@ function create_preference_input($name,$value)
|
||||||
case 'share':
|
case 'share':
|
||||||
case 'share_social':
|
case 'share_social':
|
||||||
case 'broadcast_by_default':
|
case 'broadcast_by_default':
|
||||||
|
case 'album_group':
|
||||||
if ($value == '1') { $is_true = "selected=\"selected\""; } else { $is_false = "selected=\"selected\""; }
|
if ($value == '1') { $is_true = "selected=\"selected\""; } else { $is_false = "selected=\"selected\""; }
|
||||||
echo "<select name=\"$name\">\n";
|
echo "<select name=\"$name\">\n";
|
||||||
echo "\t<option value=\"1\" $is_true>" . T_("Enable") . "</option>\n";
|
echo "\t<option value=\"1\" $is_true>" . T_("Enable") . "</option>\n";
|
||||||
|
|
|
@ -212,13 +212,21 @@ switch ($_REQUEST['action']) {
|
||||||
case 'basket':
|
case 'basket':
|
||||||
switch ($_REQUEST['type']) {
|
switch ($_REQUEST['type']) {
|
||||||
case 'album':
|
case 'album':
|
||||||
|
foreach ($_REQUEST['id'] as $i) {
|
||||||
|
$object = new $_REQUEST['type']($i);
|
||||||
|
$songs = $object->get_songs();
|
||||||
|
foreach ($songs as $song_id) {
|
||||||
|
$GLOBALS['user']->playlist->add_object($song_id, 'song');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
case 'artist':
|
case 'artist':
|
||||||
case 'tag':
|
case 'tag':
|
||||||
$object = new $_REQUEST['type']($_REQUEST['id']);
|
$object = new $_REQUEST['type']($_REQUEST['id']);
|
||||||
$songs = $object->get_songs();
|
$songs = $object->get_songs();
|
||||||
foreach ($songs as $song_id) {
|
foreach ($songs as $song_id) {
|
||||||
$GLOBALS['user']->playlist->add_object($song_id,'song');
|
$GLOBALS['user']->playlist->add_object($song_id,'song');
|
||||||
} // end foreach
|
}
|
||||||
break;
|
break;
|
||||||
case 'browse_set':
|
case 'browse_set':
|
||||||
$browse = new Browse($_REQUEST['browse_id']);
|
$browse = new Browse($_REQUEST['browse_id']);
|
||||||
|
@ -228,6 +236,16 @@ switch ($_REQUEST['action']) {
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'album_random':
|
case 'album_random':
|
||||||
|
$data = explode('_',$_REQUEST['type']);
|
||||||
|
$type = $data['0'];
|
||||||
|
foreach ($_REQUEST['id'] as $i) {
|
||||||
|
$object = new $type($i);
|
||||||
|
$songs = $object->get_random_songs();
|
||||||
|
foreach ($songs as $song_id) {
|
||||||
|
$GLOBALS['user']->playlist->add_object($song_id, 'song');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
case 'artist_random':
|
case 'artist_random':
|
||||||
case 'tag_random':
|
case 'tag_random':
|
||||||
$data = explode('_',$_REQUEST['type']);
|
$data = explode('_',$_REQUEST['type']);
|
||||||
|
|
|
@ -90,18 +90,21 @@ switch ($_REQUEST['action']) {
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'album':
|
case 'album':
|
||||||
debug_event('playlist', 'Adding all songs of album {'.$item_id.'}...', '5');
|
debug_event('playlist', 'Adding all songs of album(s) {'.$item_id.'}...', '5');
|
||||||
$album = new Album($item_id);
|
$albums_array = explode(',', $item_id);
|
||||||
$songs = $album->get_songs();
|
foreach ($albums_array as $a) {
|
||||||
foreach ($songs as $song_id) {
|
$album = new Album($a);
|
||||||
|
$asongs = $album->get_songs();
|
||||||
|
foreach ($asongs as $song_id) {
|
||||||
$songs[] = $song_id;
|
$songs[] = $song_id;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case 'artist':
|
case 'artist':
|
||||||
debug_event('playlist', 'Adding all songs of artist {'.$item_id.'}...', '5');
|
debug_event('playlist', 'Adding all songs of artist {'.$item_id.'}...', '5');
|
||||||
$artist = new Artist($item_id);
|
$artist = new Artist($item_id);
|
||||||
$songs = $artist->get_songs();
|
$asongs = $artist->get_songs();
|
||||||
foreach ($songs as $song_id) {
|
foreach ($asongs as $song_id) {
|
||||||
$songs[] = $song_id;
|
$songs[] = $song_id;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -71,7 +71,7 @@ switch ($_REQUEST['action']) {
|
||||||
case 'directplay':
|
case 'directplay':
|
||||||
switch ($_REQUEST['playtype']) {
|
switch ($_REQUEST['playtype']) {
|
||||||
case 'album':
|
case 'album':
|
||||||
$_SESSION['iframe']['target'] = AmpConfig::get('web_path') . '/stream.php?action=album&album_id='.$_REQUEST['album_id'];
|
$_SESSION['iframe']['target'] = AmpConfig::get('web_path') . '/stream.php?action=album&album_id='.implode(',', $_REQUEST['album_id']);
|
||||||
break;
|
break;
|
||||||
case 'artist':
|
case 'artist':
|
||||||
$_SESSION['iframe']['target'] = AmpConfig::get('web_path') . '/stream.php?action=artist&artist_id='.$_REQUEST['artist_id'];
|
$_SESSION['iframe']['target'] = AmpConfig::get('web_path') . '/stream.php?action=artist&artist_id='.$_REQUEST['artist_id'];
|
||||||
|
|
|
@ -101,13 +101,18 @@ switch ($_REQUEST['action']) {
|
||||||
$media_ids = $album->get_random_songs();
|
$media_ids = $album->get_random_songs();
|
||||||
break;
|
break;
|
||||||
case 'album':
|
case 'album':
|
||||||
$album = new Album($_REQUEST['album_id']);
|
debug_event('stream.php', 'Playing/Adding all songs of album(s) {'.$_REQUEST['album_id'].'}...', '5');
|
||||||
|
$albums_array = explode(',', $_REQUEST['album_id']);
|
||||||
|
|
||||||
|
foreach ($albums_array as $a) {
|
||||||
|
$album = new Album($a);
|
||||||
$songs = $album->get_songs();
|
$songs = $album->get_songs();
|
||||||
foreach ($songs as $song) {
|
foreach ($songs as $song) {
|
||||||
$media_ids[] = array(
|
$media_ids[] = array(
|
||||||
'object_type' => 'song',
|
'object_type' => 'song',
|
||||||
'object_id' => $song);
|
'object_id' => $song);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case 'playlist':
|
case 'playlist':
|
||||||
$playlist = new Playlist($_REQUEST['playlist_id']);
|
$playlist = new Playlist($_REQUEST['playlist_id']);
|
||||||
|
|
|
@ -24,9 +24,9 @@
|
||||||
<span class="cel_play_content"> </span>
|
<span class="cel_play_content"> </span>
|
||||||
<div class="cel_play_hover">
|
<div class="cel_play_hover">
|
||||||
<?php if (AmpConfig::get('directplay')) { ?>
|
<?php if (AmpConfig::get('directplay')) { ?>
|
||||||
<?php echo Ajax::button('?page=stream&action=directplay&playtype=album&album_id=' . $album->id,'play', T_('Play'),'play_album_' . $album->id); ?>
|
<?php echo Ajax::button('?page=stream&action=directplay&playtype=album&' . $album->get_http_album_query_ids('album_id'), 'play', T_('Play'), 'play_album_' . $album->id); ?>
|
||||||
<?php if (Stream_Playlist::check_autoplay_append()) { ?>
|
<?php if (Stream_Playlist::check_autoplay_append()) { ?>
|
||||||
<?php echo Ajax::button('?page=stream&action=directplay&playtype=album&album_id=' . $album->id . '&append=true','play_add', T_('Play last'),'addplay_album_' . $album->id); ?>
|
<?php echo Ajax::button('?page=stream&action=directplay&playtype=album&' . $album->get_http_album_query_ids('album_id') . '&append=true', 'play_add', T_('Play last'), 'addplay_album_' . $album->id); ?>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
</div>
|
</div>
|
||||||
|
@ -44,9 +44,9 @@ if (Art::is_enabled()) {
|
||||||
<td class="cel_album"><?php echo $album->f_name_link; ?></td>
|
<td class="cel_album"><?php echo $album->f_name_link; ?></td>
|
||||||
<td class="cel_add">
|
<td class="cel_add">
|
||||||
<span class="cel_item_add">
|
<span class="cel_item_add">
|
||||||
<?php echo Ajax::button('?action=basket&type=album&id=' . $album->id,'add', T_('Add to temporary playlist'),'add_album_' . $album->id); ?>
|
<?php echo Ajax::button('?action=basket&type=album&' . $album->get_http_album_query_ids('id'), 'add', T_('Add to temporary playlist'), 'add_album_' . $album->id); ?>
|
||||||
<?php echo Ajax::button('?action=basket&type=album_random&id=' . $album->id,'random', T_('Random to temporary playlist'),'random_album_' . $album->id); ?>
|
<?php echo Ajax::button('?action=basket&type=album_random&' . $album->get_http_album_query_ids('id'), 'random', T_('Random to temporary playlist'), 'random_album_' . $album->id); ?>
|
||||||
<a id="<?php echo 'add_playlist_'.$album->id ?>" onclick="showPlaylistDialog(event, 'album', '<?php echo $album->id ?>')">
|
<a id="<?php echo 'add_playlist_'.$album->id ?>" onclick="showPlaylistDialog(event, 'album', '<?php if (!count($album->album_suite)) { echo $album->id; } else { echo implode(',', $album->album_suite); } ?>')">
|
||||||
<?php echo UI::get_icon('playlist_add', T_('Add to existing playlist')); ?>
|
<?php echo UI::get_icon('playlist_add', T_('Add to existing playlist')); ?>
|
||||||
</a>
|
</a>
|
||||||
</span>
|
</span>
|
||||||
|
@ -68,14 +68,14 @@ if (Art::is_enabled()) {
|
||||||
</a>
|
</a>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
<?php if (AmpConfig::get('share')) { ?>
|
<?php if (AmpConfig::get('share')) { ?>
|
||||||
<a href="<?php echo $web_path; ?>/share.php?action=show_create&type=album&id=<?php echo $album->id; ?>"><?php echo UI::get_icon('share', T_('Share')); ?></a>
|
<a href="<?php echo $web_path; ?>/share.php?action=show_create&type=album&<?php echo $album->get_http_album_query_ids('id'); ?>"><?php echo UI::get_icon('share', T_('Share')); ?></a>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
<?php if (Access::check_function('batch_download')) { ?>
|
<?php if (Access::check_function('batch_download')) { ?>
|
||||||
<a href="<?php echo AmpConfig::get('web_path'); ?>/batch.php?action=album&id=<?php echo $album->id; ?>">
|
<a href="<?php echo AmpConfig::get('web_path'); ?>/batch.php?action=album&<?php echo $album->get_http_album_query_ids('id'); ?>">
|
||||||
<?php echo UI::get_icon('batch_download', T_('Batch Download')); ?>
|
<?php echo UI::get_icon('batch_download', T_('Batch Download')); ?>
|
||||||
</a>
|
</a>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
<?php if (Access::check('interface','50')) { ?>
|
<?php if (Access::check('interface','50') && (!$album->allow_group_disks || ($album->allow_group_disks && !count($album->album_suite)))) { ?>
|
||||||
<a id="<?php echo 'edit_album_'.$album->id ?>" onclick="showEditDialog('album_row', '<?php echo $album->id ?>', '<?php echo 'edit_album_'.$album->id ?>', '<?php echo T_('Album edit') ?>', 'album_', 'refresh_album')">
|
<a id="<?php echo 'edit_album_'.$album->id ?>" onclick="showEditDialog('album_row', '<?php echo $album->id ?>', '<?php echo 'edit_album_'.$album->id ?>', '<?php echo T_('Album edit') ?>', 'album_', 'refresh_album')">
|
||||||
<?php echo UI::get_icon('edit', T_('Edit')); ?>
|
<?php echo UI::get_icon('edit', T_('Edit')); ?>
|
||||||
</a>
|
</a>
|
||||||
|
|
|
@ -57,6 +57,7 @@ $thcount = 8;
|
||||||
/* Foreach through the albums */
|
/* Foreach through the albums */
|
||||||
foreach ($object_ids as $album_id) {
|
foreach ($object_ids as $album_id) {
|
||||||
$album = new Album($album_id);
|
$album = new Album($album_id);
|
||||||
|
$album->allow_group_disks = $allow_group_disks;
|
||||||
$album->format();
|
$album->format();
|
||||||
?>
|
?>
|
||||||
<tr id="album_<?php echo $album->id; ?>" class="<?php echo UI::flip_class(); ?>">
|
<tr id="album_<?php echo $album->id; ?>" class="<?php echo UI::flip_class(); ?>">
|
||||||
|
|
|
@ -140,7 +140,7 @@ if (AmpConfig::get('show_played_times')) {
|
||||||
<div id="tabs_content">
|
<div id="tabs_content">
|
||||||
<div id="albums" class="tab_content" style="display: block;">
|
<div id="albums" class="tab_content" style="display: block;">
|
||||||
<?php
|
<?php
|
||||||
$browse->show_objects($object_ids);
|
$browse->show_objects($object_ids, true); // Passing 'true' means that we allow grouping albums by disks depending on the configuration
|
||||||
$browse->store();
|
$browse->store();
|
||||||
?>
|
?>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue