From 3517500e030c54b920cef97680072de20744bd3d Mon Sep 17 00:00:00 2001 From: Athul Raj Date: Sat, 15 Jun 2024 19:30:53 +0530 Subject: [PATCH] for sorting not working for next airing episode --- Totoro.Core/Services/TorrentEngine.cs | 5 +++++ Totoro.Core/ViewModels/UserListViewModel.cs | 1 + 2 files changed, 6 insertions(+) diff --git a/Totoro.Core/Services/TorrentEngine.cs b/Totoro.Core/Services/TorrentEngine.cs index 9c08934..4a57b3d 100644 --- a/Totoro.Core/Services/TorrentEngine.cs +++ b/Totoro.Core/Services/TorrentEngine.cs @@ -223,6 +223,11 @@ public async Task GetStream(Torrent torrent, int fileIndex) public async Task SaveState() { + if(_engine is null) + { + return; + } + await _engine.SaveStateAsync(_torrentEngineState); } diff --git a/Totoro.Core/ViewModels/UserListViewModel.cs b/Totoro.Core/ViewModels/UserListViewModel.cs index 3642651..9593ddf 100644 --- a/Totoro.Core/ViewModels/UserListViewModel.cs +++ b/Totoro.Core/ViewModels/UserListViewModel.cs @@ -76,6 +76,7 @@ public UserListViewModel(ITrackingServiceContext trackingService, .Connect() .RefCount() .AutoRefresh(x => x.Tracking) + .AutoRefresh(x => x.NextEpisodeAt, propertyChangeThrottle: TimeSpan.FromMilliseconds(500), scheduler: RxApp.MainThreadScheduler) .Filter(this.WhenAnyValue(x => x.Filter).SelectMany(x => x.WhenAnyPropertyChanged()).Select(x => (Func)x.IsVisible)) .Sort(sort) .Bind(out _anime)