/// <summary>
 /// Posts the specified request.
 /// </summary>
 /// <param name="request">The request.</param>
 public void Delete(OnPlaybackStopped request)
 {
     Post(new ReportPlaybackStopped
     {
         ItemId        = request.Id,
         PositionTicks = request.PositionTicks,
         MediaSourceId = request.MediaSourceId
     });
 }
        /// <summary>
        /// Posts the specified request.
        /// </summary>
        /// <param name="request">The request.</param>
        public void Delete(OnPlaybackStopped request)
        {
            var user = _userManager.GetUserById(request.UserId);

            var item = DtoBuilder.GetItemByClientId(request.Id, _userManager, _libraryManager, user.Id);

            var task = _sessionManager.OnPlaybackStopped(item, request.PositionTicks, GetSession().Id);

            Task.WaitAll(task);
        }
Example #3
0
        /// <summary>
        /// Posts the specified request.
        /// </summary>
        /// <param name="request">The request.</param>
        public void Delete(OnPlaybackStopped request)
        {
            var user = _userManager.GetUserById(request.UserId);

            var item = _dtoService.GetItemByDtoId(request.Id, user.Id);

            var task = _sessionManager.OnPlaybackStopped(item, request.PositionTicks, GetSession().Id);

            Task.WaitAll(task);
        }
Example #4
0
 /// <summary>
 /// Posts the specified request.
 /// </summary>
 /// <param name="request">The request.</param>
 public Task Delete(OnPlaybackStopped request)
 {
     return Post(new ReportPlaybackStopped
     {
         ItemId = new Guid(request.Id),
         PositionTicks = request.PositionTicks,
         MediaSourceId = request.MediaSourceId,
         PlaySessionId = request.PlaySessionId,
         LiveStreamId = request.LiveStreamId,
         NextMediaType = request.NextMediaType
     });
 }
        /// <summary>
        /// Posts the specified request.
        /// </summary>
        /// <param name="request">The request.</param>
        public void Delete(OnPlaybackStopped request)
        {
            var user = _userManager.GetUserById(request.UserId);

            var item = DtoBuilder.GetItemByClientId(request.Id, _userManager, _libraryManager, user.Id);

            var auth = RequestFilterAttribute.GetAuthorization(RequestContext);

            if (auth != null)
            {
                var task = _userManager.OnPlaybackStopped(user, item, request.PositionTicks, auth["Client"], auth["DeviceId"], auth["Device"] ?? string.Empty);

                Task.WaitAll(task);
            }
        }
Example #6
0
        /// <summary>
        /// Posts the specified request.
        /// </summary>
        /// <param name="request">The request.</param>
        public void Delete(OnPlaybackStopped request)
        {
            var user = _userManager.GetUserById(request.UserId);

            var item = _dtoService.GetItemByDtoId(request.Id, user.Id);

            var session = GetSession();

            var info = new PlaybackStopInfo
            {
                Item          = item,
                PositionTicks = request.PositionTicks,
                SessionId     = session.Id
            };

            var task = _sessionManager.OnPlaybackStopped(info);

            Task.WaitAll(task);
        }