Esempio n. 1
0
        public ActionResult Play(
            [FromRoute, Required] string?sessionId,
            [FromQuery] Guid[] itemIds,
            [FromQuery] long?startPositionTicks,
            [FromQuery] PlayCommand playCommand,
            [FromBody, Required] PlayRequest playRequest)
        {
            if (playRequest == null)
            {
                throw new ArgumentException("Request Body may not be null");
            }

            playRequest.ItemIds            = itemIds;
            playRequest.StartPositionTicks = startPositionTicks;
            playRequest.PlayCommand        = playCommand;

            _sessionManager.SendPlayCommand(
                RequestHelpers.GetSession(_sessionManager, _authContext, Request).Id,
                sessionId,
                playRequest,
                CancellationToken.None);

            return(NoContent());
        }
Esempio n. 2
0
        public ActionResult <IEnumerable <GroupInfoView> > SyncPlayGetGroups([FromQuery] Guid?filterItemId)
        {
            var currentSession = RequestHelpers.GetSession(_sessionManager, _authorizationContext, Request);

            return(Ok(_syncPlayManager.ListGroups(currentSession, filterItemId.HasValue ? filterItemId.Value : Guid.Empty)));
        }