Пример #1
0
        public async Task <ActionResult> PlayPrevTrack()
        {
            try
            {
                var tokenGiven = _cookiesManager.GetCookie("TokenGiven", Request);
                var tokenTimes = _cookiesManager.GetCookie("TokenTime", Request);

                if (tokenGiven != null && tokenTimes != null)
                {
                    if (ApiClientConfig.IsIfTokenExpired(Convert.ToDateTime(tokenTimes.Value), tokenGiven.Value))
                    {
                        return(RedirectToAction("LoginUser"));
                    }
                }
                else
                {
                    return(RedirectToAction("LoginUser"));
                }

                client = ApiClientConfig.GetClientInstance(tokenGiven.Value);

                var trySkipPrev = await _playerRepo.SkipPreviousItem(client);

                var modelValues = await GetPrivateUserDefaultModel(client);


                var m = trySkipPrev;
                _model = modelValues;

                return(RedirectToAction("Index"));
            }
            catch (Exception ex)
            {
                ModelState.AddModelError(string.Empty, ex.Message);
                return(View(ERROR_MESSAGE_PATH));
            }
        }