aboutsummaryrefslogtreecommitdiffstats
path: root/apps/media
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2012-05-11 20:32:37 +0200
committerRobin Appelman <icewind@owncloud.com>2012-05-11 20:33:56 +0200
commit736739bbbda2e9930b7bdcf79f43a28fad4d1d5d (patch)
treeb77bc51d0759baeec9e5b3cc2857548a12715d13 /apps/media
parentd2bd78c41a58320e0f1f6ff6d602371325390747 (diff)
downloadnextcloud-server-736739bbbda2e9930b7bdcf79f43a28fad4d1d5d.tar.gz
nextcloud-server-736739bbbda2e9930b7bdcf79f43a28fad4d1d5d.zip
load remote and public paths from info.xml during upgrade instead of setting them every time
Diffstat (limited to 'apps/media')
-rwxr-xr-xapps/media/appinfo/app.php2
-rw-r--r--apps/media/appinfo/info.xml3
-rw-r--r--apps/media/appinfo/version2
-rwxr-xr-xapps/media/tomahawk.php78
4 files changed, 4 insertions, 81 deletions
diff --git a/apps/media/appinfo/app.php b/apps/media/appinfo/app.php
index 332b73546ec..26cb2045549 100755
--- a/apps/media/appinfo/app.php
+++ b/apps/media/appinfo/app.php
@@ -32,5 +32,3 @@ 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');
-OCP\CONFIG::setAppValue('core', 'remote_tomahawk', '/apps/media/tomahawk.php');
diff --git a/apps/media/appinfo/info.xml b/apps/media/appinfo/info.xml
index ea5b77c9c8f..b0f205f8b1d 100644
--- a/apps/media/appinfo/info.xml
+++ b/apps/media/appinfo/info.xml
@@ -8,4 +8,7 @@
<require>2</require>
<standalone/>
<default_enable/>
+ <remote>
+ <ampache>remote.php</ampache>
+ </remote>
</info>
diff --git a/apps/media/appinfo/version b/apps/media/appinfo/version
index 1d71ef97443..e6adf3fc7bb 100644
--- a/apps/media/appinfo/version
+++ b/apps/media/appinfo/version
@@ -1 +1 @@
-0.3 \ No newline at end of file
+0.4 \ No newline at end of file
diff --git a/apps/media/tomahawk.php b/apps/media/tomahawk.php
deleted file mode 100755
index c74d168c42d..00000000000
--- a/apps/media/tomahawk.php
+++ /dev/null
@@ -1,78 +0,0 @@
-<?php
-
-/**
-* ownCloud - media plugin
-*
-* @author Robin Appelman
-* @copyright 2010 Robin Appelman icewind1991@gmail.com
-*
-* This library is free software; you can redistribute it and/or
-* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
-* License as published by the Free Software Foundation; either
-* version 3 of the License, or any later version.
-*
-* This library is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this library. If not, see <http://www.gnu.org/licenses/>.
-*
-*/
-
-$_POST=$_GET; //debug
-
-OCP\JSON::checkAppEnabled('media');
-require_once(OC::$APPSROOT . '/apps/media/lib_collection.php');
-
-$user=isset($_POST['user'])?$_POST['user']:'';
-$pass=isset($_POST['pass'])?$_POST['pass']:'';
-if(OCP\User::checkPassword($user,$pass)){
- OC_Util::setupFS($user);
- OC_MEDIA_COLLECTION::$uid=$user;
-}else{
- exit;
-}
-
-if(isset($_POST['play']) and $_POST['play']=='true'){
- if(!isset($_POST['song'])){
- exit;
- }
- $song=OC_MEDIA_COLLECTION::getSong($_POST['song']);
- $ftype=OC_Filesystem::getMimeType( $song['song_path'] );
- header('Content-Type:'.$ftype);
- OCP\Response::disableCaching();
- header('Content-Length: '.OC_Filesystem::filesize($song['song_path']));
-
- OC_Filesystem::readfile($song['song_path']);
-}
-
-$artist=isset($_POST['artist'])?'%'.$_POST['artist'].'%':'';
-$album=isset($_POST['album'])?'%'.$_POST['album'].'%':'';
-$song=isset($_POST['song'])?$_POST['song']:'';
-
-$artist=OC_MEDIA_COLLECTION::getArtistId($artist);
-$album=OC_MEDIA_COLLECTION::getAlbumId($album,$artist);
-
-$songs=OC_MEDIA_COLLECTION::getSongs($artist,$album,$song);
-
-$baseUrl=$baseuri;
-
-$results=array();
-foreach($songs as $song) {
- $results[] = (Object) array(
- 'artist' => OC_MEDIA_COLLECTION::getArtistName($song['song_artist']),
- 'album' => OC_MEDIA_COLLECTION::getAlbumName($song['song_album']),
- 'track' => $song['song_name'],
- 'source' => 'ownCloud',
- 'mimetype' => OC_Filesystem::getMimeType($song['song_path']),
- 'extension' => substr($song['song_path'],strrpos($song['song_path'],'.')),
- 'url' => $baseUrl.'?play=true&song='.$song['song_id'],
- 'bitrate' => round($song['song_id']/$song['song_length'],0),
- 'duration' => round($song['song_length'],0),
- 'size' => $song['song_size'],
- 'score' => (float)1.0
- );
-}
-OCP\JSON::encodedPrint($results);