lib/deliver/upload_screenshots.rb in deliver-1.15.1 vs lib/deliver/upload_screenshots.rb in deliver-1.16.0

- old
+ new

@@ -4,11 +4,11 @@ def upload(options, screenshots) return if options[:skip_screenshots] app = options[:app] - v = app.edit_version + v = app.edit_version(platform: options[:platform]) UI.user_error!("Could not find a version to edit for app '#{app.name}'") unless v UI.message("Starting with the upload of screenshots...") screenshots_per_language = screenshots.group_by(&:language) @@ -38,25 +38,26 @@ screenshots_per_language.each do |language, screenshots_for_language| UI.message("Uploading #{screenshots_for_language.length} screenshots for language #{language}") screenshots_for_language.each do |screenshot| indized[screenshot.language] ||= {} - indized[screenshot.language][screenshot.device_type] ||= 0 - indized[screenshot.language][screenshot.device_type] += 1 # we actually start with 1... wtf iTC + indized[screenshot.language][screenshot.formatted_name] ||= 0 + indized[screenshot.language][screenshot.formatted_name] += 1 # we actually start with 1... wtf iTC - index = indized[screenshot.language][screenshot.device_type] + index = indized[screenshot.language][screenshot.formatted_name] if index > 5 - UI.error("Too many screenshots found for device '#{screenshot.device_type}' in '#{screenshot.language}', skipping this one (#{screenshot.path})") + UI.error("Too many screenshots found for device '#{screenshot.formatted_name}' in '#{screenshot.language}', skipping this one (#{screenshot.path})") next end UI.message("Uploading '#{screenshot.path}'...") v.upload_screenshot!(screenshot.path, index, screenshot.language, - screenshot.device_type) + screenshot.device_type, + screenshot.is_messages?) end # ideally we should only save once, but itunes server can't cope it seems # so we save per language. See issue #349 UI.message("Saving changes") v.save! @@ -75,10 +76,10 @@ Loader.language_folders(path).each do |lng_folder| language = File.basename(lng_folder) # Check to see if we need to traverse multiple platforms or just a single platform - if language == Loader::APPLE_TV_DIR_NAME + if language == Loader::APPLE_TV_DIR_NAME || language == Loader::IMESSAGE_DIR_NAME screenshots.concat(collect_screenshots_for_languages(File.join(path, language))) next end files = Dir.glob(File.join(lng_folder, "*.#{extensions}"), File::FNM_CASEFOLD).sort