diff --git a/config/config.inc.php b/config/config.inc.php index d017463..96a46f8 100644 --- a/config/config.inc.php +++ b/config/config.inc.php @@ -6,7 +6,7 @@ /* Config relating to the display of CD covers */ /* music_directory must match you MPD music_directory config */ - $_CONFIG['music_directory'] = '/home/danbee/Music'; + $_CONFIG['music_directory'] = '/home/media/data/audio'; $_CONFIG['album_cover_name'] = 'folder.jpg'; $_CONFIG['album_cover_size'] = 130; diff --git a/lib/global.php b/lib/global.php index e451d10..4795470 100644 --- a/lib/global.php +++ b/lib/global.php @@ -1,14 +1,14 @@ current_track_length, ' - ', $mympd->current_track_position; $smarty->assign('page', $page); diff --git a/lib/image.php b/lib/image.php index 125976c..761c5c9 100644 --- a/lib/image.php +++ b/lib/image.php @@ -8,11 +8,11 @@ // Content type header('Content-type: image/jpeg'); - + $script_root = substr($_SERVER["SCRIPT_FILENAME"], 0, strrpos(substr($_SERVER["SCRIPT_FILENAME"], 0, strrpos($_SERVER["SCRIPT_FILENAME"], '/')), '/')); - + $cache_file_name = "$script_root/imagecache/" . md5($filename . $width) . ".jpg"; - + if (!file_exists($cache_file_name)) { // Get new dimensions @@ -30,10 +30,10 @@ $image_p = imagecreatetruecolor($width, $height); $image = imagecreatefromjpeg($filename); imagecopyresampled($image_p, $image, 0, 0, 0, 0, $width, $height, $width_orig, $height_orig); - + // Output imagejpeg($image_p, $cache_file_name, 95); - + } echo file_get_contents($cache_file_name); diff --git a/lib/page.php b/lib/page.php index c24df7a..c911485 100644 --- a/lib/page.php +++ b/lib/page.php @@ -35,6 +35,16 @@ $smarty->assign('coversize', $_CONFIG['album_cover_size']); } + $time_left = (($mympd->current_track_length - $mympd->current_track_position) + 2) * 1000; + + //echo $time_left / 1000; + + if ($mympd->state == MPD_STATE_PLAYING) { + $smarty->assign('refresh', + ""); + } + break; case "browse": diff --git a/templates/default/control.html b/templates/default/control.html index d4a9acf..5548700 100644 --- a/templates/default/control.html +++ b/templates/default/control.html @@ -1,5 +1,5 @@ -