summaryrefslogtreecommitdiffstats
path: root/apps/gallery/ajax/getAlbums.php
diff options
context:
space:
mode:
authorBart Visscher <bartv@thisnet.nl>2011-12-08 20:06:26 +0100
committerBart Visscher <bartv@thisnet.nl>2011-12-08 20:06:26 +0100
commit487c23e27f6b562fb96eda980776b32398908932 (patch)
tree0db79cfe673990f2359204bf86eba214e5304502 /apps/gallery/ajax/getAlbums.php
parent5e4f28ea21f32086e28740c6689d7000c1dfd488 (diff)
parenteeaf539a4414e3081b6f6652167363a3221a1973 (diff)
downloadnextcloud-server-487c23e27f6b562fb96eda980776b32398908932.tar.gz
nextcloud-server-487c23e27f6b562fb96eda980776b32398908932.zip
Merge branch 'master' into tasks
Diffstat (limited to 'apps/gallery/ajax/getAlbums.php')
-rw-r--r--apps/gallery/ajax/getAlbums.php6
1 files changed, 2 insertions, 4 deletions
diff --git a/apps/gallery/ajax/getAlbums.php b/apps/gallery/ajax/getAlbums.php
index 38bea74636f..856f29344d7 100644
--- a/apps/gallery/ajax/getAlbums.php
+++ b/apps/gallery/ajax/getAlbums.php
@@ -4,13 +4,11 @@ OC_JSON::checkLoggedIn();
OC_JSON::checkAppEnabled('gallery');
$a = array();
-$stmt = OC_DB::prepare('SELECT * FROM *PREFIX*gallery_albums WHERE `uid_owner` = ?');
-$result = $stmt->execute(array(OC_User::getUser()));
+$result = OC_Gallery_Album::find(OC_User::getUser());
while ($r = $result->fetchRow()) {
$album_name = $r['album_name'];
- $stmt = OC_DB::prepare('SELECT * FROM *PREFIX*gallery_photos WHERE `album_id` = ?');
- $tmp_res = $stmt->execute(array($r['album_id']));
+ $tmp_res = OC_Gallery_Photo::find($r['album_id']);
$a[] = array('name' => $album_name, 'numOfItems' => min($tmp_res->numRows(), 10));
}