diff options
author | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2008-05-20 15:04:55 +0000 |
---|---|---|
committer | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2008-05-20 15:04:55 +0000 |
commit | 2b94dfeefacbca8ade82036f0795735671a1e862 (patch) | |
tree | 90f40f1b2bf9fa0aa079b03b6192b35dcdd12700 /modules | |
parent | fd51a754c4f7df3362e6da3e90d6dba7d96a2602 (diff) | |
download | ampache-2b94dfeefacbca8ade82036f0795735671a1e862.tar.gz ampache-2b94dfeefacbca8ade82036f0795735671a1e862.tar.bz2 ampache-2b94dfeefacbca8ade82036f0795735671a1e862.zip |
added a bit of debugging
Diffstat (limited to 'modules')
-rw-r--r-- | modules/localplay/shoutcast.controller.php | 82 |
1 files changed, 10 insertions, 72 deletions
diff --git a/modules/localplay/shoutcast.controller.php b/modules/localplay/shoutcast.controller.php index 4926a6cd..ac5cb592 100644 --- a/modules/localplay/shoutcast.controller.php +++ b/modules/localplay/shoutcast.controller.php @@ -449,63 +449,7 @@ class AmpacheShoutCast extends localplay_controller { */ public function get() { - // If we don't have the playlist yet, pull it - if (!isset($this->_mpd->playlist)) { - $this->_mpd->GetPlaylist(); - } - - /* Get the Current Playlist */ - $playlist = $this->_mpd->playlist; - - foreach ($playlist as $entry) { - $data = array(); - - /* Required Elements */ - $data['id'] = $entry['Pos']; - $data['raw'] = $entry['file']; - - $url_data = $this->parse_url($entry['file']); - - switch ($url_data['primary_key']) { - case 'song': - $song = new Song($url_data['song']); - $song->format(); - $data['name'] = $song->f_title . ' - ' . $song->f_album . ' - ' . $song->f_artist; - $data['link'] = $song->f_link; - break; - case 'demo_id': - $democratic = new Democratic($url_data['demo_id']); - $data['name'] = _('Democratic') . ' - ' . $democratic->name; - $data['link'] = ''; - break; - default: - - /* If we don't know it, look up by filename */ - $filename = Dba::escape($entry['file']); - $sql = "SELECT `id` FROM `song` WHERE `file` LIKE '%$filename'"; - $db_results = Dba::query($sql); - if ($r = Dba::fetch_assoc($db_results)) { - $song = new Song($r['id']); - $song->format(); - $data['name'] = $song->f_title . ' - ' . $song->f_album . ' - ' . $song->f_artist; - $data['link'] = $song->f_link; - } - else { - $data['name'] = _('Unknown'); - $data['link'] = ''; - } - - break; - } // end switch on primary key type - - /* Optional Elements */ - $data['track'] = $entry['Pos']+1; - - $results[] = $data; - - } // foreach playlist items - - return $results; + return array(); } // get @@ -516,21 +460,7 @@ class AmpacheShoutCast extends localplay_controller { */ public function status() { - /* Construct the Array */ - $array['state'] = $this->_mpd->state; - $array['volume'] = $this->_mpd->volume; - $array['repeat'] = $this->_mpd->repeat; - $array['random'] = $this->_mpd->random; - $array['track'] = $track+1; - - preg_match("/song=(\d+)\&/",$this->_mpd->playlist[$track]['file'],$matches); - $song_id = $matches['1']; - $song = new Song($song_id); - $array['track_title'] = $song->title; - $array['track_artist'] = $song->get_artist_name(); - $array['track_album'] = $song->get_album_name(); - - return $array; + return array(); } // get_status @@ -556,6 +486,10 @@ class AmpacheShoutCast extends localplay_controller { // Read and clean! $pid = intval(trim(file_get_contents($this->pid))); + if (!$pid) { + debug_event('Shoutcast','Unable to read PID from ' . $this->pid,'1'); + } + return $pid; } // get_pid @@ -570,6 +504,10 @@ class AmpacheShoutCast extends localplay_controller { $handle = fopen($this->playlist,"w"); + if (!is_resource($handle)) { + debug_event('Shoutcast','Unable to open ' . $this->playlist . ' for writing playlist file','1'); + } + fwrite($handle,$string); fclose($handle); |