1
0
mirror of https://github.com/danbee/neompc synced 2025-03-04 08:39:10 +00:00
neompc/lib/actions.php
Dan Barber b46e8f7441 ~ Fixed problems with apostrophes and ampersands in paths/names. Still need to sort out international characters.
+ Tracks in an album are now sorted by tracknumber.

+ Added config file.
2007-05-10 13:52:32 +00:00

98 lines
1.9 KiB
PHP

<?php
/* handle the actions for mpd */
if ($_GET['skipto']) {
$mympd->SkipTo($_GET['skipto']);
}
switch($_GET['action']) {
case "clear":
$mympd->PLClear();
break;
case "remove":
$mympd->PLRemove($_GET['id']);
break;
case "fileadd":
$mympd->PLAdd($_GET['file']);
break;
case "addall":
/* create the array of files for the playlist add */
if ($browse == '/') {
$browse = '';
}
$browselist = $mympd->GetDir($browse);
foreach($browselist as $browselist_item) {
if ($browselist_item['file']) {
$addlist[] = $browselist_item['file'];
}
}
$mympd->PLAddBulk($addlist);
$page = 'playlist';
setcookie('page', $page);
header("Location: index.php");
break;
case "playall":
$mympd->PLClear();
/* create the array of files for the playlist add */
if ($browse == '/') {
$browse = '';
}
$browselist = $mympd->GetDir($browse);
foreach($browselist as $browselist_item) {
if ($browselist_item['file']) {
$addlist[] = $browselist_item['file'];
}
}
$mympd->PLAddBulk($addlist);
$page = 'control';
setcookie('page', $page);
$mympd->Play();
header("Location: index.php");
break;
case "fileplay":
$mympd->PLClear();
$mympd->PLAdd($_GET['file']);
$page = 'control';
setcookie('page', $page);
$mympd->Play();
header("Location: index.php");
break;
case "play":
$mympd->Play();
header("Location: index.php");
break;
case "stop":
$mympd->Stop();
header("Location: index.php");
break;
case "pause":
$mympd->Pause();
header("Location: index.php");
break;
case "prev":
$mympd->Previous();
header("Location: index.php");
break;
case "next":
$mympd->Next();
header("Location: index.php");
break;
}
?>