Last active
September 23, 2017 09:54
-
-
Save confact/40e7ce333cee6ae6bec7d74b6bc42fd8 to your computer and use it in GitHub Desktop.
get url for *cast server
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def song_page | |
url_string = "#{@url.scheme}://#{@url.host}:#{@url.port}" | |
if %(SHOUTcast).include? @server | |
if Gem::Version.new(@version) > Gem::Version.new('2.0') | |
return "#{url_string}/stats?sid=1" | |
else | |
return "#{url_string}/7.html" | |
end | |
elsif %(Icecast).include? @server | |
return false if @url.to_s.include? 'dirble' | |
return "#{url_string}#{@url.path}.xspf" | |
else | |
return false | |
end | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment