Browse Source

fix album_artist metadata (#674)

pull/675/head
Jason Dove 4 years ago committed by GitHub
parent
commit
a3260b2316
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      CHANGELOG.md
  2. 8
      ErsatzTV.Core/FFmpeg/SongVideoGenerator.cs
  3. 2
      ErsatzTV.Core/Metadata/LocalStatisticsProvider.cs
  4. 1
      ErsatzTV.Infrastructure/Migrations/20220305002236_Reset_SongMetadataAlbumArtist.cs
  5. 3886
      ErsatzTV.Infrastructure/Migrations/20220305024940_Reset_SongMetadataAlbumArtistAgain.Designer.cs
  6. 30
      ErsatzTV.Infrastructure/Migrations/20220305024940_Reset_SongMetadataAlbumArtistAgain.cs
  7. 21
      ErsatzTV/Pages/Search.razor

2
CHANGELOG.md

@ -9,11 +9,13 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). @@ -9,11 +9,13 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Fix watermark on scaled and/or padded video with NVIDIA acceleration
- Fix playback of interlaced mpeg2video content with NVIDIA acceleration
- Fix playback of all interlaced content with QSV acceleration
- Fix adding songs to collections from search results page
### Added
- Add automated error reporting via Bugsnag
- This can be disabled by editing the `appsettings.json` file or by setting the `Bugsnag:Enable` environment variable to `false`
- Add `album_artist` to song metadata and to search index
- Display `album_artist` on some song videos when it's different than the `artist`
### Changed
- Framerate normalization will never normalize framerate below 24fps

8
ErsatzTV.Core/FFmpeg/SongVideoGenerator.cs

@ -102,6 +102,14 @@ public class SongVideoGenerator : ISongVideoGenerator @@ -102,6 +102,14 @@ public class SongVideoGenerator : ISongVideoGenerator
sb.Append($"\\N\"{metadata.Title}\"");
}
if (!string.IsNullOrWhiteSpace(metadata.AlbumArtist) && !string.Equals(
metadata.Artist,
metadata.AlbumArtist,
StringComparison.Ordinal))
{
sb.Append($"\\N{metadata.AlbumArtist}");
}
if (!string.IsNullOrWhiteSpace(metadata.Album))
{
sb.Append($"\\N{metadata.Album}");

2
ErsatzTV.Core/Metadata/LocalStatisticsProvider.cs

@ -377,7 +377,7 @@ public class LocalStatisticsProvider : ILocalStatisticsProvider @@ -377,7 +377,7 @@ public class LocalStatisticsProvider : ILocalStatisticsProvider
public record FFprobeFormatTags(
string title,
string artist,
[property: JsonProperty(PropertyName = "album artist")]
[property: JsonProperty(PropertyName = "album_artist")]
string albumArtist,
string album,
string track,

1
ErsatzTV.Infrastructure/Migrations/20220305002236_Reset_SongMetadataAlbumArtist.cs

@ -25,7 +25,6 @@ namespace ErsatzTV.Infrastructure.Migrations @@ -25,7 +25,6 @@ namespace ErsatzTV.Infrastructure.Migrations
protected override void Down(MigrationBuilder migrationBuilder)
{
}
}
}

3886
ErsatzTV.Infrastructure/Migrations/20220305024940_Reset_SongMetadataAlbumArtistAgain.Designer.cs generated

File diff suppressed because it is too large Load Diff

30
ErsatzTV.Infrastructure/Migrations/20220305024940_Reset_SongMetadataAlbumArtistAgain.cs

@ -0,0 +1,30 @@ @@ -0,0 +1,30 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace ErsatzTV.Infrastructure.Migrations
{
public partial class Reset_SongMetadataAlbumArtistAgain : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
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 SongMetadata SET DateUpdated = '0001-01-01 00:00:00'");
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)");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
}
}
}

21
ErsatzTV/Pages/Search.razor

@ -486,6 +486,27 @@ @@ -486,6 +486,27 @@
Right: _ => Snackbar.Add($"Added {otherVideo.Title} to collection {collection.Name}", Severity.Success));
}
}
if (card is SongCardViewModel song)
{
var parameters = new DialogParameters { { "EntityType", "song" }, { "EntityName", song.Title } };
var options = new DialogOptions { CloseButton = true, MaxWidth = MaxWidth.ExtraSmall };
IDialogReference dialog = Dialog.Show<AddToCollectionDialog>("Add To Collection", parameters, options);
DialogResult result = await dialog.Result;
if (!result.Cancelled && result.Data is MediaCollectionViewModel collection)
{
var request = new AddSongToCollection(collection.Id, song.SongId);
Either<BaseError, Unit> addResult = await Mediator.Send(request, CancellationToken);
addResult.Match(
Left: error =>
{
Snackbar.Add($"Unexpected error adding song to collection: {error.Value}");
Logger.LogError("Unexpected error adding song to collection: {Error}", error.Value);
},
Right: _ => Snackbar.Add($"Added {song.Title} to collection {collection.Name}", Severity.Success));
}
}
}
private string GetMoviesLink()

Loading…
Cancel
Save