when reordering subalbums, need to regenerate down because of previous/next links
authorgc <gc>
Sat, 28 May 2005 18:21:04 +0000 (18:21 +0000)
committergc <gc>
Sat, 28 May 2005 18:21:04 +0000 (18:21 +0000)
bin/booh

index 5dbc4bcb097fe39f35262bef64884262897c69e3..f46e0689ee87cb27cf65bbb9f3a13024c4aa2b7d 100755 (executable)
--- a/bin/booh
+++ b/bin/booh
@@ -1380,7 +1380,7 @@ def change_dir
         }
 
         move = Proc.new { |direction|
-            save_changes
+            save_changes('forced')
             if direction == 'up'
                 oldpos = $subalbums_edits[xmldir.attributes['path']][:position]
                 $subalbums_edits[xmldir.attributes['path']][:position] -= 1
@@ -1397,6 +1397,10 @@ def change_dir
             }
             elems.sort { |a,b| $subalbums_edits[a[0]][:position] <=> $subalbums_edits[b[0]][:position] }.
                   each { |e| $xmldir.add_element(e[1]) }
+            #- need to remove the already-generated tag to all subdirs because of "previous/next albums" links completely changed
+            $xmldir.elements.each('descendant::dir') { |elem|
+                elem.delete_attribute('already-generated')
+            }
             change_dir
         }