lib/deliver/upload_screenshots.rb in deliver-1.6.2 vs lib/deliver/upload_screenshots.rb in deliver-1.6.3
- old
+ new
@@ -55,24 +55,26 @@
def collect_screenshots(options)
return [] if options[:skip_screenshots]
screenshots = []
extensions = '{png,jpg,jpeg}'
- Dir.glob(File.join(options[:screenshots_path], "*"), File::FNM_CASEFOLD).sort.each do |lng_folder|
- language = File.basename(lng_folder)
-
+ Loader.language_folders(options[:screenshots_path]).each do |lng_folder|
files = Dir.glob(File.join(lng_folder, "*.#{extensions}"))
next if files.count == 0
prefer_framed = Dir.glob(File.join(lng_folder, "*_framed.#{extensions}")).count > 0
+ language = File.basename(lng_folder)
files.each do |path|
- if prefer_framed && !path.downcase.include?("_framed.#{extensions}") && !path.downcase.include?("watch")
- next
- end
-
- if !prefer_framed && path.downcase.include?("_framed.#{extensions}")
- next
+ if path.downcase.include?("_framed.")
+ # That's cool
+ else
+ if path.downcase.include?("watch")
+ # Watch doesn't support frames (yet)
+ else
+ # That might not be cool... if that screenshot is not framed but we only want framed
+ next if prefer_framed
+ end
end
screenshots << AppScreenshot.new(path, language)
end
end