mirror of https://github.com/ErsatzTV/ErsatzTV.git
Browse Source
* load embedded song metadata * index song artist and song album * reset all song metadatapull/499/head
22 changed files with 8131 additions and 36 deletions
@ -0,0 +1,12 @@
@@ -0,0 +1,12 @@
|
||||
namespace ErsatzTV.Core.Metadata |
||||
{ |
||||
public static class MetadataFormatTag |
||||
{ |
||||
public static readonly string Album = "album"; |
||||
public static readonly string Artist = "artist"; |
||||
public static readonly string Date = "date"; |
||||
public static readonly string Genre = "genre"; |
||||
public static readonly string Title = "title"; |
||||
public static readonly string Track = "track"; |
||||
} |
||||
} |
||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,101 @@
@@ -0,0 +1,101 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations; |
||||
|
||||
#nullable disable |
||||
|
||||
namespace ErsatzTV.Infrastructure.Migrations |
||||
{ |
||||
public partial class Add_SongAlbum : Migration |
||||
{ |
||||
protected override void Up(MigrationBuilder migrationBuilder) |
||||
{ |
||||
migrationBuilder.DropForeignKey( |
||||
name: "FK_Genre_SongMetadata_SongMetadataId", |
||||
table: "Genre"); |
||||
|
||||
migrationBuilder.DropForeignKey( |
||||
name: "FK_Studio_SongMetadata_SongMetadataId", |
||||
table: "Studio"); |
||||
|
||||
migrationBuilder.AddColumn<string>( |
||||
name: "Album", |
||||
table: "SongMetadata", |
||||
type: "TEXT", |
||||
nullable: true); |
||||
|
||||
migrationBuilder.AddColumn<string>( |
||||
name: "Artist", |
||||
table: "SongMetadata", |
||||
type: "TEXT", |
||||
nullable: true); |
||||
|
||||
migrationBuilder.AddColumn<string>( |
||||
name: "Date", |
||||
table: "SongMetadata", |
||||
type: "TEXT", |
||||
nullable: true); |
||||
|
||||
migrationBuilder.AddColumn<string>( |
||||
name: "Track", |
||||
table: "SongMetadata", |
||||
type: "TEXT", |
||||
nullable: true); |
||||
|
||||
migrationBuilder.AddForeignKey( |
||||
name: "FK_Genre_SongMetadata_SongMetadataId", |
||||
table: "Genre", |
||||
column: "SongMetadataId", |
||||
principalTable: "SongMetadata", |
||||
principalColumn: "Id", |
||||
onDelete: ReferentialAction.Cascade); |
||||
|
||||
migrationBuilder.AddForeignKey( |
||||
name: "FK_Studio_SongMetadata_SongMetadataId", |
||||
table: "Studio", |
||||
column: "SongMetadataId", |
||||
principalTable: "SongMetadata", |
||||
principalColumn: "Id", |
||||
onDelete: ReferentialAction.Cascade); |
||||
} |
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder) |
||||
{ |
||||
migrationBuilder.DropForeignKey( |
||||
name: "FK_Genre_SongMetadata_SongMetadataId", |
||||
table: "Genre"); |
||||
|
||||
migrationBuilder.DropForeignKey( |
||||
name: "FK_Studio_SongMetadata_SongMetadataId", |
||||
table: "Studio"); |
||||
|
||||
migrationBuilder.DropColumn( |
||||
name: "Album", |
||||
table: "SongMetadata"); |
||||
|
||||
migrationBuilder.DropColumn( |
||||
name: "Artist", |
||||
table: "SongMetadata"); |
||||
|
||||
migrationBuilder.DropColumn( |
||||
name: "Date", |
||||
table: "SongMetadata"); |
||||
|
||||
migrationBuilder.DropColumn( |
||||
name: "Track", |
||||
table: "SongMetadata"); |
||||
|
||||
migrationBuilder.AddForeignKey( |
||||
name: "FK_Genre_SongMetadata_SongMetadataId", |
||||
table: "Genre", |
||||
column: "SongMetadataId", |
||||
principalTable: "SongMetadata", |
||||
principalColumn: "Id"); |
||||
|
||||
migrationBuilder.AddForeignKey( |
||||
name: "FK_Studio_SongMetadata_SongMetadataId", |
||||
table: "Studio", |
||||
column: "SongMetadataId", |
||||
principalTable: "SongMetadata", |
||||
principalColumn: "Id"); |
||||
} |
||||
} |
||||
} |
||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,30 @@
@@ -0,0 +1,30 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations; |
||||
|
||||
#nullable disable |
||||
|
||||
namespace ErsatzTV.Infrastructure.Migrations |
||||
{ |
||||
public partial class Reset_SongMetadata : 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) |
||||
{ |
||||
} |
||||
} |
||||
} |
||||
Loading…
Reference in new issue