mirror of https://github.com/ErsatzTV/ErsatzTV.git
Browse Source
* load movie genres from sidecar metadata * search movie and tv show genres * rebuild all playouts (needed after time zone fix) * code cleanup * fix duplicate tv show search resultspull/63/head
25 changed files with 5037 additions and 22 deletions
@ -1,4 +1,12 @@ |
|||||||
namespace ErsatzTV.Application.Movies |
using System.Collections.Generic; |
||||||
|
|
||||||
|
namespace ErsatzTV.Application.Movies |
||||||
{ |
{ |
||||||
public record MovieViewModel(string Title, string Year, string Plot, string Poster, string FanArt); |
public record MovieViewModel( |
||||||
|
string Title, |
||||||
|
string Year, |
||||||
|
string Plot, |
||||||
|
string Poster, |
||||||
|
string FanArt, |
||||||
|
List<string> Genres); |
||||||
} |
} |
||||||
|
|||||||
@ -1,4 +1,13 @@ |
|||||||
namespace ErsatzTV.Application.Television |
using System.Collections.Generic; |
||||||
|
|
||||||
|
namespace ErsatzTV.Application.Television |
||||||
{ |
{ |
||||||
public record TelevisionShowViewModel(int Id, string Title, string Year, string Plot, string Poster, string FanArt); |
public record TelevisionShowViewModel( |
||||||
|
int Id, |
||||||
|
string Title, |
||||||
|
string Year, |
||||||
|
string Plot, |
||||||
|
string Poster, |
||||||
|
string FanArt, |
||||||
|
List<string> Genres); |
||||||
} |
} |
||||||
|
|||||||
@ -0,0 +1,8 @@ |
|||||||
|
namespace ErsatzTV.Core.Domain |
||||||
|
{ |
||||||
|
public class Genre |
||||||
|
{ |
||||||
|
public int Id { get; set; } |
||||||
|
public string Name { get; set; } |
||||||
|
} |
||||||
|
} |
||||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,75 @@ |
|||||||
|
using Microsoft.EntityFrameworkCore.Migrations; |
||||||
|
|
||||||
|
namespace ErsatzTV.Infrastructure.Migrations |
||||||
|
{ |
||||||
|
public partial class Add_MetadataGenres : Migration |
||||||
|
{ |
||||||
|
protected override void Up(MigrationBuilder migrationBuilder) |
||||||
|
{ |
||||||
|
migrationBuilder.CreateTable( |
||||||
|
"Genre", |
||||||
|
table => new |
||||||
|
{ |
||||||
|
Id = table.Column<int>("INTEGER", nullable: false) |
||||||
|
.Annotation("Sqlite:Autoincrement", true), |
||||||
|
Name = table.Column<string>("TEXT", nullable: true), |
||||||
|
EpisodeMetadataId = table.Column<int>("INTEGER", nullable: true), |
||||||
|
MovieMetadataId = table.Column<int>("INTEGER", nullable: true), |
||||||
|
SeasonMetadataId = table.Column<int>("INTEGER", nullable: true), |
||||||
|
ShowMetadataId = table.Column<int>("INTEGER", nullable: true) |
||||||
|
}, |
||||||
|
constraints: table => |
||||||
|
{ |
||||||
|
table.PrimaryKey("PK_Genre", x => x.Id); |
||||||
|
table.ForeignKey( |
||||||
|
"FK_Genre_EpisodeMetadata_EpisodeMetadataId", |
||||||
|
x => x.EpisodeMetadataId, |
||||||
|
"EpisodeMetadata", |
||||||
|
"Id", |
||||||
|
onDelete: ReferentialAction.Restrict); |
||||||
|
table.ForeignKey( |
||||||
|
"FK_Genre_MovieMetadata_MovieMetadataId", |
||||||
|
x => x.MovieMetadataId, |
||||||
|
"MovieMetadata", |
||||||
|
"Id", |
||||||
|
onDelete: ReferentialAction.Cascade); |
||||||
|
table.ForeignKey( |
||||||
|
"FK_Genre_SeasonMetadata_SeasonMetadataId", |
||||||
|
x => x.SeasonMetadataId, |
||||||
|
"SeasonMetadata", |
||||||
|
"Id", |
||||||
|
onDelete: ReferentialAction.Restrict); |
||||||
|
table.ForeignKey( |
||||||
|
"FK_Genre_ShowMetadata_ShowMetadataId", |
||||||
|
x => x.ShowMetadataId, |
||||||
|
"ShowMetadata", |
||||||
|
"Id", |
||||||
|
onDelete: ReferentialAction.Cascade); |
||||||
|
}); |
||||||
|
|
||||||
|
migrationBuilder.CreateIndex( |
||||||
|
"IX_Genre_EpisodeMetadataId", |
||||||
|
"Genre", |
||||||
|
"EpisodeMetadataId"); |
||||||
|
|
||||||
|
migrationBuilder.CreateIndex( |
||||||
|
"IX_Genre_MovieMetadataId", |
||||||
|
"Genre", |
||||||
|
"MovieMetadataId"); |
||||||
|
|
||||||
|
migrationBuilder.CreateIndex( |
||||||
|
"IX_Genre_SeasonMetadataId", |
||||||
|
"Genre", |
||||||
|
"SeasonMetadataId"); |
||||||
|
|
||||||
|
migrationBuilder.CreateIndex( |
||||||
|
"IX_Genre_ShowMetadataId", |
||||||
|
"Genre", |
||||||
|
"ShowMetadataId"); |
||||||
|
} |
||||||
|
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder) => |
||||||
|
migrationBuilder.DropTable( |
||||||
|
"Genre"); |
||||||
|
} |
||||||
|
} |
||||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,18 @@ |
|||||||
|
using Microsoft.EntityFrameworkCore.Migrations; |
||||||
|
|
||||||
|
namespace ErsatzTV.Infrastructure.Migrations |
||||||
|
{ |
||||||
|
public partial class Reset_MetadataDateUpdated_Genres : Migration |
||||||
|
{ |
||||||
|
protected override void Up(MigrationBuilder migrationBuilder) |
||||||
|
{ |
||||||
|
migrationBuilder.Sql(@"UPDATE MovieMetadata SET DateUpdated = '0001-01-01 00:00:00'"); |
||||||
|
migrationBuilder.Sql(@"UPDATE ShowMetadata SET DateUpdated = '0001-01-01 00:00:00'"); |
||||||
|
migrationBuilder.Sql(@"UPDATE Library SET LastScan = '0001-01-01 00:00:00'"); |
||||||
|
} |
||||||
|
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder) |
||||||
|
{ |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,18 @@ |
|||||||
|
using Microsoft.EntityFrameworkCore.Migrations; |
||||||
|
|
||||||
|
namespace ErsatzTV.Infrastructure.Migrations |
||||||
|
{ |
||||||
|
public partial class RebuildAllPlayouts_TimeZonesAgain : Migration |
||||||
|
{ |
||||||
|
protected override void Up(MigrationBuilder migrationBuilder) |
||||||
|
{ |
||||||
|
migrationBuilder.Sql(@"DELETE FROM PlayoutItem"); |
||||||
|
migrationBuilder.Sql(@"DELETE FROM PlayoutProgramScheduleAnchor"); |
||||||
|
migrationBuilder.Sql(@"UPDATE Playout SET Anchor_NextStart = null, Anchor_NextScheduleItemId = null"); |
||||||
|
} |
||||||
|
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder) |
||||||
|
{ |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
Loading…
Reference in new issue