]> source.dussan.org Git - nextcloud-server.git/commitdiff
fix: oc-33
authorBartek Przybylski <bart.p.pl@gmail.com>
Tue, 17 Jan 2012 19:00:12 +0000 (20:00 +0100)
committerBartek Przybylski <bart.p.pl@gmail.com>
Tue, 17 Jan 2012 19:00:12 +0000 (20:00 +0100)
apps/gallery/lib/scanner.php

index 4ce38a99531266b791f3f31651b01b5aa5e78e46..df33369b93bcce02bc05ba865c6e9d50f7779805 100644 (file)
@@ -59,9 +59,10 @@ class OC_Gallery_Scanner {
     $albums['imagesCount'] = $current_album['imagesCount'];
     $albums['albumName'] = $current_album['name'];
 
-    $result = OC_Gallery_Album::find(OC_User::getUser(), $current_album['name']);
+    $result = OC_Gallery_Album::find(OC_User::getUser(), /*$current_album['name']*/ null, $path);
+    // don't duplicate galleries with same path (bug oc-33)
     if ($result->numRows() == 0 && count($current_album['images'])) {
-           OC_Gallery_Album::create(OC_User::getUser(), $current_album['name'], $path);
+      OC_Gallery_Album::create(OC_User::getUser(), $current_album['name'], $path);
            $result = OC_Gallery_Album::find(OC_User::getUser(), $current_album['name']);
     }
     $albumId = $result->fetchRow();