if images.size == 0 && videos.size == 0
if !$forgui
#- cleanup old images/videos, especially if this directory contained images/videos previously.
- themestuff = Dir.entries("#{$FPATH}/themes/#{$theme}").
- find_all { |e| !%w(. .. skeleton_image.html skeleton_thumbnails.html skeleton_index.html metadata root CVS).include?(e) }
- themestuff_root = Dir.entries("#{$FPATH}/themes/#{$theme}/root").
- find_all { |e| !%w(. .. CVS).include?(e) }
if $mode != 'gen_config'
rightful_images = [ '.htaccess' ]
if xmldir.attributes['thumbnails-caption']
subdir = make_dest_filename(from_utf8(File.basename(child.attributes['path'])))
rightful_images << "thumbnails-#{subdir}.jpg"
}
- to_del = Dir.entries(dest_dir).find_all { |e| !File.directory?(File.join(dest_dir, e)) && !rightful_images.include?(e) } - themestuff - themestuff_root
+ to_del = Dir.entries(dest_dir).find_all { |e| !File.directory?(File.join(dest_dir, e)) && !rightful_images.include?(e) }
if to_del.size > 0
File.delete(*to_del.collect { |e| File.join(dest_dir, e) })
end
end
#- copy any resource file that goes with the theme (css, images..)
+ themestuff = Dir.entries("#{$FPATH}/themes/#{$theme}").
+ find_all { |e| !%w(. .. skeleton_image.html skeleton_thumbnails.html skeleton_index.html metadata root CVS).include?(e) }
themestuff.each { |entry|
if !File.exists?(File.join(dest_dir, entry))
psys("cp '#{$FPATH}/themes/#{$theme}/#{entry}' '#{dest_dir}'")
#- copy any root-only resource file that goes with the theme (css, images..)
if xmldir.parent.name != 'dir'
+ themestuff_root = Dir.entries("#{$FPATH}/themes/#{$theme}/root").
+ find_all { |e| !%w(. .. CVS).include?(e) }
themestuff_root.each { |entry|
if !File.exists?(File.join(dest_dir, entry))
psys("cp '#{$FPATH}/themes/#{$theme}/root/#{entry}' '#{dest_dir}'")
end
}
- if !$forgui
- themestuff = Dir.entries("#{$FPATH}/themes/#{$theme}").
- find_all { |e| !%w(. .. skeleton_image.html skeleton_thumbnails.html skeleton_index.html metadata root CVS).include?(e) }
- themestuff_root = Dir.entries("#{$FPATH}/themes/#{$theme}/root").
- find_all { |e| !%w(. .. CVS).include?(e) }
-
+ if !$forgui
#- cleanup old images/videos (for when removing elements or sizes)
all_elements = fullscreen_images.collect { |e| e[1] }.flatten.
concat(thumbnail_images.collect { |e| e[1] }.flatten).
concat(thumbnail_videos.collect { |e| e[1] }.flatten).
concat($transcode_videos ? transcoded_videos.values : videos).
push('.htaccess')
- to_del = Dir.entries(dest_dir).find_all { |e| !File.directory?(File.join(dest_dir, e)) && !all_elements.include?(e) && e !~ /^thumbnails-\w+\.jpg/ } - themestuff - themestuff_root
+ to_del = Dir.entries(dest_dir).find_all { |e| !File.directory?(File.join(dest_dir, e)) && !all_elements.include?(e) && e !~ /^thumbnails-\w+\.jpg/ }
if to_del.size > 0
msg 3, _("\tcleaning up: #{to_del.join(', ')}")
File.delete(*to_del.collect { |e| File.join(dest_dir, e) })
end
#- copy any resource file that goes with the theme (css, images..)
+ themestuff = Dir.entries("#{$FPATH}/themes/#{$theme}").
+ find_all { |e| !%w(. .. skeleton_image.html skeleton_thumbnails.html skeleton_index.html metadata root CVS).include?(e) }
themestuff.each { |entry|
if !File.exists?(File.join(dest_dir, entry))
psys("cp '#{$FPATH}/themes/#{$theme}/#{entry}' '#{dest_dir}'")
#- copy any root-only resource file that goes with the theme (css, images..)
if xmldir.parent.name != 'dir'
+ themestuff_root = Dir.entries("#{$FPATH}/themes/#{$theme}/root").
+ find_all { |e| !%w(. .. CVS).include?(e) }
themestuff_root.each { |entry|
if !File.exists?(File.join(dest_dir, entry))
psys("cp '#{$FPATH}/themes/#{$theme}/root/#{entry}' '#{dest_dir}'")