aboutsummaryrefslogtreecommitdiffstats
path: root/apps/media
diff options
context:
space:
mode:
Diffstat (limited to 'apps/media')
-rw-r--r--apps/media/ajax/api.php18
-rw-r--r--apps/media/ajax/autoupdate.php2
-rw-r--r--apps/media/appinfo/app.php10
-rw-r--r--apps/media/index.php20
-rw-r--r--apps/media/lib_ampache.php6
-rw-r--r--apps/media/lib_collection.php2
-rw-r--r--apps/media/lib_media.php18
-rw-r--r--apps/media/lib_scanner.php14
-rw-r--r--apps/media/settings.php16
-rw-r--r--apps/media/tomahawk.php14
10 files changed, 60 insertions, 60 deletions
diff --git a/apps/media/ajax/api.php b/apps/media/ajax/api.php
index 84d5dd17882..225bce7b092 100644
--- a/apps/media/ajax/api.php
+++ b/apps/media/ajax/api.php
@@ -52,16 +52,16 @@ if(!isset($arguments['album'])){
if(!isset($arguments['search'])){
$arguments['search']='';
}
-OC_MEDIA_COLLECTION::$uid=OC_USER::getUser();
+OC_MEDIA_COLLECTION::$uid=OC_User::getUser();
if($arguments['action']){
switch($arguments['action']){
case 'delete':
$path=$arguments['path'];
OC_MEDIA_COLLECTION::deleteSongByPath($path);
- $paths=explode(PATH_SEPARATOR,OC_PREFERENCES::getValue(OC_USER::getUser(),'media','paths',''));
+ $paths=explode(PATH_SEPARATOR,OC_Preferences::getValue(OC_User::getUser(),'media','paths',''));
if(array_search($path,$paths)!==false){
unset($paths[array_search($path,$paths)]);
- OC_PREFERENCES::setValue(OC_USER::getUser(),'media','paths',implode(PATH_SEPARATOR,$paths));
+ OC_Preferences::setValue(OC_User::getUser(),'media','paths',implode(PATH_SEPARATOR,$paths));
}
case 'get_collection':
$artists=OC_MEDIA_COLLECTION::getArtists();
@@ -78,11 +78,11 @@ if($arguments['action']){
case 'scan':
set_time_limit(0); //recursive scan can take a while
$path=$arguments['path'];
- if(OC_FILESYSTEM::is_dir($path)){
- $paths=explode(PATH_SEPARATOR,OC_PREFERENCES::getValue(OC_USER::getUser(),'media','paths',''));
+ if(OC_Filesystem::is_dir($path)){
+ $paths=explode(PATH_SEPARATOR,OC_Preferences::getValue(OC_User::getUser(),'media','paths',''));
if(array_search($path,$paths)===false){
$paths[]=$path;
- OC_PREFERENCES::setValue(OC_USER::getUser(),'media','paths',implode(PATH_SEPARATOR,$paths));
+ OC_Preferences::setValue(OC_User::getUser(),'media','paths',implode(PATH_SEPARATOR,$paths));
}
}
echo OC_MEDIA_SCANNER::scanFolder($path);
@@ -103,7 +103,7 @@ if($arguments['action']){
case 'play':
ob_end_clean();
- $ftype=OC_FILESYSTEM::getMimeType( $arguments['path'] );
+ $ftype=OC_Filesystem::getMimeType( $arguments['path'] );
$songId=OC_MEDIA_COLLECTION::getSongByPath($arguments['path']);
OC_MEDIA_COLLECTION::registerPlay($songId);
@@ -112,9 +112,9 @@ if($arguments['action']){
header('Expires: 0');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Pragma: public');
- header('Content-Length: '.OC_FILESYSTEM::filesize($arguments['path']));
+ header('Content-Length: '.OC_Filesystem::filesize($arguments['path']));
- OC_FILESYSTEM::readfile($arguments['path']);
+ OC_Filesystem::readfile($arguments['path']);
exit;
}
}
diff --git a/apps/media/ajax/autoupdate.php b/apps/media/ajax/autoupdate.php
index 97733398225..ded1fd02bc3 100644
--- a/apps/media/ajax/autoupdate.php
+++ b/apps/media/ajax/autoupdate.php
@@ -33,7 +33,7 @@ error_log($_GET['autoupdate']);
$autoUpdate=(isset($_GET['autoupdate']) and $_GET['autoupdate']=='true');
error_log((integer)$autoUpdate);
-OC_PREFERENCES::setValue(OC_USER::getUser(),'media','autoupdate',(integer)$autoUpdate);
+OC_Preferences::setValue(OC_User::getUser(),'media','autoupdate',(integer)$autoUpdate);
echo json_encode( array( "status" => "success", "data" => $autoUpdate));
?> \ No newline at end of file
diff --git a/apps/media/appinfo/app.php b/apps/media/appinfo/app.php
index a41e228be4a..d75bac031e9 100644
--- a/apps/media/appinfo/app.php
+++ b/apps/media/appinfo/app.php
@@ -22,12 +22,12 @@
require_once('apps/media/lib_media.php');
-if(OC_APP::getCurrentApp()=='files'){
- OC_UTIL::addScript('media','files');
+if(OC_App::getCurrentApp()=='files'){
+ OC_Util::addScript('media','files');
}
-OC_APP::register( array( 'order' => 3, 'id' => 'media', 'name' => 'Media' ));
+OC_App::register( array( 'order' => 3, 'id' => 'media', 'name' => 'Media' ));
-OC_APP::addNavigationEntry( array( 'id' => 'media_index', 'order' => 2, 'href' => OC_HELPER::linkTo( 'media', 'index.php' ), 'icon' => OC_HELPER::imagePath( 'media', 'media.png' ), 'name' => 'Media' ));
-OC_APP::addSettingsPage( array( 'id' => 'media_settings', 'order' => 5, 'href' => OC_HELPER::linkTo( 'media', 'settings.php' ), 'name' => 'Media', 'icon' => OC_HELPER::imagePath( 'media', 'media.png' )));
+OC_App::addNavigationEntry( array( 'id' => 'media_index', 'order' => 2, 'href' => OC_Helper::linkTo( 'media', 'index.php' ), 'icon' => OC_Helper::imagePath( 'media', 'media.png' ), 'name' => 'Media' ));
+OC_App::addSettingsPage( array( 'id' => 'media_settings', 'order' => 5, 'href' => OC_Helper::linkTo( 'media', 'settings.php' ), 'name' => 'Media', 'icon' => OC_Helper::imagePath( 'media', 'media.png' )));
?>
diff --git a/apps/media/index.php b/apps/media/index.php
index fbf1c395d99..152c4583412 100644
--- a/apps/media/index.php
+++ b/apps/media/index.php
@@ -25,25 +25,25 @@
require_once('../../lib/base.php');
// Check if we are a user
-if( !OC_USER::isLoggedIn()){
- header( "Location: ".OC_HELPER::linkTo( '', 'index.php' ));
+if( !OC_User::isLoggedIn()){
+ header( "Location: ".OC_Helper::linkTo( '', 'index.php' ));
exit();
}
require_once('lib_collection.php');
require_once('lib_scanner.php');
-OC_UTIL::addScript('media','player');
-OC_UTIL::addScript('media','music');
-OC_UTIL::addScript('media','jquery.jplayer.min');
-OC_UTIL::addStyle('media','player');
-OC_UTIL::addStyle('media','music');
+OC_Util::addScript('media','player');
+OC_Util::addScript('media','music');
+OC_Util::addScript('media','jquery.jplayer.min');
+OC_Util::addStyle('media','player');
+OC_Util::addStyle('media','music');
-OC_APP::setActiveNavigationEntry( 'media_index' );
+OC_App::setActiveNavigationEntry( 'media_index' );
-$tmpl = new OC_TEMPLATE( 'media', 'music', 'user' );
+$tmpl = new OC_Template( 'media', 'music', 'user' );
-$player = new OC_TEMPLATE( 'media', 'player');
+$player = new OC_Template( 'media', 'player');
$tmpl->assign('player',$player->fetchPage());
$tmpl->printPage();
?>
diff --git a/apps/media/lib_ampache.php b/apps/media/lib_ampache.php
index 3cd9bd4ab26..97dc004e218 100644
--- a/apps/media/lib_ampache.php
+++ b/apps/media/lib_ampache.php
@@ -319,11 +319,11 @@ class OC_MEDIA_AMPACHE{
return;
}
if($song=OC_MEDIA_COLLECTION::getSong($params['song'])){
- OC_UTIL::setupFS($song["song_user"]);
+ OC_Util::setupFS($song["song_user"]);
- header('Content-type: '.OC_FILESYSTEM::getMimeType($song['song_path']));
+ header('Content-type: '.OC_Filesystem::getMimeType($song['song_path']));
header('Content-Length: '.$song['song_size']);
- OC_FILESYSTEM::readfile($song['song_path']);
+ OC_Filesystem::readfile($song['song_path']);
}
}
diff --git a/apps/media/lib_collection.php b/apps/media/lib_collection.php
index 278e450b778..d9f567aa682 100644
--- a/apps/media/lib_collection.php
+++ b/apps/media/lib_collection.php
@@ -125,7 +125,7 @@ class OC_MEDIA_COLLECTION{
}
$query=OC_DB::prepare("SELECT DISTINCT *PREFIX*media_artists.artist_name AS name , *PREFIX*media_artists.artist_id AS id FROM *PREFIX*media_artists
INNER JOIN *PREFIX*media_songs ON *PREFIX*media_artists.artist_id=*PREFIX*media_songs.song_artist WHERE artist_name LIKE ? AND *PREFIX*media_songs.song_user=?");
- $artists=$query->execute(array($search,OC_USER::getUser()))->fetchAll();
+ $artists=$query->execute(array($search,OC_User::getUser()))->fetchAll();
$result=array();
foreach($artists as $artist){
$result[$artist['id']]=array('artist_name'=>$artist['name'],'artist_id'=>$artist['id']);
diff --git a/apps/media/lib_media.php b/apps/media/lib_media.php
index 6fde2ab7487..67d111936f1 100644
--- a/apps/media/lib_media.php
+++ b/apps/media/lib_media.php
@@ -22,20 +22,20 @@
*/
//we need to have the sha256 hash of passwords for ampache
-OC_HOOK::connect('OC_USER','post_login','OC_MEDIA','loginListener');
+OC_Hook::connect('OC_User','post_login','OC_MEDIA','loginListener');
//connect to the filesystem for auto updating if configured
-if(OC_PREFERENCES::getValue(OC_USER::getUser(),'media','autoupdate',false)){
- OC_HOOK::connect('OC_FILESYSTEM','post_write','OC_MEDIA','updateFile');
+if(OC_Preferences::getValue(OC_User::getUser(),'media','autoupdate',false)){
+ OC_Hook::connect('OC_Filesystem','post_write','OC_MEDIA','updateFile');
}
//listen for file deletions to clean the database if a song is deleted
-OC_HOOK::connect('OC_FILESYSTEM','delete','OC_MEDIA','deleteFile');
+OC_Hook::connect('OC_Filesystem','delete','OC_MEDIA','deleteFile');
class OC_MEDIA{
/**
* get the sha256 hash of the password needed for ampache
- * @param array $params, parameters passed from OC_HOOK
+ * @param array $params, parameters passed from OC_Hook
*/
public static function loginListener($params){
if(isset($_POST['user']) and $_POST['password']){
@@ -56,7 +56,7 @@ class OC_MEDIA{
*/
public static function updateFile($params){
$path=$params['path'];
- $folderNames=explode(PATH_SEPARATOR,OC_PREFERENCES::getValue(OC_USER::getUser(),'media','paths',''));
+ $folderNames=explode(PATH_SEPARATOR,OC_Preferences::getValue(OC_User::getUser(),'media','paths',''));
foreach($folderNames as $folder){
if(substr($path,0,strlen($folder))==$folder){
require_once 'lib_scanner.php';
@@ -90,18 +90,18 @@ class OC_MediaSearchProvider extends OC_Search_Provider{
$songs=OC_MEDIA_COLLECTION::getSongs(0,0,$query);
$results=array();
foreach($artists as $artist){
- $results[]=new OC_Search_Result($artist['artist_name'],'',OC_HELPER::linkTo( 'apps/media', 'index.php#artist='.urlencode($artist['artist_name']) ),'Music');
+ $results[]=new OC_Search_Result($artist['artist_name'],'',OC_Helper::linkTo( 'apps/media', 'index.php#artist='.urlencode($artist['artist_name']) ),'Music');
}
foreach($albums as $album){
$artist=urlencode(OC_MEDIA_COLLECTION::getArtistName($album['album_artist']));
- $results[]=new OC_Search_Result($album['album_name'],'',OC_HELPER::linkTo( 'apps/media', 'index.php#artist='.$artist.'&album='.urlencode($album['album_name']) ),'Music');
+ $results[]=new OC_Search_Result($album['album_name'],'',OC_Helper::linkTo( 'apps/media', 'index.php#artist='.$artist.'&album='.urlencode($album['album_name']) ),'Music');
}
foreach($songs as $song){
$minutes=floor($song['song_length']/60);
$secconds=$song['song_length']%60;
$artist=urlencode(OC_MEDIA_COLLECTION::getArtistName($song['song_artist']));
$album=urlencode(OC_MEDIA_COLLECTION::getalbumName($song['song_album']));
- $results[]=new OC_Search_Result($song['song_name'],"$minutes:$secconds",OC_HELPER::linkTo( 'apps/media', 'index.php#artist='.$artist.'&album='.$album.'&song='.urlencode($song['song_name']) ),'Music');
+ $results[]=new OC_Search_Result($song['song_name'],"$minutes:$secconds",OC_Helper::linkTo( 'apps/media', 'index.php#artist='.$artist.'&album='.$album.'&song='.urlencode($song['song_name']) ),'Music');
}
return $results;
}
diff --git a/apps/media/lib_scanner.php b/apps/media/lib_scanner.php
index 6ad04e7a1be..e3cb2f051ce 100644
--- a/apps/media/lib_scanner.php
+++ b/apps/media/lib_scanner.php
@@ -37,15 +37,15 @@ class OC_MEDIA_SCANNER{
* @return int the number of songs found
*/
public static function scanFolder($path){
- if (OC_FILESYSTEM::is_dir($path)) {
+ if (OC_Filesystem::is_dir($path)) {
$songs=0;
- if ($dh = OC_FILESYSTEM::opendir($path)) {
+ if ($dh = OC_Filesystem::opendir($path)) {
while (($filename = readdir($dh)) !== false) {
if($filename<>'.' and $filename<>'..' and substr($filename,0,1)!='.'){
$file=$path.'/'.$filename;
- if(OC_FILESYSTEM::is_dir($file)){
+ if(OC_Filesystem::is_dir($file)){
$songs+=self::scanFolder($file);
- }elseif(OC_FILESYSTEM::is_file($file)){
+ }elseif(OC_Filesystem::is_file($file)){
if(self::scanFile($file)){
$songs++;
}
@@ -53,7 +53,7 @@ class OC_MEDIA_SCANNER{
}
}
}
- }elseif(OC_FILESYSTEM::is_file($path)){
+ }elseif(OC_Filesystem::is_file($path)){
$songs=1;
self::scanFile($path);
}else{
@@ -68,8 +68,8 @@ class OC_MEDIA_SCANNER{
* @return boolean
*/
public static function scanFile($path){
- $file=OC_FILESYSTEM::getLocalFile($path);
- if(substr($path,-3)=='mp3' and OC_HELPER::canExecute("id3info") and OC_HELPER::canExecute("mp3info")){//use the command line tool id3info if possible
+ $file=OC_Filesystem::getLocalFile($path);
+ if(substr($path,-3)=='mp3' and OC_Helper::canExecute("id3info") and OC_Helper::canExecute("mp3info")){//use the command line tool id3info if possible
$output=array();
$size=filesize($file);
$length=0;
diff --git a/apps/media/settings.php b/apps/media/settings.php
index 4bd9acfd80b..0563bc38fb3 100644
--- a/apps/media/settings.php
+++ b/apps/media/settings.php
@@ -24,19 +24,19 @@
require_once('../../lib/base.php');
-if( !OC_USER::isLoggedIn()){
- header( "Location: ".OC_HELPER::linkTo( "index.php" ));
+if( !OC_User::isLoggedIn()){
+ header( "Location: ".OC_Helper::linkTo( "index.php" ));
exit();
}
require( 'lib_collection.php' );
-OC_UTIL::addStyle('media','style');
-OC_UTIL::addScript('media','settings');
+OC_Util::addStyle('media','style');
+OC_Util::addScript('media','settings');
-OC_APP::setActiveNavigationEntry( 'media_settings' );
+OC_App::setActiveNavigationEntry( 'media_settings' );
-$folderNames=explode(PATH_SEPARATOR,OC_PREFERENCES::getValue($_SESSION['user_id'],'media','paths',''));
+$folderNames=explode(PATH_SEPARATOR,OC_Preferences::getValue($_SESSION['user_id'],'media','paths',''));
$folders=array();
foreach($folderNames as $folder){
if($folder){
@@ -44,9 +44,9 @@ foreach($folderNames as $folder){
}
}
-$tmpl = new OC_TEMPLATE( 'media', 'settings', 'admin' );
+$tmpl = new OC_Template( 'media', 'settings', 'admin' );
$tmpl->assign('folders',$folders);
-$tmpl->assign('autoupdate',OC_PREFERENCES::getValue($_SESSION['user_id'],'media','autoupdate',false));
+$tmpl->assign('autoupdate',OC_Preferences::getValue($_SESSION['user_id'],'media','autoupdate',false));
$tmpl->printPage();
?>
diff --git a/apps/media/tomahawk.php b/apps/media/tomahawk.php
index 873a4e2092c..bf0c2c2a756 100644
--- a/apps/media/tomahawk.php
+++ b/apps/media/tomahawk.php
@@ -28,8 +28,8 @@ require_once('lib_collection.php');
$user=isset($_POST['user'])?$_POST['user']:'';
$pass=isset($_POST['pass'])?$_POST['pass']:'';
-if(OC_USER::checkPassword($user,$pass)){
- OC_UTIL::setupFS($user);
+if(OC_User::checkPassword($user,$pass)){
+ OC_Util::setupFS($user);
OC_MEDIA_COLLECTION::$uid=$user;
}else{
exit;
@@ -40,14 +40,14 @@ if(isset($_POST['play']) and $_POST['play']=='true'){
exit;
}
$song=OC_MEDIA_COLLECTION::getSong($_POST['song']);
- $ftype=OC_FILESYSTEM::getMimeType( $song['song_path'] );
+ $ftype=OC_Filesystem::getMimeType( $song['song_path'] );
header('Content-Type:'.$ftype);
header('Expires: 0');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Pragma: public');
- header('Content-Length: '.OC_FILESYSTEM::filesize($song['song_path']));
+ header('Content-Length: '.OC_Filesystem::filesize($song['song_path']));
- OC_FILESYSTEM::readfile($song['song_path']);
+ OC_Filesystem::readfile($song['song_path']);
}
$artist=isset($_POST['artist'])?'%'.$_POST['artist'].'%':'';
@@ -59,7 +59,7 @@ $album=OC_MEDIA_COLLECTION::getAlbumId($album,$artist);
$songs=OC_MEDIA_COLLECTION::getSongs($artist,$album,$song);
-$baseUrl=OC_UTIL::getServerURL().OC_HELPER::linkTo('media','tomahawk.php');
+$baseUrl=OC_Util::getServerURL().OC_Helper::linkTo('media','tomahawk.php');
$results=array();
foreach($songs as $song) {
@@ -68,7 +68,7 @@ foreach($songs as $song) {
'album' => OC_MEDIA_COLLECTION::getAlbumName($song['song_album']),
'track' => $song['song_name'],
'source' => 'ownCloud',
- 'mimetype' => OC_FILESYSTEM::getMimeType($song['song_path']),
+ '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),