spaceship/lib/spaceship/connect_api/models/app_preview.rb in fastlane-2.150.1 vs spaceship/lib/spaceship/connect_api/models/app_preview.rb in fastlane-2.150.2
- old
+ new
@@ -52,11 +52,11 @@
# Creates an AppPreview in an AppPreviewSet
# Setting the optional frame_time_code will force polling until video is done processing
# @param app_preview_set_id The AppPreviewSet id
# @param path The path of the file
# @param frame_time_code The time code for the preview still frame (ex: "00:00:07:01")
- def self.create(app_preview_set_id: nil, path: nil, frame_time_code: nil)
+ def self.create(app_preview_set_id: nil, path: nil, wait_for_processing: true, frame_time_code: nil)
require 'faraday'
filename = File.basename(path)
filesize = File.size(path)
bytes = File.binread(path)
@@ -93,10 +93,11 @@
preview = Spaceship::ConnectAPI::AppPreview.get(app_preview_id: preview.id)
raise error unless preview.complete?
end
# Poll for video processing completion to set still frame time
- unless frame_time_code.nil?
+ wait_for_processing = true unless frame_time_code.nil?
+ if wait_for_processing
loop do
unless preview.video_url.nil?
puts("Preview processing complete!") if Spaceship::Globals.verbose?
preview = preview.update(attributes: {
previewFrameTimeCode: frame_time_code