public async Task <ActionResult> AddToQueue(string itemUri) { 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 addToQueue = await _playerRepo.AddToQueue (client, new PlayerAddToQueueRequest(itemUri)); var modelValues = await GetPrivateUserDefaultModel(client); _model = modelValues; return(RedirectToAction("Index")); } catch (Exception ex) { ModelState.AddModelError(string.Empty, ex.Message); return(View(ERROR_MESSAGE_PATH)); } }