From: Bartek Przybylski Date: Sun, 2 Oct 2011 11:52:04 +0000 (+0200) Subject: avoid creating empty albums, removing od depreciated code openings X-Git-Tag: v3.0~101^2~10^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=54e5a1084628696d4a694c9325e4d55aaa41d82c;p=nextcloud-server.git avoid creating empty albums, removing od depreciated code openings --- diff --git a/apps/gallery/lib_scanner.php b/apps/gallery/lib_scanner.php index e9a022c606b..fe14b68add1 100644 --- a/apps/gallery/lib_scanner.php +++ b/apps/gallery/lib_scanner.php @@ -30,7 +30,7 @@ class OC_GALLERY_SCANNER { $albums[] = $current_album; $stmt = OC_DB::prepare('SELECT * FROM *PREFIX*gallery_albums WHERE "uid_owner" = ? AND "album_name" = ?'); $result = $stmt->execute(array(OC_User::getUser(), $current_album['name'])); - if ($result->numRows() == 0) { + if ($result->numRows() == 0 && count($current_album['images'])) { $stmt = OC_DB::prepare('INSERT OR REPLACE INTO *PREFIX*gallery_albums ("uid_owner", "album_name") VALUES (?, ?)'); $stmt->execute(array(OC_User::getUser(), $current_album['name'])); } diff --git a/apps/gallery/templates/index.php b/apps/gallery/templates/index.php index 97869907557..0e89e448768 100644 --- a/apps/gallery/templates/index.php +++ b/apps/gallery/templates/index.php @@ -1,4 +1,4 @@ -