bugfix < 0.8.4 migrating
[booh] / bin / booh
index fe30d52b07cb65d74f10ff64617c3957351f4f6e..6bfdd9c41b17c18702e25ab5a8944cad816af4a5 100755 (executable)
--- a/bin/booh
+++ b/bin/booh
@@ -2377,13 +2377,18 @@ def open_file(filename)
                 if xmldir = $xmldoc.elements["//dir[@path='#{utf8(dir)}']"]
                     xmldir.elements.each { |element|
                         if %w(image video).include?(element.name) && !element.attributes['deleted']
-                            old_name = old_dest_dir + '/' + make_dest_filename_old(from_utf8(element.attributes['filename'])).sub(/\.[^\.]+$/, '')
+                            old_name = new_dest_dir + '/' + make_dest_filename_old(from_utf8(element.attributes['filename'])).sub(/\.[^\.]+$/, '')
                             new_name = new_dest_dir + '/' + make_dest_filename(from_utf8(element.attributes['filename'])).sub(/\.[^\.]+$/, '')
                             Dir[old_name + '*'].each { |file|
                                 new_file = file.sub(/^#{Regexp.quote(old_name)}/, new_name)
                                 file != new_file and sys("mv '#{file}' '#{new_file}'")
                             }
                         end
+                        if element.name == 'dir' && !element.attributes['deleted']
+                            old_name = new_dest_dir + '/thumbnails-' + make_dest_filename_old(from_utf8(File.basename(element.attributes['path']))) + '.jpg'
+                            new_name = new_dest_dir + '/thumbnails-' + make_dest_filename(from_utf8(File.basename(element.attributes['path']))) + '.jpg'
+                            old_name != new_name and sys("mv '#{old_name}' '#{new_name}'")
+                        end
                     }
                 else
                     msg 1, "could not find <dir> element by path '#{utf8(dir)}' in xml file"