public ActionResult Index() { GameContextModel model = new GameContextModel { AuthedUser = UserManager.FindById(User.Identity.GetUserId()) }; model.MusicTracks = ContentUtility.GetMusicTracksForZone(model.AuthedUser.GameAccount.GetCurrentlySelectedCharacter()?.CurrentLocation?.CurrentZone); model.MusicPlaylists = model.AuthedUser.GameAccount.Config.Playlists; return(View(model)); }
public ActionResult AddPlaylist() { string message = string.Empty; ApplicationUser authedUser = UserManager.FindById(User.Identity.GetUserId()); IPlayerTemplate currentCharacter = authedUser.GameAccount.Characters.FirstOrDefault(chr => chr.Id == authedUser.GameAccount.CurrentlySelectedCharacter); AddEditPlaylistViewModel vModel = new AddEditPlaylistViewModel { AuthedUser = authedUser, ValidSongs = ContentUtility.GetMusicTracksForZone(currentCharacter?.CurrentLocation?.CurrentZone) }; return(View(vModel)); }
public ActionResult EditPlaylist(string name) { string message = string.Empty; ApplicationUser authedUser = UserManager.FindById(User.Identity.GetUserId()); HashSet <IPlaylist> existingPlaylists = authedUser.GameAccount.Config.Playlists; IPlaylist obj = existingPlaylists.FirstOrDefault(list => list.Name.Equals(name)); if (obj == null) { return(RedirectToAction("Playlists", new { Message = "That playlist does not exist." })); } IPlayerTemplate currentCharacter = authedUser.GameAccount.Characters.FirstOrDefault(chr => chr.Id == authedUser.GameAccount.CurrentlySelectedCharacter); AddEditPlaylistViewModel vModel = new AddEditPlaylistViewModel { AuthedUser = UserManager.FindById(User.Identity.GetUserId()), Name = obj.Name, DataObject = obj, ValidSongs = ContentUtility.GetMusicTracksForZone(currentCharacter?.CurrentLocation?.CurrentZone) }; return(View(vModel)); }