Skip to content

Commit

Permalink
Fix PlaybackSession loading
Browse files Browse the repository at this point in the history
  • Loading branch information
Foxocube committed Jan 5, 2025
1 parent a580a42 commit b46d38e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
14 changes: 7 additions & 7 deletions MediaFeeder/MediaFeeder/PlaybackManager/PlaybackSession.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class PlaybackSession : IDisposable
private string? _quality;
private Provider? _provider;
private string? _state;
public event Action UpdateEvent;
public event Action? UpdateEvent;

internal PlaybackSession(PlaybackSessionManager manager, AuthUser user)
{
Expand All @@ -31,7 +31,7 @@ public Video? Video
set
{
_video = value;
UpdateEvent.Invoke();
UpdateEvent?.Invoke();
}
}

Expand All @@ -41,7 +41,7 @@ public AuthUser User
set
{
_user = value;
UpdateEvent.Invoke();
UpdateEvent?.Invoke();
}
}

Expand All @@ -51,7 +51,7 @@ public TimeSpan? CurrentPosition
set
{
_currentPosition = value;
UpdateEvent.Invoke();
UpdateEvent?.Invoke();
}
}

Expand All @@ -61,7 +61,7 @@ public string? Quality
set
{
_quality = value;
UpdateEvent.Invoke();
UpdateEvent?.Invoke();
}
}

Expand All @@ -71,7 +71,7 @@ public Provider? Provider
set
{
_provider = value;
UpdateEvent.Invoke();
UpdateEvent?.Invoke();
}
}

Expand All @@ -81,7 +81,7 @@ public string? State
set
{
_state = value;
UpdateEvent.Invoke();
UpdateEvent?.Invoke();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@ internal PlaybackSession NewSession(AuthUser user)
var session = new PlaybackSession(this, user);
PlaybackSessions.Add(session);

UpdateEvent.Invoke();
UpdateEvent?.Invoke();

return session;
}

internal void RemoveSession(PlaybackSession playbackSession)
{
PlaybackSessions.Remove(playbackSession);
UpdateEvent.Invoke();
UpdateEvent?.Invoke();
}

public event Action UpdateEvent;
public event Action? UpdateEvent;
}

0 comments on commit b46d38e

Please sign in to comment.