Updated DB Schema and added new initial create
This commit is contained in:
@@ -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);
|
||||
|
@@ -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}",
|
||||
|
@@ -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();
|
||||
|
||||
|
Reference in New Issue
Block a user