static void Main(string[] args) { //http://www.omdbapi.com/apikey.aspx var api = new OmdbApiClient(""); var goodAnswer = api.GetItemByID("tt0111161"); Debug.Assert(goodAnswer != null); Console.WriteLine("OK:" + goodAnswer.Title); try { var incorrectimdbId = api.GetItemByID("tt111161"); } catch (OmdbAPiException e) { Console.WriteLine(e.Message); } var noData = api.GetItemByID("tt9999999"); Debug.Assert(noData == null); Console.ReadKey(); }
public static void Main(string[] args) { BuildLogger(); BuildConfig(); BuildMapper(); BuildTitleService(); var parser = new OmdbApiClient(_config, _mapper); var omdbGrabber = new OmdbGrabber(parser, _titleService, _log); for (int i = 0; i < 3; i++) { omdbGrabber.GrabByImdbIds(args.Length > 0 ? args : ImdbIds.AmericanDadAllEpisodes); } Console.WriteLine("Done!"); Console.ReadLine(); }
private OmdbApiClient GetOmdbApiClient() { return(_omdbApiClient ?? (_omdbApiClient = new OmdbApiClient(_omdbApiSettings.BaseUrl, _omdbApiSettings.Key))); }
public OmdbGrabber(OmdbApiClient apiParser, ITitleService titleService, ILog log) { _apiParser = apiParser; _titleService = titleService; _log = log; }
public MovieController(OmdbApiClient omdbApiClient) { this.omdbApiClient = omdbApiClient ?? throw new ArgumentNullException(nameof(omdbApiClient)); }