示例#1
0
        public void Parse_Update_Day_Test()
        {
            var updateContainerStream = SampleDataHelper.GetStream(SampleDataHelper.SampleData.UpdatesDay);
            var updateContainer       = _updateParseService.Parse(updateContainerStream, Models.Interval.Day);

            Assert.NotNull(updateContainer);
            Assert.Equal(141, updateContainer.BannerCollection.Count);
            Assert.Equal(3468, updateContainer.EpisodeCollection.Count);
            Assert.Equal(591, updateContainer.SeriesCollection.Count);
            Assert.Equal(new DateTime(2014, 9, 8, 22, 0, 0), updateContainer.LastUpdated.Date.ToUniversalTime());
        }
示例#2
0
        /// <summary>
        /// Get all updates since a given interval.
        /// </summary>
        /// <param name="interval">The interval you need to retrieve.
        /// E.g. if you have last updated your data the same day than you should set Interval.Day.
        /// The higher the interval the higher the bandwidth costs are.</param>
        /// <param name="compression">Only set compress mode to false when you know what your are doing.
        /// Disabled compression raises the bandwith costs a lot.</param>
        /// <returns>Returns the update container which consists of all update elements.</returns>
        public async Task <UpdateContainer> GetUpdates(Interval interval, bool compression = true)
        {
            if (compression)
            {
                var updateContainerStream = await _updateService.Retrieve(interval);

                return(_updateParseService.Parse(updateContainerStream, interval));
            }

            var updateContainerRaw = await _updateService.RetrieveUncompressed(interval);

            return(_updateParseService.ParseUncompressed(updateContainerRaw));
        }