public DownloadStatusService(IrcAnimeService.IrcAnimeServiceClient client) { this.client = client; this.statusThread = new Thread(new ThreadStart(UpdateStatus)); this.statusThread.IsBackground = true; this.statusThread.Start(); }
public async Task LoadAsync(Channel channel, ISettingsFactory settingsFactory) { client = new IrcAnimeService.IrcAnimeServiceClient(channel); var settingsService = settingsFactory.Get(this.Name); var packService = new PackService(); var downloadService = new DownloadService(client, settingsService); var downloadStatusService = new DownloadStatusService(client); var downloadContextService = new DownloadContextService(packService, downloadStatusService, settingsService, downloadService, client); ViewModel = new IrcAnimeViewModel(new SearchViewModel(client, downloadContextService, downloadService), new DownloadsViewModel(client, downloadContextService, settingsService), new SettingsViewModel(settingsService), new SchedulingViewModel()); await Task.CompletedTask; }
public DownloadContextService(PackService packService, DownloadStatusService downloadStatusService, IModuleSettingsService moduleSettingsService, DownloadService downloadService, IrcAnimeService.IrcAnimeServiceClient client) { this.packService = packService; this.downloadStatusService = downloadStatusService; this.moduleSettingsService = moduleSettingsService; this.downloadService = downloadService; this.client = client; this.downloadStatusService.OnStatusUpdate += async() => await this.DownloadStatusService_OnStatusUpdate(); this.downloadService.OnBytesDownloaded += this.DownloadService_OnBytesDownloaded; this.downloadService.OnDownloadFinished += this.DownloadService_OnDownloadFinished; }
private static void Main(string[] args) { var filename = "[HorribleSubs] Sword Art Online - Alicization - War of Underworld - 16 [1080p].mkv"; var channel = new Channel("127.0.0.1:31564", ChannelCredentials.Insecure); var client = new IrcAnimeService.IrcAnimeServiceClient(channel); //var results = client.Search(new SearchRequest() //{ // SearchTerm = "Sword Art Online", //}); //foreach (var result in results.SearchResults) //{ //Console.WriteLine($"Botname:{result.BotName};Filename:{result.FileName};Filesize:{result.FileSize};PackageNumber:{result.PackageNumber}"); //} //client.Download(new DownloadRequest() //{ // DownloadRequest_ = new DownloadRequest.Types.Request() // { // BotName = "CR-ARUTHA|NEW", // FileName = filename, // PackageNumber = 10734 // } //}); //while (true) //{ // var downloadStatus = client.DownloadStatus(new DownloadStatusRequest()); // foreach (var status in downloadStatus.Status.Where(x => !x.Downloaded)) // { // Console.WriteLine($"{status.Filename}: {((double)status.DownloadedBytes / (double)status.Filesize) * 100}%"); // } // Thread.Sleep(3000); //} client.File(new FileRequest() { FileName = "[HorribleSubs] Sword Art Online - Alicization - War of Underworld - 17 [1080p].mkv", }); }
public DownloadService(IrcAnimeService.IrcAnimeServiceClient client, IModuleSettingsService settingsService) { this.client = client; this.settingsService = settingsService; }