1
0
Fork 0
mirror of https://github.com/Yetangitu/ampache synced 2025-10-06 03:49:56 +02:00

Add 'fake' directory to Subsonic streaming url when cUrl unavailable

This commit is contained in:
Afterster 2014-01-11 19:47:18 +01:00
parent 89b12c8f0a
commit c3b3a8021e
5 changed files with 20 additions and 10 deletions

View file

@ -86,6 +86,10 @@ class Subsonic_Api
curl_close($ch);
} else {
// Stream media using http redirect if no curl support
// Bug fix for android clients looking for /rest/ in destination url
// Warning: external catalogs will not work!
$url = str_replace('/play/', '/rest/fake/', $url);
header("Location: " . $url);
}
}

View file

@ -3,4 +3,5 @@
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-s
RewriteRule ^(.+)\.view$ index.php?action=$1 [PT,L,QSA]
RewriteRule ^fake/(.+)$ ../play/$1 [PT,L,QSA]
</IfModule>

View file

@ -28,6 +28,11 @@ if (!AmpConfig::get('subsonic_backend')) {
exit;
}
$ssid = $_GET['ssid'];
if (!empty($ssid)) {
print_r('test', 'found!', '5');
}
$action = strtolower($_GET['action']);
$f = $_GET['f'];
$callback = $_GET['callback'];