Skip to content

Commit

Permalink
[spaceship] add a check in app_version.setup_screenshots to also chec…
Browse files Browse the repository at this point in the history
…k if there is an app_preview already uploaded (#14738)

* add a check in setup_screenshots to also check if there is an app_preview alredy uploaded

* improve commenting
  • Loading branch information
xpy committed Mar 10, 2020
1 parent 5e23f94 commit ad1cf01
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion spaceship/lib/spaceship/tunes/app_version.rb
Expand Up @@ -767,14 +767,19 @@ def container_data_for_language_and_device(data_field, language, device)
end

def setup_screenshots
# Enable Scaling for all screen sizes that don't have at least one screenshot
# Enable Scaling for all screen sizes that don't have at least one screenshot or at least one trailer (app_preview)
# We automatically disable scaling once we upload at least one screenshot
language_details = raw_data_details.each do |current_language|
language_details = (current_language["displayFamilies"] || {})["value"]
(language_details || []).each do |device_language_details|
# Do not enable scaling if a screenshot already exists
next if device_language_details["screenshots"].nil?
next if device_language_details["screenshots"]["value"].count > 0

# Do not enable scaling if a trailer already exists
next if device_language_details["trailers"].nil?
next if device_language_details["trailers"]["value"].count > 0

# The current row includes screenshots for all device types
# so we need to enable scaling for both iOS and watchOS apps
device_language_details["scaled"]["value"] = true if device_language_details["scaled"]
Expand Down

0 comments on commit ad1cf01

Please sign in to comment.