Example #1
0
        public void Parse_Series_76156_Test()
        {
            var sampleSeriesRaw = SampleDataHelper.GetText(SampleDataHelper.SampleData.Series76156);
            var series          = _seriesParseService.Parse(sampleSeriesRaw);

            Assert.NotNull(series);
            Assert.Equal((uint)76156, series.Id);
            Assert.Equal(Frequency.Wednesday, series.AirDay);
            Assert.Equal(194, series.Episodes.Count);
            Assert.Equal(1, series.Genres.Count);
            Assert.Equal(new TimeSpan(20, 0, 0), series.AirTime);
        }
Example #2
0
        /// <summary>
        /// Get a specific series based on its id and if compression mode is true also all banners and actors;
        /// or null if api response is not well formed
        /// </summary>
        /// <param name="seriesId">Id of the series.</param>
        /// <param name="language">Language of the series.</param>
        /// <param name="compression">Set compression mode to false if you want to have an uncompressed transmission
        /// which increases the bandwith load a lot. Compressed transmission also loads all banners and actors.</param>
        /// <returns>Returns the corresponding series or null if api response is not well formed</returns>
        public async Task <Series> GetSeries(uint seriesId, Language language, bool compression = true)
        {
            if (compression)
            {
                var fullSeriesStream = await _seriesService.RetrieveFull(seriesId, language);

                return(await _seriesParseService.ParseFull(fullSeriesStream, language));
            }

            var seriesRaw = await _seriesService.Retrieve(seriesId, language);

            return(_seriesParseService.Parse(seriesRaw));
        }