mirror of
https://github.com/BinaryAlley/Nemera.git
synced 2026-12-03 05:11:10 +00:00
Captures the audio container of the music tracks
Adds a Container to the audio metadata, captured with TagLibSharp from the concrete type of the parsed file during the music library scan and stored on the track through a new column and an EF migration. The container is refreshed when a file changes, survives track and artist edits and provider enrichment, and is exposed read-only in the track responses, never settable through a request. Extracts the container resolution into a testable resolver used by the scan pipeline and the ID3 plugin, refuses to read a file that is itself a reparse point during extraction, and updates the endpoint summaries, the API and domain documentation, and the tests.
This commit is contained in:
1 parent
4ffa81fffe
commit
f29f89f31f
60 files changed
+4483
-68
No files matched your search
+3
@@ -98,6 +98,9 @@ public class MusicLibraryScanItemMetadataConfiguration : IEntityTypeConfiguratio
|
||||
.HasColumnOrder(29);
|
||||
builder.PrimitiveCollection(musicMetadata => musicMetadata.Moods)
|
||||
.HasColumnOrder(30);
|
||||
builder.Property(musicMetadata => musicMetadata.Container)
|
||||
.HasMaxLength(50)
|
||||
.HasColumnOrder(31);
|
||||
|
||||
builder.HasIndex(musicMetadata => new { musicMetadata.LibraryScanId, musicMetadata.Path })
|
||||
.IsUnique(); // the metadata of the same physical file cannot be staged twice during the same scan
|
||||
|
||||
@@ -152,6 +152,9 @@ public class TrackConfiguration : IEntityTypeConfiguration<TrackEntity>
|
||||
builder.Property(track => track.ReplayGainAlbumPeak)
|
||||
.HasColumnType("decimal(8,6)")
|
||||
.HasColumnOrder(48);
|
||||
builder.Property(track => track.Container)
|
||||
.HasMaxLength(50)
|
||||
.HasColumnOrder(49);
|
||||
|
||||
builder.HasOne(track => track.Album)
|
||||
.WithMany(album => album.Tracks)
|
||||
|
||||
src/Lumina.DataAccess/Common/Migrations/20261013195657_AddsAudioContainerToMusicMetadata.Designer.cs
Generated
+3435
File diff suppressed because it is too large.
Load diff
+42
@@ -0,0 +1,42 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Lumina.DataAccess.Common.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class AddsAudioContainerToMusicMetadata : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "Container",
|
||||
table: "Tracks",
|
||||
type: "TEXT",
|
||||
maxLength: 50,
|
||||
nullable: true)
|
||||
.Annotation("Relational:ColumnOrder", 49);
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "Container",
|
||||
table: "MusicLibraryScanItemMetadata",
|
||||
type: "TEXT",
|
||||
maxLength: 50,
|
||||
nullable: true)
|
||||
.Annotation("Relational:ColumnOrder", 31);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Container",
|
||||
table: "Tracks");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Container",
|
||||
table: "MusicLibraryScanItemMetadata");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -844,6 +844,11 @@ namespace Lumina.DataAccess.Common.Migrations
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnOrder(13);
|
||||
|
||||
b.Property<string>("Container")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnOrder(31);
|
||||
|
||||
b.Property<int?>("DiscNumber")
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnOrder(10);
|
||||
@@ -1037,6 +1042,11 @@ namespace Lumina.DataAccess.Common.Migrations
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnOrder(22);
|
||||
|
||||
b.Property<string>("Container")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnOrder(49);
|
||||
|
||||
b.Property<Guid>("CreatedBy")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnOrder(38);
|
||||
|
||||
Reference in new issue
Block a user