diff options
Diffstat (limited to 'apps/gallery/lib/album.php')
-rw-r--r-- | apps/gallery/lib/album.php | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/apps/gallery/lib/album.php b/apps/gallery/lib/album.php index e8698590e6d..070afdd6cd6 100644 --- a/apps/gallery/lib/album.php +++ b/apps/gallery/lib/album.php @@ -98,11 +98,19 @@ class OC_Gallery_Album { } public static function getAlbumSize($id){ - $sql = 'SELECT COUNT(*) as size FROM *PREFIX*gallery_photos WHERE album_id = ?'; - $stmt = OC_DB::prepare($sql); - $result=$stmt->execute(array($id))->fetchRow(); - return $result['size']; + $sql = 'SELECT COUNT(*) as size FROM *PREFIX*gallery_photos WHERE album_id = ?'; + $stmt = OC_DB::prepare($sql); + $result=$stmt->execute(array($id))->fetchRow(); + return $result['size']; } + + public static function getIntermediateGallerySize($path) { + $path .= '%'; + $sql = 'SELECT COUNT(*) as size FROM *PREFIX*gallery_photos photos, *PREFIX*gallery_albums albums WHERE photos.album_id = albums.album_id AND uid_owner = ? AND file_path LIKE ?'; + $stmt = OC_DB::prepare($sql); + $result = $stmt->execute(array(OC_User::getUser(), $path))->fetchRow(); + return $result['size']; + } } ?> |