public DownloadManager(PixivSetting setting, DownloaderService downloader, ICustomResolver <PixivClient> clientResolver) { _setting = setting; Downloader = downloader; _settingSubscriber = _setting.MaxDownloadsInParallel.Subscribe( _ => CheckStartNew()); ResumeDownloads(); async void ResumeDownloads() { var client = clientResolver.Resolve(); try { await foreach (int id in downloader.GetResumableDownloads().ConfigureAwait(true)) { var illust = await client.GetIllustDetailAsync(id).ConfigureAwait(true); var vm = GetOrAddDownloadable(illust); vm.SetWaiting(); QueueOne(vm); } } catch { return; } } }
public void Search() { var client = _clientResolver.Resolve(); var users = client.SearchUsersAsync(SearchWord); Users = _viewModelService.CreateAsyncCollection(users); }
public PixivSettingsVM(PixivSetting settings, ICustomResolver <PixivClient> clientResolver) { _settings = settings; _maxDownloadsInParallel = _settings.MaxDownloadsInParallel.Value; _connectionMode = _settings.ConnectionMode.Value; Client = clientResolver.Resolve(); }
public DownloaderService( ICustomResolver <PixivClient> pixivClientResolver, IDbContextFactoryResolver <EHunterDbContext> eHunterContextResolver, IDbContextFactoryResolver <PixivDbContext> pixivDbContextResolver, IStorageSetting storageSetting) { _client = pixivClientResolver.Resolve(); _eHunterContextResolver = eHunterContextResolver; _pixivDbContextResolver = pixivDbContextResolver; _storageSetting = storageSetting; }
public void Refresh() { var client = _clientResolver.Resolve(); Users = _viewModelService.CreateAsyncCollection(client.GetMyFollowingUsersAsync()); }
protected override IAsyncEnumerable <Illust>?LoadIllusts() => _clientResolver.Resolve().GetIllustRankingAsync(SelectedRankingMode, Date.Date);
protected override IAsyncEnumerable <Illust>?LoadIllusts() => _clientResolver.Resolve().GetMyBookmarksAsync(Visibility.Public);
protected override IAsyncEnumerable <Illust>?LoadIllusts() => _clientResolver.Resolve().GetMyFollowingIllustsAsync();