summaryrefslogtreecommitdiffstats
path: root/apps/media/ajax/api.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/media/ajax/api.php')
-rw-r--r--apps/media/ajax/api.php12
1 files changed, 6 insertions, 6 deletions
diff --git a/apps/media/ajax/api.php b/apps/media/ajax/api.php
index c5909e4c78b..84ee6334463 100644
--- a/apps/media/ajax/api.php
+++ b/apps/media/ajax/api.php
@@ -67,7 +67,7 @@ if($arguments['action']){
$data['artists']=OC_MEDIA_COLLECTION::getArtists();
$data['albums']=OC_MEDIA_COLLECTION::getAlbums();
$data['songs']=OC_MEDIA_COLLECTION::getSongs();
- echo json_encode($data);
+ OC_JSON::encodedPrint($data);
break;
case 'scan':
OC_DB::beginTransaction();
@@ -81,13 +81,13 @@ if($arguments['action']){
echo (OC_MEDIA_SCANNER::scanFile($arguments['path']))?'true':'false';
break;
case 'get_artists':
- echo json_encode(OC_MEDIA_COLLECTION::getArtists($arguments['search']));
+ OC_JSON::encodedPrint(OC_MEDIA_COLLECTION::getArtists($arguments['search']));
break;
case 'get_albums':
- echo json_encode(OC_MEDIA_COLLECTION::getAlbums($arguments['artist'],$arguments['search']));
+ OC_JSON::encodedPrint(OC_MEDIA_COLLECTION::getAlbums($arguments['artist'],$arguments['search']));
break;
case 'get_songs':
- echo json_encode(OC_MEDIA_COLLECTION::getSongs($arguments['artist'],$arguments['album'],$arguments['search']));
+ OC_JSON::encodedPrint(OC_MEDIA_COLLECTION::getSongs($arguments['artist'],$arguments['album'],$arguments['search']));
break;
case 'get_path_info':
if(OC_Filesystem::file_exists($arguments['path'])){
@@ -100,7 +100,7 @@ if($arguments['action']){
$song=OC_MEDIA_COLLECTION::getSong($songId);
$song['artist']=OC_MEDIA_COLLECTION::getArtistName($song['song_artist']);
$song['album']=OC_MEDIA_COLLECTION::getAlbumName($song['song_album']);
- echo json_encode($song);
+ OC_JSON::encodedPrint($song);
}
}
break;
@@ -129,7 +129,7 @@ if($arguments['action']){
OC_Filesystem::readfile($arguments['path']);
exit;
case 'find_music':
- echo json_encode(findMusic());
+ OC_JSON::encodedPrint(findMusic());
exit;
}
}