lib/sportradar/api/images.rb in sportradar-api-0.11.54 vs lib/sportradar/api/images.rb in sportradar-api-0.11.55

- old
+ new

@@ -1,5 +1,6 @@ +# TODO - rework this to v3 of API only module Sportradar module Api class Images < Request attr_accessor :sport, :league, :access_level, :nfl_premium, :usat_premium, :event_id, :date, :live_image_request def initialize( sport, access_level: 't', league: nil, nfl_premium: false, usat_premium: false, event_id: nil, date: nil ) @@ -20,11 +21,11 @@ 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 + elsif nfl_premium || usat_premium || sport == 'ncaafb' 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"] @@ -135,14 +136,13 @@ def provider if nfl_premium 'ap_premium' elsif usat_premium 'usat_premium' - elsif uses_v2_api? + else 'usat' - elsif uses_v3_api? - sport == 'mlb' ? 'usat' : 'reuters' + # REUTERS IS JUST FOR SOCCER sport == 'mlb' ? 'usat' : 'reuters' end end def version if uses_v3_api? || nfl_premium || usat_premium @@ -171,14 +171,14 @@ def allowed_sports v2_api_sports + v3_api_sports end def v2_api_sports - ['golf', 'nascar', 'nba', 'nfl', 'nhl', 'ncaafb', 'ncaamb', 'mls'] + ['golf', 'nascar', 'nba', 'nfl', 'nhl', 'ncaamb', 'mls'] end def v3_api_sports - ['mlb', 'soccer', 'cricket', 'f1', 'rugby', 'tennis'] + ['mlb', 'soccer', 'cricket', 'f1', 'rugby', 'tennis', 'ncaafb', ] end def soccer_leagues ['bundesliga', 'epl', 'serie-a', 'la-liga', 'ligue-1'] end