make ampache work with remote.php

This commit is contained in:
Georg Ehrke 2012-05-07 20:25:44 +02:00
parent 5a1ea62437
commit 5b7cefb1e5
5 changed files with 13 additions and 7 deletions

View File

@ -32,3 +32,4 @@ OCP\App::register( array( 'order' => 3, 'id' => 'media', 'name' => 'Media' ));
OCP\App::addNavigationEntry(array('id' => 'media_index', 'order' => 2, 'href' => OCP\Util::linkTo('media', 'index.php'), 'icon' => OCP\Util::imagePath('core', 'places/music.svg'), 'name' => $l->t('Music')));
OC_Search::registerProvider('OC_MediaSearchProvider');
OCP\CONFIG::setAppValue('core', 'remote_ampache', '/apps/media/remote.php');

View File

@ -207,7 +207,7 @@ class OC_MEDIA_AMPACHE{
echo("\t\t<title>$name</title>\n");
echo("\t\t<artist id='$artist'>$artistName</artist>\n");
echo("\t\t<album id='$album'>$albumName</album>\n");
$url=OCP\Util::linkToAbsolute('media', 'server/xml.server.php')."?action=play&song=$id&auth={$_GET['auth']}";
$url=OCP\Util::linkToAbsolute('remote.php', 'ampache/server/xml.server.php/')."?action=play&song=$id&auth={$_GET['auth']}";
$url=self::fixXmlString($url);
echo("\t\t<url>$url</url>\n");
echo("\t\t<time>{$song['song_length']}</time>\n");

7
apps/media/remote.php Normal file
View File

@ -0,0 +1,7 @@
<?php
if($path_info == '/ampache' || $path_info == '/ampache/'){
require_once(OC::$APPSROOT . '/apps/media/index.php');
}else{
require_once(OC::$APPSROOT . '/apps/media/server/xml.server.php');
}
?>

View File

@ -21,8 +21,6 @@
*
*/
require_once('../../inc.php');
OCP\App::checkAppEnabled('media');
require_once(OC::$APPSROOT . '/apps/media/lib_collection.php');
require_once(OC::$APPSROOT . '/apps/media/lib_ampache.php');

View File

@ -41,15 +41,15 @@ class OC_Helper {
$app .= '/';
// Check if the app is in the app folder
if( file_exists( OC::$APPSROOT . '/apps/'. $app.$file )){
if(substr($file, -3) == 'php' || substr($file, -3) == 'css'){
//if(substr($file, -3) == 'php' || substr($file, -3) == 'css'){
if(substr($app, -1, 1) == '/'){
$app = substr($app, 0, strlen($app) - 1);
}
$urlLinkTo = OC::$WEBROOT . '/?app=' . $app;
$urlLinkTo .= ($file!='index.php')?'&getfile=' . urlencode($file):'';
}else{
$urlLinkTo = OC::$APPSWEBROOT . '/apps/' . $app . $file;
}
//}else{
// $urlLinkTo = OC::$APPSWEBROOT . '/apps/' . $app . $file;
//}
}
else{
$urlLinkTo = OC::$WEBROOT . '/' . $app . $file;