Exemple #1
0
 public async Task GetInfoForList(ConcurrentBag <SpecialUserAnimeRate> outContainer)
 {
     try
     {
         await AnimeInfoForListRequest.InfoForList(outContainer).ConfigureAwait(false);
     }
     catch (Exception e)
     {
         ErrorTextEvent?.Invoke(e.Message);
         return;
     }
 }
Exemple #2
0
 public async Task GetAnime(List <UserAnimeRate> testlist, int limitItemsByReq = 50)
 {
     try
     {
         await UserAnimeRequest.GetUserAnime(this.CurrentUser, this.AuthToken, limitItemsByReq, testlist).ConfigureAwait(false);
     }
     catch (TokenExpiredException e)
     {
         RefreshTokenEvent?.Invoke(this.AuthToken);
         ErrorTextEvent?.Invoke("Token expired,refreshing, try again");
         return;
     }
     catch (Exception e)
     {
         ErrorTextEvent?.Invoke(e.Message);
         return;
     }
 }
Exemple #3
0
 public async Task GetAnime(ConcurrentBag <SpecialUserAnimeRate> outContainer, AnimeStatus status = AnimeStatus.None)
 {
     try
     {
         await UserAnimeRequest.GetSpecialAnime(this.CurrentUser, this.AuthToken, outContainer, status).ConfigureAwait(false);
     }
     catch (TokenExpiredException e)
     {
         RefreshTokenEvent?.Invoke(this.AuthToken);
         ErrorTextEvent?.Invoke(e.Message);
         return;
     }
     catch (Exception e)
     {
         ErrorTextEvent?.Invoke(e.Message);
         return;
     }
 }
Exemple #4
0
        private async Task GetCurrentUser()
        {
            try
            {
                var user = await WhoAmIRequest.Whoami(this.AuthToken).ConfigureAwait(false);

                this.CurrentUser = user;
            }
            catch (TokenExpiredException e)
            {
                RefreshTokenEvent?.Invoke(this.AuthToken);
                ErrorTextEvent?.Invoke(e.Message);
            }
            catch (Exception e)
            {
                ErrorTextEvent?.Invoke(e.Message);
            }
        }