private async Task <bool> loadAsync()
        {
            if (_isLoading)
            {
                return(true);
            }
            Debug.WriteLine("loadAsync() called.");
            _isLoading = true;
            try
            {
                var root = nexturl == null ? await Data.TmpData.CurrentAuth.Tokens.GetUserFavoriteWorksAsync(Data.TmpData.CurrentAuth.Authorize.User.Id.Value) : await Data.TmpData.CurrentAuth.Tokens.AccessNewApiAsync <Illusts>(nexturl);

                nexturl = root.next_url ?? string.Empty;
                foreach (var one in root.illusts)
                {
                    if (!list.Contains(one, Data.WorkEqualityComparer.Default))
                    {
                        list.Add(one);
                    }
                }
                _isLoading = false;
                return(true);
            }
            catch
            {
                _isLoading = false;
                return(false);
            }
        }
Ejemplo n.º 2
0
 private async Task <bool> loadAsync()
 {
     if (_isLoading)
     {
         return(true);
     }
     Debug.WriteLine("loadAsync() called.");
     _isLoading = true;
     try
     {
         foreach (var one in await Data.TmpData.CurrentAuth.Tokens.SearchWorksAsync(_query, nowpage, 30, "text", "all", "desc", _bypopular ? "popular" : "date"))
         {
             if (!list.Contains(one, Data.WorkEqualityComparer.Default))
             {
                 list.Add(one);
             }
         }
         nowpage++;
         _isLoading = false;
         return(true);
     }
     catch
     {
         _isLoading = false;
         return(false);
     }
 }
Ejemplo n.º 3
0
 private async Task <bool> loadAsync()
 {
     if (_isLoading)
     {
         return(true);
     }
     Debug.WriteLine("loadAsync() called.");
     _isLoading = true;
     try
     {
         foreach (var one in await Data.TmpData.CurrentAuth.Tokens.GetLatestWorksAsync(nowpage))
         {
             if (!list.Contains(one, Data.WorkEqualityComparer.Default))
             {
                 list.Add(one);
             }
         }
         nowpage++;
         _isLoading = false;
         return(true);
     }
     catch
     {
         _isLoading = false;
         return(false);
     }
 }
Ejemplo n.º 4
0
 private async Task <bool> loadAsync()
 {
     if (_isLoading)
     {
         return(true);
     }
     Debug.WriteLine("loadAsync() called.");
     _isLoading = true;
     try
     {
         foreach (var rone in (await Data.TmpData.CurrentAuth.Tokens.GetRankingAllAsync("daily", nowpage, 30))[0].Works)
         {
             var one = rone.Work;
             if (!list.Contains(one, Data.WorkEqualityComparer.Default))
             {
                 list.Add(one);
             }
         }
         nowpage++;
         _isLoading = false;
         return(true);
     }
     catch
     {
         _isLoading = false;
         return(false);
     }
 }