summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeorg Ehrke <dev@georgswebsite.de>2012-05-07 20:25:44 +0200
committerGeorg Ehrke <dev@georgswebsite.de>2012-05-07 20:26:09 +0200
commit5b7cefb1e596013c7ee56d082ecb0731621ef421 (patch)
tree688a4fe38336d452b794024548d7a59264ae48b9
parent5a1ea62437673d24407515eb2deabdac1210bfcb (diff)
downloadnextcloud-server-5b7cefb1e596013c7ee56d082ecb0731621ef421.tar.gz
nextcloud-server-5b7cefb1e596013c7ee56d082ecb0731621ef421.zip
make ampache work with remote.php
-rwxr-xr-xapps/media/appinfo/app.php1
-rwxr-xr-xapps/media/lib_ampache.php2
-rw-r--r--apps/media/remote.php7
-rwxr-xr-xapps/media/server/xml.server.php2
-rw-r--r--lib/helper.php8
5 files changed, 13 insertions, 7 deletions
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<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");
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 @@
+<?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');
+}
+?> \ 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;