when deleting an album, move up the tree to delete also parent
authorgc <gc>
Fri, 17 Jun 2005 20:51:02 +0000 (20:51 +0000)
committergc <gc>
Fri, 17 Jun 2005 20:51:02 +0000 (20:51 +0000)
albums if needed

bin/booh

index b821986f07879c7e128022dff799cc2c3e6c4b8c..af6e7c32becc509920e688a24585601cffbeb3e6 100755 (executable)
--- a/bin/booh
+++ b/bin/booh
@@ -843,11 +843,20 @@ def add_thumbnail(autotable, filename, type, thumbnail_img, caption)
             perform_delete.call
 
             if !after
-                if $xmldir.elements['dir']
+                if $xmldir.child_byname_notattr('dir', 'deleted')
                     $xmldir.delete_attribute('thumbnails-caption')
                     $xmldir.delete_attribute('thumbnails-captionfile')
                 else
                     $xmldir.add_attribute('deleted', 'true')
+                    moveup = $xmldir
+                    while moveup.parent.name == 'dir'
+                        moveup = moveup.parent
+                        if !moveup.child_byname_notattr('dir', 'deleted') && !moveup.child_byname_notattr('image', 'deleted') && !moveup.child_byname_notattr('video', 'deleted')
+                            moveup.add_attribute('deleted', 'true')
+                        else
+                            break
+                        end
+                    end
                 end
                 save_changes('forced')
                 populate_subalbums_treeview