From 239ea81fdf2fa2bda8a8556e19412264396fe52a Mon Sep 17 00:00:00 2001 From: Paul Arthur Date: Thu, 7 Feb 2013 14:24:40 -0500 Subject: 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. --- lib/class/catalog.class.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'lib/class/catalog.class.php') 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; -- cgit