Exemple #1
0
        public async Task <TvShowRequestBuilder> GetShowInfo(int id)
        {
            ShowInfo = await TvApi.ShowLookupByTheTvDbId(id);

            Results = await MovieDbApi.SearchTv(ShowInfo.name);

            foreach (TvSearchResult result in Results)
            {
                if (result.Name.Equals(ShowInfo.name, StringComparison.InvariantCultureIgnoreCase))
                {
                    TheMovieDbRecord = result;
                    var showIds = await MovieDbApi.GetTvExternals(result.Id);

                    ShowInfo.externals.imdb = showIds.imdb_id;
                    BackdropPath            = result.BackdropPath;
                    break;
                }
            }

            DateTime.TryParse(ShowInfo.premiered, out var dt);

            FirstAir = dt;

            // For some reason the poster path is always http
            PosterPath = ShowInfo.image?.medium.ToHttpsUrl();

            return(this);
        }
Exemple #2
0
        public async Task <TvShowRequestBuilder> GetShowInfo(int id)
        {
            ShowInfo = await TvApi.ShowLookupByTheTvDbId(id);

            Results = await MovieDbApi.SearchTv(ShowInfo.name);

            foreach (TvSearchResult result in Results)
            {
                if (result.Name == ShowInfo.name)
                {
                    var showIds = await MovieDbApi.GetTvExternals(result.Id);

                    ShowInfo.externals.imdb = showIds.imdb_id;
                    BackdropPath            = result.BackdropPath;
                    break;
                }
            }

            DateTime.TryParse(ShowInfo.premiered, out var dt);

            FirstAir = dt;

            // For some reason the poster path is always http
            PosterPath = ShowInfo.image?.medium.Replace("http:", "https:");

            return(this);
        }