Browse Source

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

pull/2703/head
Jason Dove 4 weeks ago committed by GitHub
parent
commit
7a263ddaed
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 1
      CHANGELOG.md
  2. 6882
      ErsatzTV.Infrastructure.MySql/Migrations/20251204011054_Fix_ChannelSortNumber.Designer.cs
  3. 24
      ErsatzTV.Infrastructure.MySql/Migrations/20251204011054_Fix_ChannelSortNumber.cs
  4. 6709
      ErsatzTV.Infrastructure.Sqlite/Migrations/20251204010944_Fix_ChannelSortNumber.Designer.cs
  5. 24
      ErsatzTV.Infrastructure.Sqlite/Migrations/20251204010944_Fix_ChannelSortNumber.cs

1
CHANGELOG.md

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

6882
ErsatzTV.Infrastructure.MySql/Migrations/20251204011054_Fix_ChannelSortNumber.Designer.cs generated

File diff suppressed because it is too large Load Diff

24
ErsatzTV.Infrastructure.MySql/Migrations/20251204011054_Fix_ChannelSortNumber.cs

@ -0,0 +1,24 @@ @@ -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)
{
}
}
}

6709
ErsatzTV.Infrastructure.Sqlite/Migrations/20251204010944_Fix_ChannelSortNumber.Designer.cs generated

File diff suppressed because it is too large Load Diff

24
ErsatzTV.Infrastructure.Sqlite/Migrations/20251204010944_Fix_ChannelSortNumber.cs

@ -0,0 +1,24 @@ @@ -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)
{
}
}
}
Loading…
Cancel
Save