1
0
Fork 0
mirror of https://github.com/Yetangitu/ampache synced 2025-10-04 02:09:23 +02:00

sync to trunk

This commit is contained in:
Karl 'vollmerk' Vollmer 2008-08-30 20:09:10 +00:00
parent 3267cf14b9
commit ada7cc3542
4 changed files with 21 additions and 16 deletions

View file

@ -4,6 +4,9 @@
-------------------------------------------------------------------------- --------------------------------------------------------------------------
v.3.5-Alpha1 v.3.5-Alpha1
- Fixed Dynamic Random/Related URLs with players that always send
a byte offset (MPD)
- Added Checkbox to use existing Database
- Updated language code and Fixed catalan language code - Updated language code and Fixed catalan language code
- Added Emulate gettext() from upgradephp-15 - Added Emulate gettext() from upgradephp-15
(http://freshmeat.net/p/upgradephp) (http://freshmeat.net/p/upgradephp)

View file

@ -137,7 +137,7 @@ if ($demo_id) {
* if we are doing random let's pull the random object * if we are doing random let's pull the random object
*/ */
if ($random) { if ($random) {
if (!isset($start)) { if ($start < 1) {
$song_id = Random::get_single_song($_REQUEST['type']); $song_id = Random::get_single_song($_REQUEST['type']);
// Save this one incase we do a seek // Save this one incase we do a seek
$_SESSION['random']['last'] = $song_id; $_SESSION['random']['last'] = $song_id;
@ -158,19 +158,7 @@ if (!make_bool($song->enabled)) {
exit; exit;
} }
/* If we don't have a file, or the file is not readable */
if (!$song->file OR ( !is_readable($song->file) AND $catalog->catalog_type != 'remote' ) ) {
// We need to make sure this isn't democratic play, if it is then remove the song
// from the vote list
if (is_object($tmp_playlist)) {
$tmp_playlist->delete_track($song_id);
}
debug_event('file_not_found',"Error song $song->file ($song->title) does not have a valid filename specified",'2');
echo "Error: Invalid Song Specified, file not found or file unreadable";
exit;
}
// If we are running in Legalize mode, don't play songs already playing // If we are running in Legalize mode, don't play songs already playing
@ -212,6 +200,20 @@ if ($catalog->catalog_type == 'remote') {
exit; exit;
} // end if remote catalog } // end if remote catalog
/* If we don't have a file, or the file is not readable */
if (!$song->file OR !is_readable($song->file)) {
// We need to make sure this isn't democratic play, if it is then remove the song
// from the vote list
if (is_object($tmp_playlist)) {
$tmp_playlist->delete_track($song_id);
}
debug_event('file_not_found',"Error song $song->file ($song->title) does not have a valid filename specified",'2');
echo "Error: Invalid Song Specified, file not found or file unreadable";
exit;
}
// make fread binary safe // make fread binary safe
set_magic_quotes_runtime(0); set_magic_quotes_runtime(0);

View file

@ -233,7 +233,7 @@ switch ($_REQUEST['action']) {
switch ($_REQUEST['type']) { switch ($_REQUEST['type']) {
case 'album': case 'album':
case 'artist': case 'artist':
case 'genre': 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) {
@ -249,7 +249,7 @@ switch ($_REQUEST['action']) {
break; break;
case 'album_random': case 'album_random':
case 'artist_random': case 'artist_random':
case 'genre_random': case 'tag_random':
$data = explode('_',$_REQUEST['type']); $data = explode('_',$_REQUEST['type']);
$type = $data['0']; $type = $data['0'];
$object = new $type($_REQUEST['id']); $object = new $type($_REQUEST['id']);

View file

@ -65,7 +65,7 @@
<?php echo Ajax::text('?action=basket&type=dynamic&random_type=album',_('Related Album'),'rb_add_related_album'); ?> <?php echo Ajax::text('?action=basket&type=dynamic&random_type=album',_('Related Album'),'rb_add_related_album'); ?>
</li> </li>
<li> <li>
<?php echo Ajax::text('?action=basket&type=dynamic&random_type=genre',_('Related Genre'),'rb_add_related_genre'); ?> <?php echo Ajax::text('?action=basket&type=dynamic&random_type=tag',_('Related Tag'),'rb_add_related_tag'); ?>
</li> </li>
</ul> </ul>
</li> </li>