예제 #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        public object Post(RateItem request)
        {
            var currentUser = _userManager.GetUserById(new Guid(request.UserId));
            var currentItem = currentUser.RootFolder.RecursiveChildren.FirstOrDefault(item => item.Id == new Guid(request.Id));

            return(_traktApi.SendItemRating(currentItem, request.Rating, UserHelper.GetTraktUser(request.UserId)).Result);
        }
예제 #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        public object Post(RateItem request)
        {
            _logger.LogInformation("RateItem request received");

            var currentItem = _libraryManager.GetItemById(request.Id);

            if (currentItem == null)
            {
                _logger.LogInformation("currentItem is null");
                return(null);
            }

            return(_traktApi.SendItemRating(currentItem, request.Rating, UserHelper.GetTraktUser(request.UserId)).Result);
        }
예제 #3
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        public object Post(RateItem request)
        {
            _logger.Info("RateItem request received");

            var currentItem = _libraryManager.GetItemById(new Guid(request.Id));

            if (currentItem == null)
            {
                _logger.Info("currentItem is null");
                return null;
            }

            return _traktApi.SendItemRating(currentItem, request.Rating, UserHelper.GetTraktUser(request.UserId)).Result;
            
        }