Exemple #1
0
        public async Task <IActionResult> Season(int id, string f = null)
        {
            bool forceRefresh = !string.IsNullOrWhiteSpace(f);

            var csvFilename = string.Format(DataFiles.SeasonFormat, id);

            if ((await _scraperService.IsFileOld(csvFilename, 6.0)) || forceRefresh)
            {
                await _scraperService.GetSeriesStandingFile(id, csvFilename);
            }

            var standings = await _scraperService.GetSeasonStandings(id);

            var standingsTable = new FluentTableCreator()
                                 .WithSeasonStandings(standings)
                                 .ForStandings()
                                 .Create();

            return(new ImageResult(standingsTable));
        }