Updated DB Schema and added new initial create

This commit is contained in:
2019-01-30 22:49:01 +01:00
parent 273b960979
commit 15e2a650b9
14 changed files with 188 additions and 84 deletions

View File

@@ -26,7 +26,7 @@ namespace Tv7Playlist.Controllers
[HttpGet]
public async Task<IActionResult> Index()
{
var playlistEntries = await _playlistContext.PlaylistEntries.AsNoTracking().OrderBy(e => e.TrackNumber).ToListAsync();
var playlistEntries = await _playlistContext.PlaylistEntries.AsNoTracking().OrderBy(e => e.Position).ToListAsync();
var model = new HomeModel(playlistEntries);
return View(model);

View File

@@ -25,11 +25,30 @@ namespace Tv7Playlist.Controllers
_appConfig = appConfig ?? throw new ArgumentNullException(nameof(appConfig));
}
[HttpGet]
[Route("without-proxy")]
public async Task<IActionResult> GetPlaylistWithoutProxy()
{
return await GetPlaylistInternal(false);
}
[HttpGet]
[Route("")]
public async Task<IActionResult> GetPlaylist()
{
var playlistStream = await _playlistBuilder.GeneratePlaylistAsync();
return await GetPlaylistInternal(true);
}
[HttpGet]
[Route("with-proxy")]
public async Task<IActionResult> GetPlaylistWithProxy()
{
return await GetPlaylistInternal(true);
}
private async Task<IActionResult> GetPlaylistInternal(bool useProxy)
{
var playlistStream = await _playlistBuilder.GeneratePlaylistAsync(useProxy);
var downloadFileName = GetDownloadFileName();
_logger.LogInformation(LoggingEvents.Playlist, "Sending updated playlist {filename}",

View File

@@ -43,9 +43,11 @@ namespace Tv7Playlist.Controllers
if (entry == null) return NotFound();
entry.Position = updatedEntry.Position;
entry.TrackNumberOverride = updatedEntry.TrackNumberOverride;
entry.NameOverride = updatedEntry.NameOverride;
entry.ChannelNumberExport = updatedEntry.ChannelNumberExport;
entry.EpgMatchName = updatedEntry.EpgMatchName;
entry.IsEnabled = updatedEntry.IsEnabled;
entry.LogoUrl = updatedEntry.LogoUrl;
entry.Modified = DateTime.Now;
await _playlistContext.SaveChangesAsync();