add migration to fix any incorrect channel sort numbers (#2701)

This commit is contained in:
Jason Dove
2025-12-03 19:23:59 -06:00
committed by GitHub
parent 3e0a9aae1e
commit 7a263ddaed
5 changed files with 13639 additions and 1 deletions
-1
View File
@@ -41,7 +41,6 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Fix bug with mirror channels where seemingly random content would be played every ~40 seconds
- Fix chronological sorting for Other Videos that have release date metadata
- Fix playout sorting after using channel number editor
- If your playouts are sorted incorrectly, use the channel number editor to fix (swap two channels, then swap them back)
### Changed
- No longer round framerate to nearest integer when normalizing framerate
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,24 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace ErsatzTV.Infrastructure.MySql.Migrations
{
/// <inheritdoc />
public partial class Fix_ChannelSortNumber : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.Sql(
@"UPDATE `Channel`
SET `SortNumber` = CAST(`Number` AS DECIMAL(10,2))
WHERE `Number` IS NOT NULL AND TRIM(`Number`) != ''");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
}
}
}
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,24 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace ErsatzTV.Infrastructure.Sqlite.Migrations
{
/// <inheritdoc />
public partial class Fix_ChannelSortNumber : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.Sql(
@"UPDATE `Channel`
SET `SortNumber` = CAST(`Number` AS REAL)
WHERE `Number` IS NOT NULL AND TRIM(`Number`) != ''");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
}
}
}