sn0opy/MPD-Webinterface — Issue #1: Permanent refresh while playing streams
Author: Luzifer
Created: 2011-11-02 13:30:29+00:00
State: open

While playing streams the length of the track is constantly zero so there is a permanent refresh, which would be fixed by this diff:

```
diff --git a/index.php b/index.php
index 2d7c02b..c7415df 100755
--- a/index.php
+++ b/index.php
@@ -37,8 +37,11 @@ if($mpd->connected == FALSE) {
$CURRENTTIME = convertSecs($times[0]);

// fucking dirty
- if($mpd->state != 'stop')
- echo ''."\n";
+ if($mpd->state != 'stop') {
+ $refresh = ((($times[1]-$times[0])*1000)+500);
+ if($refresh < 1) { $refresh = 30500; }
+ echo ''."\n";
+ }

if(isset($_POST['toadd'])) {
$object = $_POST['toadd'];
```