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

Commit 2151a0b7 authored by Jonas Haraldsson's avatar Jonas Haraldsson
parent de116c45
......@@ -42,6 +42,11 @@ function radio_title_from_url($url) {
$artist = $regs[2];
return $host_name . ' ' . ucwords($artist) . ' Similar Artist Radio';
}
if (preg_match('@l(ast|ibre)fm://artist/(.*)/album/(.*)@', $url, $regs)) {
$artist = $regs[2];
$album = $regs[3];
return $host_name . ' ' . ucwords($artist) . ' - ' . ucwords($album) . ' Album Radio';
}
if (preg_match('@l(ast|ibre)fm://artist/(.*)@', $url, $regs)) {
$artist = $regs[2];
return $host_name . ' ' . ucwords($artist) . ' Artist Radio';
......@@ -111,6 +116,10 @@ function make_playlist($session, $old_format = false, $format='xml') {
}
$similarArtists = $artist->getSimilar(20);
$res = get_artist_selection($similarArtists, $artist);
} else if (preg_match('@l(ast|ibre)fm://artist/(.*)/album/(.*)@', $url, $regs)) {
$query = 'SELECT name, artist_name, album_name, duration, streamurl FROM Track WHERE streamable=1 AND lower(artist_name)=lower(?) AND lower(album_name)=lower(?)';
$params = array($regs[2], $regs[3]);
$res = $adodb->CacheGetAll(7200, $query, $params);
} else if (preg_match('@l(ast|ibre)fm://artist/(.*)@', $url, $regs)) {
$artist = $regs[2];
$res = $adodb->CacheGetAll(7200, 'SELECT name, artist_name, album_name, duration, streamurl FROM Track WHERE streamable=1 AND lower(artist_name) = lower(' . $adodb->qstr($artist) . ')');
......
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