Added shortcut to enable / disable a channel

Added coloring for enabled / available
This commit is contained in:
2019-01-30 23:20:59 +01:00
parent a7bee0f93d
commit 2af2425e2a
2 changed files with 36 additions and 14 deletions

View File

@@ -55,6 +55,18 @@ namespace Tv7Playlist.Controllers
return View(updatedEntry);
}
[HttpGet]
public async Task<IActionResult> ToggleEnabled(Guid? id)
{
var entry = await _playlistContext.PlaylistEntries.FindAsync(id);
if (entry == null) return NotFound();
entry.IsEnabled = !entry.IsEnabled;
await _playlistContext.SaveChangesAsync();
return RedirectToAction("Index", "Home");
}
[HttpGet]
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]