From d43509ffdaa27ebf4f2accb2150447a33c0f25d6 Mon Sep 17 00:00:00 2001 From: J2ghz Date: Thu, 26 Jul 2018 23:56:13 +0200 Subject: [PATCH] refactor, remove useless exception catch --- src/ModSink.Common/Client/ClientService.cs | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/ModSink.Common/Client/ClientService.cs b/src/ModSink.Common/Client/ClientService.cs index b740cefc..8d9e7189 100644 --- a/src/ModSink.Common/Client/ClientService.cs +++ b/src/ModSink.Common/Client/ClientService.cs @@ -2,7 +2,6 @@ using System.Collections.Generic; using System.IO; using System.Linq; -using System.Reactive.Concurrency; using System.Reactive.Disposables; using System.Reactive.Linq; using System.Runtime.Serialization; @@ -15,8 +14,6 @@ using ModSink.Common.Models.Client; using ModSink.Common.Models.Group; using ModSink.Common.Models.Repo; -using Polly; -using ReactiveUI; namespace ModSink.Common.Client { @@ -45,18 +42,18 @@ public ClientService(IDownloader downloader, IFormatter serializationFormatter, .TransformAsync(Load) .OnItemUpdated((repo, _) => LogTo.Information("Repo from {url} has been loaded", repo.BaseUri)) .AsObservableCache() - .DisposeWithThrowExceptions(disposable); + .DisposeWith(disposable); OnlineFiles = Repos.Connect() .TransformMany( repo => repo.Files.Select(kvp => new OnlineFile(kvp.Key, new Uri(repo.BaseUri, kvp.Value))), of => of.FileSignature) .AsObservableCache() - .DisposeWithThrowExceptions(disposable); + .DisposeWith(disposable); Modpacks = Repos.Connect() .RemoveKey() .TransformMany(r => r.Modpacks) .AsObservableList() - .DisposeWithThrowExceptions(disposable); + .DisposeWith(disposable); QueuedDownloads = Modpacks.Connect() .AutoRefresh(m => m.Selected) .Filter(m => m.Selected) @@ -78,7 +75,7 @@ public ClientService(IDownloader downloader, IFormatter serializationFormatter, .InnerJoin(OnlineFiles.Connect(), of => of.FileSignature, (fs, of) => new QueuedDownload(fs, of.Uri)) .AsObservableCache() - .DisposeWithThrowExceptions(disposable); + .DisposeWith(disposable); ActiveDownloads = QueuedDownloads.Connect() .Sort(Comparer.Create((_, __) => 0)) .Top(5) @@ -98,7 +95,7 @@ public ClientService(IDownloader downloader, IFormatter serializationFormatter, }) .LogVerbose("activeDownloads") .AsObservableCache() - .DisposeWithThrowExceptions(disposable); + .DisposeWith(disposable); } public IObservableList Modpacks { get; }