diff options
author | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2007-01-17 04:45:28 +0000 |
---|---|---|
committer | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2007-01-17 04:45:28 +0000 |
commit | 407b618fc7c3a4be60e7ee14dca4d01edf205d44 (patch) | |
tree | 55ba8f4f1a21cb48feb0b74360e17683c8396789 /modules | |
parent | 2979c691e52422eb255ea2bc7be033c7d2a6a29f (diff) | |
download | ampache-407b618fc7c3a4be60e7ee14dca4d01edf205d44.tar.gz ampache-407b618fc7c3a4be60e7ee14dca4d01edf205d44.tar.bz2 ampache-407b618fc7c3a4be60e7ee14dca4d01edf205d44.zip |
localplay controllers and some spelling fixes
Diffstat (limited to 'modules')
-rw-r--r-- | modules/localplay/httpq.controller.php | 12 | ||||
-rw-r--r-- | modules/localplay/mpd.controller.php | 2 |
2 files changed, 12 insertions, 2 deletions
diff --git a/modules/localplay/httpq.controller.php b/modules/localplay/httpq.controller.php index 9c391bc6..b6d26445 100644 --- a/modules/localplay/httpq.controller.php +++ b/modules/localplay/httpq.controller.php @@ -174,6 +174,9 @@ class AmpacheHttpq { if (is_null($this->_httpq->clear())) { return false; } + // If the clear worked we should stop it! + $this->stop(); + return true; } // clear_playlist @@ -185,6 +188,13 @@ class AmpacheHttpq { */ function play() { + /* A play when it's already playing causes a track restart + * which we don't want to doublecheck its state + */ + if ($this->_httpq->state() == 'play') { + return true; + } + if (is_null($this->_httpq->play())) { return false; } return true; @@ -331,7 +341,7 @@ class AmpacheHttpq { /* If we don't know it, look up by filename */ if (!$song->title) { $filename = sql_escape($entry); - $sql = "SELECT id FROM song WHERE file = '$filename'"; + $sql = "SELECT id FROM song WHERE file LIKE '%$filename'"; $db_results = mysql_query($sql, dbh()); if ($r = mysql_fetch_assoc($db_results)) { $song = new Song($r['id']); diff --git a/modules/localplay/mpd.controller.php b/modules/localplay/mpd.controller.php index c31a020b..c002d299 100644 --- a/modules/localplay/mpd.controller.php +++ b/modules/localplay/mpd.controller.php @@ -345,7 +345,7 @@ class AmpacheMpd { /* If we don't know it, look up by filename */ if (!$song->title) { $filename = sql_escape($entry['file']); - $sql = "SELECT id FROM song WHERE file = '$filename'"; + $sql = "SELECT id FROM song WHERE file LIKE '%$filename'"; $db_results = mysql_query($sql, dbh()); if ($r = mysql_fetch_assoc($db_results)) { $song = new Song($r['id']); |