Exemplo n.º 1
0
        public async Task <IActionResult> StartTvMoviesUpdating()
        {
            await _updateRepository.TvMoviesUpdateAsync(true);

            /* var TvMoviesInterval = 24;
             * movieTimer.Interval = TimeSpan.FromHours(TvMoviesInterval).TotalMilliseconds;
             * movieTimer.Elapsed +=  MoviesUpdate;
             *
             * movieTimer.Enabled = true;
             * movieTimer.Start(); */

            return(Json("Movies updated"));
        }
Exemplo n.º 2
0
        public async Task <IActionResult> TakeTopYT()
        {
            var top = await _actuallRepository.GetAllActuallYTAsync();

            var topImg = await _actuallRepository.GetAllActuallIMGAsync();


            if (top.Where(x => x.isSong).Count() == 0)
            {
                await _updateRepository.SongsUpdateAsync();
            }

            if (top.Where(x => !x.isSong).Count() == 0)
            {
                await _updateRepository.TvMoviesUpdateAsync(true);
            }


            if (top.Count > 0)
            {
                top.AddRange(topImg);
            }


            top = top.Where(x => !x.id.Contains("Error")).ToList();

            top.Shuffle();
            return(Json(top));
        }