fix duplicate database migration; fix ssa subtitles (#2216)
This commit is contained in:
@@ -16,6 +16,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
||||
- Fix app startup with MySql/MariaDB
|
||||
- YAML playout: fix `pad_to_next` always running over time
|
||||
- Fix playback with text subtitles when seeking into content, i.e. when first joining a channel
|
||||
- Fix playback with `.ass` and `.ssa` text subtitles
|
||||
|
||||
### Changed
|
||||
- Always tell ffmpeg to stop encoding with a specific duration
|
||||
|
||||
@@ -76,8 +76,8 @@ public abstract class PipelineBuilderBase : IPipelineBuilder
|
||||
{
|
||||
IPipelineStep outputFormat = Path.GetExtension(inputFile).ToLowerInvariant() switch
|
||||
{
|
||||
"ass" or "ssa" => new OutputFormatAss(),
|
||||
"vtt" => new OutputFormatWebVtt(),
|
||||
".ass" or ".ssa" => new OutputFormatAss(),
|
||||
".vtt" => new OutputFormatWebVtt(),
|
||||
_ => new OutputFormatSrt()
|
||||
};
|
||||
|
||||
|
||||
@@ -198,8 +198,8 @@ public class InternalController : ControllerBase
|
||||
{
|
||||
string mimeType = Path.GetExtension(path).ToLowerInvariant() switch
|
||||
{
|
||||
"ass" or "ssa" => "text/x-ssa",
|
||||
"vtt" => "text/vtt",
|
||||
".ass" or ".ssa" => "text/x-ssa",
|
||||
".vtt" => "text/vtt",
|
||||
_ => "application/x-subrip"
|
||||
};
|
||||
|
||||
|
||||
@@ -31,13 +31,23 @@ public class DatabaseMigratorService : BackgroundService
|
||||
using IServiceScope scope = _serviceScopeFactory.CreateScope();
|
||||
await using TvContext dbContext = scope.ServiceProvider.GetRequiredService<TvContext>();
|
||||
|
||||
await dbContext.Database.MigrateAsync("Add_MediaFilePathHash", stoppingToken);
|
||||
List<string> pendingMigrations = await dbContext.Database
|
||||
.GetPendingMigrationsAsync(stoppingToken)
|
||||
.Map(l => l.ToList());
|
||||
|
||||
if (pendingMigrations.Contains("Add_MediaFilePathHash", StringComparer.OrdinalIgnoreCase))
|
||||
{
|
||||
await dbContext.Database.MigrateAsync("Add_MediaFilePathHash", stoppingToken);
|
||||
}
|
||||
|
||||
// this can't be part of a migration, so we have to stop here and run some sql
|
||||
await PopulatePathHashes(dbContext);
|
||||
|
||||
// then continue migrating
|
||||
await dbContext.Database.MigrateAsync(stoppingToken);
|
||||
if (pendingMigrations.Count > 0)
|
||||
{
|
||||
await dbContext.Database.MigrateAsync(stoppingToken);
|
||||
}
|
||||
|
||||
await DbInitializer.Initialize(dbContext, stoppingToken);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user