fix interlaced check again (#2623)

* fix interlaced check again

* add interlaced ratio to media item info
This commit is contained in:
Jason Dove
2025-11-10 09:14:40 -06:00
committed by GitHub
parent bc400de94c
commit d93c404607
8 changed files with 13633 additions and 1 deletions

View File

@@ -15,6 +15,7 @@ public record MediaItemInfo(
string DisplayAspectRatio,
string RFrameRate,
VideoScanKind VideoScanKind,
double? InterlacedRatio,
int Width,
int Height,
List<MediaItemInfoStream> Streams,

View File

@@ -147,6 +147,7 @@ public class GetMediaItemInfoHandler : IRequestHandler<GetMediaItemInfo, Either<
version.DisplayAspectRatio,
version.RFrameRate,
version.VideoScanKind,
version.InterlacedRatio,
version.Width,
version.Height,
allStreams,

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,21 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace ErsatzTV.Infrastructure.MySql.Migrations
{
/// <inheritdoc />
public partial class Reset_InterlacedRatioAgain : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.Sql("UPDATE MediaVersion SET InterlacedRatio = null;");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,21 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace ErsatzTV.Infrastructure.Sqlite.Migrations
{
/// <inheritdoc />
public partial class Reset_InterlacedRatioAgain : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.Sql("UPDATE MediaVersion SET InterlacedRatio = null;");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
}
}
}

View File

@@ -166,7 +166,7 @@ public partial class LocalStatisticsProvider : ILocalStatisticsProvider
return 0;
}
return (double)stats.TotalInterlacedFrames / stats.TotalInterlacedFrames;
return (double)stats.TotalInterlacedFrames / stats.TotalFrames;
}
}
catch (Exception ex)

21
scripts/add-migration.sh Executable file
View File

@@ -0,0 +1,21 @@
#! /usr/bin/env bash
if [[ $# -eq 0 ]] ; then
echo 'Please specify a unique migration name'
exit 1
fi
ROOT="$(git rev-parse --show-toplevel)"
cd "$ROOT/ErsatzTV.Infrastructure" || exit
dotnet ef migrations add $1 \
--context TvContext \
--startup-project "$ROOT/ErsatzTV" \
--project "$ROOT/ErsatzTV.Infrastructure.Sqlite" \
-- --provider Sqlite && \
dotnet ef migrations add $1 \
--context TvContext \
--startup-project "$ROOT/ErsatzTV" \
--project "$ROOT/ErsatzTV.Infrastructure.MySql" \
-- --provider MySql