mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-08-11 09:13:54 -04:00
throw an exception when a session doesn't support remote control
This commit is contained in:
parent
a53133c002
commit
82ce0e17e9
@ -121,6 +121,11 @@ namespace MediaBrowser.Api
|
|||||||
throw new ResourceNotFoundException(string.Format("Session {0} not found.", request.Id));
|
throw new ResourceNotFoundException(string.Format("Session {0} not found.", request.Id));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!session.SupportsRemoteControl)
|
||||||
|
{
|
||||||
|
throw new ArgumentException(string.Format("Session {0} does not support remote control.", session.Id));
|
||||||
|
}
|
||||||
|
|
||||||
var socket = session.WebSockets.OrderByDescending(i => i.LastActivityDate).FirstOrDefault(i => i.State == WebSocketState.Open);
|
var socket = session.WebSockets.OrderByDescending(i => i.LastActivityDate).FirstOrDefault(i => i.State == WebSocketState.Open);
|
||||||
|
|
||||||
if (socket != null)
|
if (socket != null)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user