From 54e5a1084628696d4a694c9325e4d55aaa41d82c Mon Sep 17 00:00:00 2001 From: Bartek Przybylski Date: Sun, 2 Oct 2011 13:52:04 +0200 Subject: [PATCH] avoid creating empty albums, removing od depreciated code openings --- apps/gallery/lib_scanner.php | 2 +- apps/gallery/templates/index.php | 2 +- apps/gallery/templates/view_album.php | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) 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 @@ -