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/song.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/song.class.php')
-rw-r--r-- | lib/class/song.class.php | 26 |
1 files changed, 1 insertions, 25 deletions
diff --git a/lib/class/song.class.php b/lib/class/song.class.php index 3d865b25..fa4e1f0c 100644 --- a/lib/class/song.class.php +++ b/lib/class/song.class.php @@ -923,37 +923,13 @@ class Song extends database_object implements media { $song_name = rawurlencode($song->get_artist_name() . " - " . $song->title . "." . $type); - $url = Stream::get_base_url() . "oid=$song->id&uid=$user_id&name=/$song_name"; + $url = Stream::get_base_url() . "type=song&oid=$song->id&uid=$user_id&name=/$song_name"; return $url; } // play_url /** - * parse_song_url - * Takes a URL from this ampache install and returns the song that the url represents - * used by the API, and used to parse out stream urls for localplay - * right now just gets song id might do more later, hence the complexity - */ - public static function parse_song_url($url) { - - // We only care about the question mark stuff - $query = parse_url($url,PHP_URL_QUERY); - - $elements = explode("&",$query); - - foreach ($elements as $items) { - list($key,$value) = explode("=",$items); - if ($key == 'oid') { - return $value; - } - } // end foreach - - return false; - - } // parse_song_url - - /** * get_recently_played * This function returns the last X songs that have been played * it uses the popular threshold to figure out how many to pull |