Пример #1
0
        // get current anime season data
        public async Task <bool> GetCurrentSeasonList(int requestRetryDelayInMs)
        {
            SeasonData = null;

            // get current season
            // if there is no response from API wait for a specified time and retry
            while (SeasonData == null)
            {
                try
                {
                    SeasonData = await JikanWrapper.GetSeason();
                }
                catch (System.Net.Http.HttpRequestException)
                {
                    return(false);
                }
                catch (JikanDotNet.Exceptions.JikanRequestException)
                {
                    await TimerService.DelayTask(requestRetryDelayInMs);
                }
                finally
                {
                    await TimerService.DelayTask(requestRetryDelayInMs);
                }
            }
            return(true);
        }