Browse Source

scanning fixes (#1606)

* fix music video fallback metadata

* properly re-scan song metadata
pull/1607/head
Jason Dove 1 year ago committed by GitHub
parent
commit
60b479e330
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 1
      CHANGELOG.md
  2. 9
      ErsatzTV.Core/Metadata/FallbackMetadataProvider.cs
  3. 4925
      ErsatzTV.Infrastructure.MySql/Migrations/20240210124106_Reset_SongMetadata_ExistingLibraries.Designer.cs
  4. 33
      ErsatzTV.Infrastructure.MySql/Migrations/20240210124106_Reset_SongMetadata_ExistingLibraries.cs
  5. 4923
      ErsatzTV.Infrastructure.Sqlite/Migrations/20240210123303_Reset_SongMetadata_ExistingLibraries.Designer.cs
  6. 32
      ErsatzTV.Infrastructure.Sqlite/Migrations/20240210123303_Reset_SongMetadata_ExistingLibraries.cs

1
CHANGELOG.md

@ -28,6 +28,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). @@ -28,6 +28,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Fix bug updating/replacing Jellyfin movies
- A deep scan can be used to fix all movies, otherwise any future updates made to JF movies will correctly sync to ETV
- Automatically generate JWT tokens to allow channel previews of protected streams
- Fix bug applying music video fallback metadata
### Changed
- Log search index updates under scanner category at debug level, to indicate a potential cause for the UI being out of date

9
ErsatzTV.Core/Metadata/FallbackMetadataProvider.cs

@ -255,10 +255,11 @@ public partial class FallbackMetadataProvider : IFallbackMetadataProvider @@ -255,10 +255,11 @@ public partial class FallbackMetadataProvider : IFallbackMetadataProvider
metadata.Title = match.Success
? match.Groups[2].Value.Trim()
: Path.GetFileNameWithoutExtension(fileName);
metadata.Artists = new List<MusicVideoArtist>();
metadata.Genres = new List<Genre>();
metadata.Tags = new List<Tag>();
metadata.Studios = new List<Studio>();
metadata.Artists = [];
metadata.Genres = [];
metadata.Tags = [];
metadata.Studios = [];
metadata.Directors = [];
metadata.DateUpdated = DateTime.UtcNow;
return metadata;

4925
ErsatzTV.Infrastructure.MySql/Migrations/20240210124106_Reset_SongMetadata_ExistingLibraries.Designer.cs generated

File diff suppressed because it is too large Load Diff

33
ErsatzTV.Infrastructure.MySql/Migrations/20240210124106_Reset_SongMetadata_ExistingLibraries.cs

@ -0,0 +1,33 @@ @@ -0,0 +1,33 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace ErsatzTV.Infrastructure.MySql.Migrations
{
/// <inheritdoc />
public partial class Reset_SongMetadata_ExistingLibraries : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.Sql(@"UPDATE SongMetadata SET Artists = '[]', AlbumArtists = '[]', DateUpdated = '0001-01-01 00:00:00'");
migrationBuilder.Sql(
@"UPDATE LibraryPath SET LastScan = '0001-01-01 00:00:00' WHERE Id IN
(SELECT LP.Id FROM LibraryPath LP INNER JOIN Library L on L.Id = LP.LibraryId WHERE MediaKind = 5)");
migrationBuilder.Sql(
@"UPDATE Library SET LastScan = '0001-01-01 00:00:00' WHERE MediaKind = 5");
migrationBuilder.Sql(
@"UPDATE LibraryFolder SET Etag = NULL WHERE Id IN
(SELECT LF.Id FROM LibraryFolder LF INNER JOIN LibraryPath LP on LF.LibraryPathId = LP.Id INNER JOIN Library L on LP.LibraryId = L.Id WHERE MediaKind = 5)");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
}
}
}

4923
ErsatzTV.Infrastructure.Sqlite/Migrations/20240210123303_Reset_SongMetadata_ExistingLibraries.Designer.cs generated

File diff suppressed because it is too large Load Diff

32
ErsatzTV.Infrastructure.Sqlite/Migrations/20240210123303_Reset_SongMetadata_ExistingLibraries.cs

@ -0,0 +1,32 @@ @@ -0,0 +1,32 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace ErsatzTV.Infrastructure.Sqlite.Migrations
{
/// <inheritdoc />
public partial class Reset_SongMetadata_ExistingLibraries : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.Sql(@"UPDATE SongMetadata SET Artists = '[]', AlbumArtists = '[]', DateUpdated = '0001-01-01 00:00:00'");
migrationBuilder.Sql(
@"UPDATE LibraryPath SET LastScan = '0001-01-01 00:00:00' WHERE Id IN
(SELECT LP.Id FROM LibraryPath LP INNER JOIN Library L on L.Id = LP.LibraryId WHERE MediaKind = 5)");
migrationBuilder.Sql(
@"UPDATE Library SET LastScan = '0001-01-01 00:00:00' WHERE MediaKind = 5");
migrationBuilder.Sql(
@"UPDATE LibraryFolder SET Etag = NULL WHERE Id IN
(SELECT LF.Id FROM LibraryFolder LF INNER JOIN LibraryPath LP on LF.LibraryPathId = LP.Id INNER JOIN Library L on LP.LibraryId = L.Id WHERE MediaKind = 5)");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
}
}
}
Loading…
Cancel
Save