We are no longer offering accounts on this server. Consider https://gitlab.freedesktop.org/ as a place to host projects.

Commit 77dd2866 authored by clint's avatar clint

cope with shell-fm not sending proper urls

parent ff589fa7
......@@ -34,6 +34,10 @@ if(!$res->numRows()) {
die("BADSESSION\n");
}
if(ereg("^(globaltags|artist)/[^:]+$", $url, $regs)) {
$url = "librefm://" . $url; // compensate for shell-fm sending incomplete urls
}
$stationname=radio_title_from_url($url);
if($stationname=="FAILED") {
die("FAILED Unavailable station\n");
......
......@@ -20,12 +20,8 @@
function radio_title_from_url($url) {
if(substr($url, 0, 20) == "lastfm://globaltags/") {
$tag = substr($url, 20);
return "Libre.fm " . ucwords($tag) . " Tag Radio";
}
if(substr($url, 0, 21) == "librefm://globaltags/") {
$tag = substr($url, 21);
if(ereg("l(ast|ibre)fm://globaltags/(.*)", $url, $regs)) {
$tag = $regs[2];
return "Libre.fm " . ucwords($tag) . " Tag Radio";
}
if(ereg("l(ast|ibre)fm://artist/(.*)/similarartists", $url, $regs)) {
......@@ -33,9 +29,7 @@ function radio_title_from_url($url) {
return "Libre.fm " . $artist . " Artist Radio";
}
// return $url;
return "FAILED";
}
?>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment