Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }