Browse Source

fix duplicate database migration; fix ssa subtitles (#2216)

pull/2217/head
Jason Dove 3 weeks ago committed by GitHub
parent
commit
74733a8026
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 1
      CHANGELOG.md
  2. 4
      ErsatzTV.FFmpeg/Pipeline/PipelineBuilderBase.cs
  3. 4
      ErsatzTV/Controllers/InternalController.cs
  4. 10
      ErsatzTV/Services/RunOnce/DatabaseMigratorService.cs

1
CHANGELOG.md

@ -16,6 +16,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). @@ -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

4
ErsatzTV.FFmpeg/Pipeline/PipelineBuilderBase.cs

@ -76,8 +76,8 @@ public abstract class PipelineBuilderBase : IPipelineBuilder @@ -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()
};

4
ErsatzTV/Controllers/InternalController.cs

@ -198,8 +198,8 @@ public class InternalController : ControllerBase @@ -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"
};

10
ErsatzTV/Services/RunOnce/DatabaseMigratorService.cs

@ -31,13 +31,23 @@ public class DatabaseMigratorService : BackgroundService @@ -31,13 +31,23 @@ public class DatabaseMigratorService : BackgroundService
using IServiceScope scope = _serviceScopeFactory.CreateScope();
await using TvContext dbContext = scope.ServiceProvider.GetRequiredService<TvContext>();
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
if (pendingMigrations.Count > 0)
{
await dbContext.Database.MigrateAsync(stoppingToken);
}
await DbInitializer.Initialize(dbContext, stoppingToken);

Loading…
Cancel
Save