From 5b7cefb1e596013c7ee56d082ecb0731621ef421 Mon Sep 17 00:00:00 2001 From: Georg Ehrke Date: Mon, 7 May 2012 20:25:44 +0200 Subject: make ampache work with remote.php --- apps/media/appinfo/app.php | 1 + apps/media/lib_ampache.php | 2 +- apps/media/remote.php | 7 +++++++ apps/media/server/xml.server.php | 2 -- lib/helper.php | 8 ++++---- 5 files changed, 13 insertions(+), 7 deletions(-) create mode 100644 apps/media/remote.php diff --git a/apps/media/appinfo/app.php b/apps/media/appinfo/app.php index 26cb2045549..0ab6543e070 100755 --- a/apps/media/appinfo/app.php +++ b/apps/media/appinfo/app.php @@ -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'); \ No newline at end of file diff --git a/apps/media/lib_ampache.php b/apps/media/lib_ampache.php index d658605611c..510aba3f7e7 100755 --- a/apps/media/lib_ampache.php +++ b/apps/media/lib_ampache.php @@ -207,7 +207,7 @@ class OC_MEDIA_AMPACHE{ echo("\t\t$name\n"); echo("\t\t$artistName\n"); echo("\t\t$albumName\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\n"); echo("\t\t\n"); diff --git a/apps/media/remote.php b/apps/media/remote.php new file mode 100644 index 00000000000..8a88c2b51ae --- /dev/null +++ b/apps/media/remote.php @@ -0,0 +1,7 @@ + \ No newline at end of file diff --git a/apps/media/server/xml.server.php b/apps/media/server/xml.server.php index 63f2a51dcb5..6cb6c91ca06 100755 --- a/apps/media/server/xml.server.php +++ b/apps/media/server/xml.server.php @@ -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'); diff --git a/lib/helper.php b/lib/helper.php index 5422d88398d..757f562bfed 100644 --- a/lib/helper.php +++ b/lib/helper.php @@ -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; -- cgit v1.2.3