Browse Source

fix remote stream indexing due to missing titles (#2739)

pull/2740/head
Jason Dove 2 days ago committed by GitHub
parent
commit
b2caf8ee8d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 6889
      ErsatzTV.Infrastructure.MySql/Migrations/20251230132754_Fix_RemoteStreamMetadataTitle.Designer.cs
  2. 37
      ErsatzTV.Infrastructure.MySql/Migrations/20251230132754_Fix_RemoteStreamMetadataTitle.cs
  3. 6716
      ErsatzTV.Infrastructure.Sqlite/Migrations/20251230132715_Fix_RemoteStreamMetadataTitle.Designer.cs
  4. 37
      ErsatzTV.Infrastructure.Sqlite/Migrations/20251230132715_Fix_RemoteStreamMetadataTitle.cs
  5. 6
      ErsatzTV.Scanner/Core/Metadata/LocalMetadataProvider.cs

6889
ErsatzTV.Infrastructure.MySql/Migrations/20251230132754_Fix_RemoteStreamMetadataTitle.Designer.cs generated

File diff suppressed because it is too large Load Diff

37
ErsatzTV.Infrastructure.MySql/Migrations/20251230132754_Fix_RemoteStreamMetadataTitle.cs

@ -0,0 +1,37 @@ @@ -0,0 +1,37 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace ErsatzTV.Infrastructure.MySql.Migrations
{
/// <inheritdoc />
public partial class Fix_RemoteStreamMetadataTitle : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
// mark the file as needing an update
migrationBuilder.Sql(
"UPDATE `RemoteStreamMetadata` SET `DateUpdated` = '0001-01-01 00:00:00' WHERE `Title` IS NULL");
// mark the folder as needing an update
migrationBuilder.Sql(
"""
UPDATE `LibraryFolder` SET `Etag` = NULL WHERE `Id` IN (
SELECT `MF`.`LibraryFolderId`
FROM `MediaFile` `MF`
INNER JOIN `MediaVersion` `MV` ON `MV`.`Id` = `MF`.`MediaVersionId`
INNER JOIN `RemoteStream` `RS` ON `RS`.`Id` = `MV`.`RemoteStreamId`
INNER JOIN `RemoteStreamMetadata` `RSM` ON `RSM`.`RemoteStreamId` = `RS`.`Id`
WHERE `RSM`.`Title` IS NULL
)
""");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
}
}
}

6716
ErsatzTV.Infrastructure.Sqlite/Migrations/20251230132715_Fix_RemoteStreamMetadataTitle.Designer.cs generated

File diff suppressed because it is too large Load Diff

37
ErsatzTV.Infrastructure.Sqlite/Migrations/20251230132715_Fix_RemoteStreamMetadataTitle.cs

@ -0,0 +1,37 @@ @@ -0,0 +1,37 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace ErsatzTV.Infrastructure.Sqlite.Migrations
{
/// <inheritdoc />
public partial class Fix_RemoteStreamMetadataTitle : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
// mark the file as needing an update
migrationBuilder.Sql(
"UPDATE `RemoteStreamMetadata` SET `DateUpdated` = '0001-01-01 00:00:00' WHERE `Title` IS NULL");
// mark the folder as needing an update
migrationBuilder.Sql(
"""
UPDATE `LibraryFolder` SET `Etag` = NULL WHERE `Id` IN (
SELECT `MF`.`LibraryFolderId`
FROM `MediaFile` `MF`
INNER JOIN `MediaVersion` `MV` ON `MV`.`Id` = `MF`.`MediaVersionId`
INNER JOIN `RemoteStream` `RS` ON `RS`.`Id` = `MV`.`RemoteStreamId`
INNER JOIN `RemoteStreamMetadata` `RSM` ON `RSM`.`RemoteStreamId` = `RS`.`Id`
WHERE `RSM`.`Title` IS NULL
)
""");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
}
}
}

6
ErsatzTV.Scanner/Core/Metadata/LocalMetadataProvider.cs

@ -533,6 +533,12 @@ public class LocalMetadataProvider : ILocalMetadataProvider @@ -533,6 +533,12 @@ public class LocalMetadataProvider : ILocalMetadataProvider
foreach (RemoteStreamMetadata fallbackMetadata in maybeFallbackMetadata)
{
// title is not required in remote stream definition; use fallback title if missing
if (string.IsNullOrWhiteSpace(result.Title))
{
result.Title = fallbackMetadata.Title;
}
result.OriginalTitle = fallbackMetadata.OriginalTitle;
// preserve folder tagging

Loading…
Cancel
Save