diff options
author | Paul Arthur <paul.arthur@flowerysong.com> | 2013-02-07 14:24:40 -0500 |
---|---|---|
committer | Paul Arthur <paul.arthur@flowerysong.com> | 2013-02-07 14:24:40 -0500 |
commit | 239ea81fdf2fa2bda8a8556e19412264396fe52a (patch) | |
tree | 0d753486ec6ded74cb4adb1a7e70dd9ce4ccfda6 /lib/class/catalog.class.php | |
parent | 31afde9fc07a766229681a13d2cce0825e9fec93 (diff) | |
download | ampache-239ea81fdf2fa2bda8a8556e19412264396fe52a.tar.gz ampache-239ea81fdf2fa2bda8a8556e19412264396fe52a.tar.bz2 ampache-239ea81fdf2fa2bda8a8556e19412264396fe52a.zip |
Some cleanup of play URL handling
Move parsing from Song into Stream_URL and make it parse more things.
Add the type parameter to all generated URLs instead of adding video to
Video URLs.
Diffstat (limited to 'lib/class/catalog.class.php')
-rw-r--r-- | lib/class/catalog.class.php | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/class/catalog.class.php b/lib/class/catalog.class.php index 3b164317..21ef2d08 100644 --- a/lib/class/catalog.class.php +++ b/lib/class/catalog.class.php @@ -1961,11 +1961,10 @@ class Catalog extends database_object { } // if it's a file // Check to see if it's a url from this ampache instance - elseif (substr($value,0,strlen(Config::get('web_path'))) == Config::get('web_path')) { - $song_id = intval(Song::parse_song_url($value)); - - $sql = "SELECT COUNT(*) FROM `song` WHERE `id`='$song_id'"; - $db_results = Dba::read($sql); + elseif (substr($value, 0, strlen(Config::get('web_path'))) == Config::get('web_path')) { + $data = Stream_URL::parse($value); + $sql = 'SELECT COUNT(*) FROM `song` WHERE `id` = ?'; + $db_results = Dba::read($sql, array($data['id'])); if (Dba::num_rows($db_results)) { $songs[] = $song_id; |