diff --git a/MediaFeeder/MediaFeeder/Components/Pages/Home.razor b/MediaFeeder/MediaFeeder/Components/Pages/Home.razor index 7d5e9f4..482f870 100644 --- a/MediaFeeder/MediaFeeder/Components/Pages/Home.razor +++ b/MediaFeeder/MediaFeeder/Components/Pages/Home.razor @@ -95,7 +95,7 @@ diff --git a/MediaFeeder/MediaFeeder/Components/Pages/Video.razor b/MediaFeeder/MediaFeeder/Components/Pages/Video.razor index eebbde1..3844c11 100644 --- a/MediaFeeder/MediaFeeder/Components/Pages/Video.razor +++ b/MediaFeeder/MediaFeeder/Components/Pages/Video.razor @@ -25,9 +25,9 @@ - @VideoObject?.Subscription?.ParentFolder.Name + @VideoObject?.Subscription.ParentFolder?.Name > - @VideoObject?.Subscription?.Name + @VideoObject?.Subscription.Name @@ -79,14 +79,14 @@ @if (Next != null) { - + } - @if (VideoObject != null && Provider != null) + @if (VideoObject != null && Provider != null && PlaybackSession != null) { more.Contains(v.Id)).Sum(static v => v.Duration)); } + else + { + UpNextDuration = TimeSpan.Zero; + } PlaybackSession.Video = VideoObject; PlaybackSession.Provider = Provider.Provider; + PlaybackSession.UpdateEvent += UpdateTimestamp; + UpdateTimestamp(); StateHasChanged(); } + private void UpdateTimestamp() + { + var remaining = VideoObject?.DurationSpan - PlaybackSession?.CurrentPosition; + TotalDuration = UpNextDuration + (remaining ?? TimeSpan.Zero); + + InvokeAsync(StateHasChanged); + } + private async Task MarkWatched() { ArgumentNullException.ThrowIfNull(VideoObject);