lib/sportradar/api/images.rb in sportradar-api-0.13.25 vs lib/sportradar/api/images.rb in sportradar-api-0.13.26

- old
+ new

@@ -21,11 +21,12 @@ if year != Date.today.year response = get request_url("#{league}/#{image_type}/players/#{year}/manifest") else response = get request_url("#{league}/#{image_type}/players/manifest") end - elsif nfl_premium || usat_premium || sport == 'ncaafb' + elsif nfl_premium || usat_premium || sport == 'ncaafb' || sport == 'nba' + year = Date.today.month < 8 ? Date.today.year - 1 : Date.today response = get request_url("#{image_type}/players/#{year}/manifest") else response = get request_url("players/#{image_type}/manifests/all_assets") end if response.success? && response["assetlist"] @@ -134,18 +135,20 @@ def provider if nfl_premium 'ap_premium' elsif usat_premium 'usat_premium' + elsif sport == 'nba' + 'getty_premium' else 'usat' # REUTERS IS JUST FOR SOCCER sport == 'mlb' ? 'usat' : 'reuters' end end def version - if uses_v3_api? || nfl_premium || usat_premium + if uses_v3_api? || nfl_premium || usat_premium || sport == 'nba' 3 elsif uses_v2_api? Sportradar::Api.version('images') end end @@ -173,10 +176,10 @@ def v2_api_sports ['golf', 'nascar', 'nba', 'nfl', 'nhl', 'ncaamb', 'mls'] end def v3_api_sports - ['mlb', 'soccer', 'cricket', 'f1', 'rugby', 'tennis', 'ncaafb', ] + ['mlb', 'soccer', 'cricket', 'f1', 'rugby', 'tennis', 'ncaafb', 'nba' ] end def soccer_leagues ['bundesliga', 'epl', 'serie-a', 'la-liga', 'ligue-1'] end