Ejemplo n.º 1
0
        public ShowStatistics CalculateShowStatistics(List <string> libraryIds)
        {
            var shows = _showRepository.GetAllShows(libraryIds, true, true);

            var statistics = new ShowStatistics
            {
                Cards     = CalculateCards(libraryIds),
                TopCards  = CalculateTopCards(libraryIds),
                People    = CalculatePeopleStatistics(libraryIds),
                BarCharts = CalculateBarCharts(shows),
                PieCharts = CalculatePieChars(shows)
            };

            var json = JsonConvert.SerializeObject(statistics);

            _statisticsRepository.AddStatistic(json, DateTime.UtcNow, StatisticType.Show, libraryIds);

            return(statistics);
        }
Ejemplo n.º 2
0
        public MovieStatistics CalculateMovieStatistics(List <string> libraryIds)
        {
            var statistics = new MovieStatistics
            {
                Cards     = CalculateCards(libraryIds),
                TopCards  = CalculateTopCards(libraryIds),
                Charts    = CalculateCharts(libraryIds),
                People    = CalculatePeopleStatistics(libraryIds),
                Shorts    = CalculateShorts(libraryIds),
                NoImdb    = CalculateNoImdbs(libraryIds),
                NoPrimary = CalculateNoPrimary(libraryIds),
            };

            var json = JsonConvert.SerializeObject(statistics);

            _statisticsRepository.AddStatistic(json, DateTime.UtcNow, StatisticType.Movie, libraryIds);

            return(statistics);
        }