spaceship/lib/spaceship/tunes/tunes_client.rb in fastlane-2.204.3 vs spaceship/lib/spaceship/tunes/tunes_client.rb in fastlane-2.205.0
- old
+ new
@@ -7,11 +7,10 @@
require_relative 'availability'
require_relative 'errors'
require_relative 'iap_subscription_pricing_tier'
require_relative 'pricing_tier'
require_relative 'territory'
-require_relative 'user_detail'
module Spaceship
# rubocop:disable Metrics/ClassLength
class TunesClient < Spaceship::Client
# Legacy support
ITunesConnectError = Tunes::Error
@@ -70,17 +69,17 @@
if t_name.length > 0 && t_id.length.zero? # we prefer IDs over names, they are unique
puts("Looking for App Store Connect Team with name #{t_name}") if Spaceship::Globals.verbose?
teams.each do |t|
- t_id = t['contentProvider']['contentProviderId'].to_s if t['contentProvider']['name'].casecmp(t_name).zero?
+ t_id = t['providerId'].to_s if t['name'].casecmp(t_name).zero?
end
puts("Could not find team with name '#{t_name}', trying to fallback to default team") if t_id.length.zero?
end
- t_id = teams.first['contentProvider']['contentProviderId'].to_s if teams.count == 1
+ t_id = teams.first['providerId'].to_s if teams.count == 1
if t_id.length > 0
puts("Looking for App Store Connect Team with ID #{t_id}") if Spaceship::Globals.verbose?
# actually set the team id here
@@ -948,17 +947,10 @@
r = request(:get, '/WebObjects/iTunesConnect.woa/ra/apps/version/ref')
data = parse_response(r, 'data')
Spaceship::Tunes::AppVersionRef.factory(data)
end
- # Fetches the User Detail information from ITC. This gets called often and almost never changes
- # so we cache it
- # @return [UserDetail] the response
- def user_detail_data
- @_cached_user_detail_data ||= Spaceship::Tunes::UserDetail.factory(user_details_data, self)
- end
-
#####################################################
# @!group CandiateBuilds
#####################################################
def candidate_builds(app_id, version_id)
@@ -1580,12 +1572,17 @@
@content_provider_id = nil
@sso_token_for_image = nil
@sso_token_for_video = nil
end
- # the contentProviderIr found in the UserDetail instance
+ # the contentProviderId found in the user details data
def content_provider_id
- @content_provider_id ||= user_detail_data.content_provider_id
+ return @content_provider_id if @content_provider_id
+
+ provider = user_details_data["provider"]["providerId"]
+ @content_provider_id ||= provider.to_s if provider
+
+ return @content_provider_id
end
# the ssoTokenForImage found in the AppVersionRef instance
def sso_token_for_image
@sso_token_for_image ||= ref_data.sso_token_for_image