1
0
Fork 0
mirror of https://github.com/Yetangitu/ampache synced 2025-10-03 17:59:21 +02:00

some more minor tweaks to democratic playlist, fixed now playing on localplay playlist

This commit is contained in:
Karl 'vollmerk' Vollmer 2009-02-08 15:16:02 +00:00
parent e24192c441
commit 2a0c72b30c
7 changed files with 45 additions and 14 deletions

View file

@ -77,9 +77,10 @@ switch ($_REQUEST['action']) {
break; break;
case 'show_playlist': case 'show_playlist':
default: default:
require_once Config::get('prefix') . '/templates/show_democratic.inc.php';
$democratic = Democratic::get_current_playlist(); $democratic = Democratic::get_current_playlist();
$democratic->set_parent(); $democratic->set_parent();
$democratic->format();
require_once Config::get('prefix') . '/templates/show_democratic.inc.php';
$objects = $democratic->get_items(); $objects = $democratic->get_items();
Browse::set_type('democratic'); Browse::set_type('democratic');
Browse::reset(); Browse::reset();

View file

@ -1070,7 +1070,7 @@ class Browse {
// Limit is based on the users preferences if this is not a simple browse because we've got too much here // Limit is based on the users preferences if this is not a simple browse because we've got too much here
if (count($object_ids) > self::$start AND !self::is_simple_browse()) { if (count($object_ids) > self::$start AND !self::is_simple_browse()) {
$object_ids = array_slice($object_ids,self::$start,self::$offset); $object_ids = array_slice($object_ids,self::$start,self::$offset,TRUE);
} }
// Format any matches we have so we can show them to the masses // Format any matches we have so we can show them to the masses

View file

@ -535,9 +535,8 @@ class AmpacheHttpq extends localplay_controller {
$array['random'] = $this->_httpq->get_random(); $array['random'] = $this->_httpq->get_random();
$array['track'] = $this->_httpq->get_now_playing(); $array['track'] = $this->_httpq->get_now_playing();
preg_match("/song=(\d+)\&/",$array['track'],$matches); $url_data = $this->parse_url($array['track']);
$song_id = $matches['1']; $song = new Song($url_data['oid']);
$song = new Song($song_id);
$array['track_title'] = $song->title; $array['track_title'] = $song->title;
$array['track_artist'] = $song->get_artist_name(); $array['track_artist'] = $song->get_artist_name();
$array['track_album'] = $song->get_album_name(); $array['track_album'] = $song->get_album_name();

View file

@ -542,9 +542,8 @@ class AmpacheMpd extends localplay_controller {
$array['random'] = $this->_mpd->random; $array['random'] = $this->_mpd->random;
$array['track'] = $track+1; $array['track'] = $track+1;
preg_match("/song=(\d+)\&/",$this->_mpd->playlist[$track]['file'],$matches); $url_data = $this->parse_url($this->_mpd->playlist[$track]['file']);
$song_id = $matches['1']; $song = new Song($url_data['oid']);
$song = new Song($song_id);
$array['track_title'] = $song->title; $array['track_title'] = $song->title;
$array['track_artist'] = $song->get_artist_name(); $array['track_artist'] = $song->get_artist_name();
$array['track_album'] = $song->get_album_name(); $array['track_album'] = $song->get_album_name();

View file

@ -60,8 +60,11 @@ switch ($_REQUEST['action']) {
$democratic->delete_votes($_REQUEST['row_id']); $democratic->delete_votes($_REQUEST['row_id']);
ob_start(); ob_start();
$objects = $democratic->get_items(); $object_ids = $democratic->get_items();
require_once Config::get('prefix') . '/templates/show_democratic_playlist.inc.php'; Browse::set_type('democratic');
Browse::reset();
Browse::set_static_content(1);
Browse::show_objects($object_ids);
$results['democratic_playlist'] = ob_get_contents(); $results['democratic_playlist'] = ob_get_contents();
ob_end_clean(); ob_end_clean();
@ -74,6 +77,26 @@ switch ($_REQUEST['action']) {
$_SESSION['iframe']['target'] = Config::get('web_path') . '/stream.php?action=democratic&democratic_id=' . scrub_out($_REQUEST['democratic_id']); $_SESSION['iframe']['target'] = Config::get('web_path') . '/stream.php?action=democratic&democratic_id=' . scrub_out($_REQUEST['democratic_id']);
$results['rfc3514'] = '<script type="text/javascript">reload_util("'.$_SESSION['iframe']['target'].'")</script>'; $results['rfc3514'] = '<script type="text/javascript">reload_util("'.$_SESSION['iframe']['target'].'")</script>';
break; break;
case 'clear_playlist':
if (!Access::check('interface','100')) {
exit;
}
$democratic = new Democratic($_REQUEST['democratic_id']);
$democratic->set_parent();
$democratic->clear();
ob_start();
$object_ids = $democratic->get_items();
Browse::set_type('democratic');
Browse::reset();
Browse::set_static_content(1);
Browse::show_objects($object_ids);
$results['browse_content'] = ob_get_contents();
ob_end_clean();
break;
default: default:
$results['rfc3514'] = '0x1'; $results['rfc3514'] = '0x1';
break; break;

View file

@ -23,6 +23,9 @@ show_box_top(sprintf(_('%s Playlist') ,$democratic->name));
?> ?>
<div id="information_actions"> <div id="information_actions">
<ul> <ul>
<li>
<?php echo _('Cooldown'); ?>:<?php echo $democratic->f_cooldown; ?>
</li>
<li> <li>
<?php echo _('Now Playing'); ?>:<i>....</i> <?php echo _('Now Playing'); ?>:<i>....</i>
<li> <li>

View file

@ -24,7 +24,9 @@ $web_path = Config::get('web_path');
<colgroup> <colgroup>
<col id="col_action" /> <col id="col_action" />
<col id="col_votes" /> <col id="col_votes" />
<col id="col_song" /> <col id="col_title" />
<col id="col_album" />
<col id="col_artist" />
<col id="col_time" /> <col id="col_time" />
<?php if (Access::check('interface','100')) { ?> <?php if (Access::check('interface','100')) { ?>
<col id="col_admin" /> <col id="col_admin" />
@ -50,7 +52,9 @@ else {
<tr class="th-top"> <tr class="th-top">
<th class="cel_action"><?php echo _('Action'); ?></th> <th class="cel_action"><?php echo _('Action'); ?></th>
<th class="cel_votes"><?php echo _('Votes'); ?></th> <th class="cel_votes"><?php echo _('Votes'); ?></th>
<th class="cel_song"><?php echo _('Song'); ?></th> <th class="cel_title"><?php echo _('Title'); ?></th>
<th class="cel_album"><?php echo _('Album'); ?></th>
<th class="cel_artist"><?php echo _('Artist'); ?></th>
<th class="cel_time"><?php echo _('Time'); ?></th> <th class="cel_time"><?php echo _('Time'); ?></th>
<?php if (Access::check('interface','100')) { ?> <?php if (Access::check('interface','100')) { ?>
<th class="cel_admin"><?php echo _('Admin'); ?></th> <th class="cel_admin"><?php echo _('Admin'); ?></th>
@ -72,7 +76,9 @@ foreach($object_ids as $row_id=>$object_data) {
<?php } ?> <?php } ?>
</td> </td>
<td class="cel_votes"><?php echo scrub_out($democratic->get_vote($row_id)); ?></td> <td class="cel_votes"><?php echo scrub_out($democratic->get_vote($row_id)); ?></td>
<td class="cel_song"><?php echo $song->f_link . " / " . $song->f_album_link . " / " . $song->f_artist_link; ?></td> <td class="cel_title"><?php echo $song->f_link; ?></td>
<td class="cel_album"><?php echo $song->f_album_link; ?></td>
<td class="cel_artist"><?php echo $song->f_artist_link; ?></td>
<td class="cel_time"><?php echo $song->f_time; ?></td> <td class="cel_time"><?php echo $song->f_time; ?></td>
<?php if ($GLOBALS['user']->has_access(100)) { ?> <?php if ($GLOBALS['user']->has_access(100)) { ?>
<td class="cel_admin"> <td class="cel_admin">