Browse Source

search movie and tv show genres

pull/61/head
Jason Dove 5 years ago
parent
commit
1dd79d7c15
  1. 12
      ErsatzTV.Application/MediaCards/Queries/GetSearchCardsHandler.cs
  2. 3
      ErsatzTV.Application/Movies/Mapper.cs
  3. 6
      ErsatzTV.Application/Movies/MovieViewModel.cs
  4. 6
      ErsatzTV.Application/Television/Mapper.cs
  5. 13
      ErsatzTV.Application/Television/TelevisionShowViewModel.cs
  6. 3
      ErsatzTV.Core/Interfaces/Repositories/ISearchRepository.cs
  7. 30
      ErsatzTV.Core/Metadata/LocalMetadataProvider.cs
  8. 2
      ErsatzTV.Infrastructure/Data/Repositories/MovieRepository.cs
  9. 28
      ErsatzTV.Infrastructure/Data/Repositories/SearchRepository.cs
  10. 7
      ErsatzTV.Infrastructure/Data/Repositories/TelevisionRepository.cs
  11. 1560
      ErsatzTV.Infrastructure/Migrations/20210311020345_Reset_MetadataDateUpdated_Genres.Designer.cs
  12. 18
      ErsatzTV.Infrastructure/Migrations/20210311020345_Reset_MetadataDateUpdated_Genres.cs
  13. 384
      ErsatzTV.Infrastructure/Migrations/TvContextModelSnapshot.cs
  14. 11
      ErsatzTV/Pages/Movie.razor
  15. 4
      ErsatzTV/Pages/Search.razor
  16. 11
      ErsatzTV/Pages/TelevisionSeasonList.razor

12
ErsatzTV.Application/MediaCards/Queries/GetSearchCardsHandler.cs

@ -18,7 +18,17 @@ namespace ErsatzTV.Application.MediaCards.Queries @@ -18,7 +18,17 @@ namespace ErsatzTV.Application.MediaCards.Queries
public Task<Either<BaseError, SearchCardResultsViewModel>> Handle(
GetSearchCards request,
CancellationToken cancellationToken) =>
Try(_searchRepository.SearchMediaItems(request.Query)).Sequence()
request.Query.StartsWith("genre:")
? GenreSearch(request.Query.Replace("genre:", string.Empty))
: TitleSearch(request.Query);
private Task<Either<BaseError, SearchCardResultsViewModel>> TitleSearch(string query) =>
Try(_searchRepository.SearchMediaItemsByTitle(query)).Sequence()
.Map(ProjectToSearchResults)
.Map(t => t.ToEither(ex => BaseError.New($"Failed to search: {ex.Message}")));
private Task<Either<BaseError, SearchCardResultsViewModel>> GenreSearch(string query) =>
Try(_searchRepository.SearchMediaItemsByGenre(query)).Sequence()
.Map(ProjectToSearchResults)
.Map(t => t.ToEither(ex => BaseError.New($"Failed to search: {ex.Message}")));
}

3
ErsatzTV.Application/Movies/Mapper.cs

@ -14,7 +14,8 @@ namespace ErsatzTV.Application.Movies @@ -14,7 +14,8 @@ namespace ErsatzTV.Application.Movies
metadata.Year?.ToString(),
metadata.Plot,
Artwork(metadata, ArtworkKind.Poster),
Artwork(metadata, ArtworkKind.FanArt));
Artwork(metadata, ArtworkKind.FanArt),
metadata.Genres.Map(g => g.Name).ToList());
}
private static string Artwork(Metadata metadata, ArtworkKind artworkKind) =>

6
ErsatzTV.Application/Movies/MovieViewModel.cs

@ -1,4 +1,6 @@ @@ -1,4 +1,6 @@
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);
}

6
ErsatzTV.Application/Television/Mapper.cs

@ -1,4 +1,5 @@ @@ -1,4 +1,5 @@
using System.Linq;
using System.Collections.Generic;
using System.Linq;
using ErsatzTV.Core.Domain;
using static LanguageExt.Prelude;
@ -13,7 +14,8 @@ namespace ErsatzTV.Application.Television @@ -13,7 +14,8 @@ namespace ErsatzTV.Application.Television
show.ShowMetadata.HeadOrNone().Map(m => m.Year?.ToString() ?? string.Empty).IfNone(string.Empty),
show.ShowMetadata.HeadOrNone().Map(m => m.Plot ?? string.Empty).IfNone(string.Empty),
show.ShowMetadata.HeadOrNone().Map(GetPoster).IfNone(string.Empty),
show.ShowMetadata.HeadOrNone().Map(GetFanArt).IfNone(string.Empty));
show.ShowMetadata.HeadOrNone().Map(GetFanArt).IfNone(string.Empty),
show.ShowMetadata.HeadOrNone().Map(m => m.Genres.Map(g => g.Name).ToList()).IfNone(new List<string>()));
internal static TelevisionSeasonViewModel ProjectToViewModel(Season season) =>
new(

13
ErsatzTV.Application/Television/TelevisionShowViewModel.cs

@ -1,4 +1,13 @@ @@ -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);
}

3
ErsatzTV.Core/Interfaces/Repositories/ISearchRepository.cs

@ -6,6 +6,7 @@ namespace ErsatzTV.Core.Interfaces.Repositories @@ -6,6 +6,7 @@ namespace ErsatzTV.Core.Interfaces.Repositories
{
public interface ISearchRepository
{
public Task<List<MediaItem>> SearchMediaItems(string query);
public Task<List<MediaItem>> SearchMediaItemsByTitle(string query);
public Task<List<MediaItem>> SearchMediaItemsByGenre(string genre);
}
}

30
ErsatzTV.Core/Metadata/LocalMetadataProvider.cs

@ -176,18 +176,18 @@ namespace ErsatzTV.Core.Metadata @@ -176,18 +176,18 @@ namespace ErsatzTV.Core.Metadata
existing.SortTitle = string.IsNullOrWhiteSpace(metadata.SortTitle)
? _fallbackMetadataProvider.GetSortTitle(metadata.Title)
: metadata.SortTitle;
// foreach (Genre genre in existing.Genres.Filter(g => metadata.Genres.All(g2 => g2.Name != g.Name))
// .ToList())
// {
// existing.Genres.Remove(genre);
// }
//
// foreach (Genre genre in metadata.Genres.Filter(g => existing.Genres.All(g2 => g2.Name != g.Name))
// .ToList())
// {
// existing.Genres.Add(genre);
// }
foreach (Genre genre in existing.Genres.Filter(g => metadata.Genres.All(g2 => g2.Name != g.Name))
.ToList())
{
existing.Genres.Remove(genre);
}
foreach (Genre genre in metadata.Genres.Filter(g => existing.Genres.All(g2 => g2.Name != g.Name))
.ToList())
{
existing.Genres.Add(genre);
}
},
() =>
{
@ -249,7 +249,8 @@ namespace ErsatzTV.Core.Metadata @@ -249,7 +249,8 @@ namespace ErsatzTV.Core.Metadata
Outline = nfo.Outline,
Tagline = nfo.Tagline,
Year = nfo.Year,
ReleaseDate = GetAired(nfo.Premiered) ?? new DateTime(nfo.Year, 1, 1)
ReleaseDate = GetAired(nfo.Premiered) ?? new DateTime(nfo.Year, 1, 1),
Genres = nfo.Genres.Map(g => new Genre { Name = g }).ToList()
},
None);
}
@ -379,6 +380,9 @@ namespace ErsatzTV.Core.Metadata @@ -379,6 +380,9 @@ namespace ErsatzTV.Core.Metadata
[XmlElement("premiered")]
public string Premiered { get; set; }
[XmlElement("genre")]
public List<string> Genres { get; set; }
}
[XmlRoot("episodedetails")]

2
ErsatzTV.Infrastructure/Data/Repositories/MovieRepository.cs

@ -35,6 +35,8 @@ namespace ErsatzTV.Infrastructure.Data.Repositories @@ -35,6 +35,8 @@ namespace ErsatzTV.Infrastructure.Data.Repositories
return await dbContext.Movies
.Include(m => m.MovieMetadata)
.ThenInclude(m => m.Artwork)
.Include(m => m.MovieMetadata)
.ThenInclude(m => m.Genres)
.OrderBy(m => m.Id)
.SingleOrDefaultAsync(m => m.Id == movieId)
.Map(Optional);

28
ErsatzTV.Infrastructure/Data/Repositories/SearchRepository.cs

@ -21,7 +21,7 @@ namespace ErsatzTV.Infrastructure.Data.Repositories @@ -21,7 +21,7 @@ namespace ErsatzTV.Infrastructure.Data.Repositories
_dbConnection = dbConnection;
}
public async Task<List<MediaItem>> SearchMediaItems(string query)
public async Task<List<MediaItem>> SearchMediaItemsByTitle(string query)
{
List<int> ids = await _dbConnection.QueryAsync<int>(
@"SELECT M.Id FROM Movie M
@ -44,5 +44,31 @@ namespace ErsatzTV.Infrastructure.Data.Repositories @@ -44,5 +44,31 @@ namespace ErsatzTV.Infrastructure.Data.Repositories
.OfType<MediaItem>()
.ToListAsync();
}
public async Task<List<MediaItem>> SearchMediaItemsByGenre(string genre)
{
List<int> ids = await _dbConnection.QueryAsync<int>(
@"SELECT M.Id FROM Movie M
INNER JOIN MovieMetadata MM on M.Id = MM.MovieId
INNER JOIN Genre G on MM.Id = G.MovieMetadataId
WHERE G.Name LIKE @Query
UNION
SELECT S.Id FROM Show S
INNER JOIN ShowMetadata SM on S.Id = SM.ShowId
INNER JOIN Genre G2 on SM.Id = G2.ShowMetadataId
WHERE G2.Name LIKE @Query",
new { Query = genre })
.Map(results => results.ToList());
await using TvContext context = _dbContextFactory.CreateDbContext();
return await context.MediaItems
.Filter(m => ids.Contains(m.Id))
.Include(m => (m as Movie).MovieMetadata)
.ThenInclude(mm => mm.Artwork)
.Include(m => (m as Show).ShowMetadata)
.ThenInclude(mm => mm.Artwork)
.OfType<MediaItem>()
.ToListAsync();
}
}
}

7
ErsatzTV.Infrastructure/Data/Repositories/TelevisionRepository.cs

@ -55,6 +55,8 @@ namespace ErsatzTV.Infrastructure.Data.Repositories @@ -55,6 +55,8 @@ namespace ErsatzTV.Infrastructure.Data.Repositories
.Filter(s => s.Id == showId)
.Include(s => s.ShowMetadata)
.ThenInclude(sm => sm.Artwork)
.Include(s => s.ShowMetadata)
.ThenInclude(sm => sm.Genres)
.OrderBy(s => s.Id)
.SingleOrDefaultAsync()
.Map(Optional);
@ -171,6 +173,8 @@ namespace ErsatzTV.Infrastructure.Data.Repositories @@ -171,6 +173,8 @@ namespace ErsatzTV.Infrastructure.Data.Repositories
return _dbContext.Shows
.Include(s => s.ShowMetadata)
.ThenInclude(sm => sm.Artwork)
.Include(s => s.ShowMetadata)
.ThenInclude(sm => sm.Genres)
.OrderBy(s => s.Id)
.SingleOrDefaultAsync(s => s.Id == id)
.Map(Optional);
@ -183,11 +187,12 @@ namespace ErsatzTV.Infrastructure.Data.Repositories @@ -183,11 +187,12 @@ namespace ErsatzTV.Infrastructure.Data.Repositories
try
{
metadata.DateAdded = DateTime.UtcNow;
metadata.Genres ??= new List<Genre>();
var show = new Show
{
LibraryPathId = libraryPathId,
ShowMetadata = new List<ShowMetadata> { metadata },
Seasons = new List<Season>()
Seasons = new List<Season>(),
};
await _dbContext.Shows.AddAsync(show);

1560
ErsatzTV.Infrastructure/Migrations/20210311020345_Reset_MetadataDateUpdated_Genres.Designer.cs generated

File diff suppressed because it is too large Load Diff

18
ErsatzTV.Infrastructure/Migrations/20210311020345_Reset_MetadataDateUpdated_Genres.cs

@ -0,0 +1,18 @@ @@ -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)
{
}
}
}

384
ErsatzTV.Infrastructure/Migrations/TvContextModelSnapshot.cs

@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
// <auto-generated />
using System;
using ErsatzTV.Infrastructure.Data;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
namespace ErsatzTV.Infrastructure.Migrations
{
[DbContext(typeof(TvContext))]
internal class TvContextModelSnapshot : ModelSnapshot
partial class TvContextModelSnapshot : ModelSnapshot
{
protected override void BuildModel(ModelBuilder modelBuilder)
{
@ -16,9 +16,7 @@ namespace ErsatzTV.Infrastructure.Migrations @@ -16,9 +16,7 @@ namespace ErsatzTV.Infrastructure.Migrations
modelBuilder
.HasAnnotation("ProductVersion", "5.0.3");
modelBuilder.Entity(
"ErsatzTV.Core.Domain.Artwork",
b =>
modelBuilder.Entity("ErsatzTV.Core.Domain.Artwork", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
@ -66,9 +64,7 @@ namespace ErsatzTV.Infrastructure.Migrations @@ -66,9 +64,7 @@ namespace ErsatzTV.Infrastructure.Migrations
b.ToTable("Artwork");
});
modelBuilder.Entity(
"ErsatzTV.Core.Domain.Channel",
b =>
modelBuilder.Entity("ErsatzTV.Core.Domain.Channel", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
@ -99,9 +95,7 @@ namespace ErsatzTV.Infrastructure.Migrations @@ -99,9 +95,7 @@ namespace ErsatzTV.Infrastructure.Migrations
b.ToTable("Channel");
});
modelBuilder.Entity(
"ErsatzTV.Core.Domain.Collection",
b =>
modelBuilder.Entity("ErsatzTV.Core.Domain.Collection", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
@ -115,9 +109,7 @@ namespace ErsatzTV.Infrastructure.Migrations @@ -115,9 +109,7 @@ namespace ErsatzTV.Infrastructure.Migrations
b.ToTable("Collection");
});
modelBuilder.Entity(
"ErsatzTV.Core.Domain.CollectionItem",
b =>
modelBuilder.Entity("ErsatzTV.Core.Domain.CollectionItem", b =>
{
b.Property<int>("CollectionId")
.HasColumnType("INTEGER");
@ -132,9 +124,7 @@ namespace ErsatzTV.Infrastructure.Migrations @@ -132,9 +124,7 @@ namespace ErsatzTV.Infrastructure.Migrations
b.ToTable("CollectionItem");
});
modelBuilder.Entity(
"ErsatzTV.Core.Domain.ConfigElement",
b =>
modelBuilder.Entity("ErsatzTV.Core.Domain.ConfigElement", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
@ -154,9 +144,7 @@ namespace ErsatzTV.Infrastructure.Migrations @@ -154,9 +144,7 @@ namespace ErsatzTV.Infrastructure.Migrations
b.ToTable("ConfigElement");
});
modelBuilder.Entity(
"ErsatzTV.Core.Domain.EpisodeMetadata",
b =>
modelBuilder.Entity("ErsatzTV.Core.Domain.EpisodeMetadata", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
@ -205,9 +193,7 @@ namespace ErsatzTV.Infrastructure.Migrations @@ -205,9 +193,7 @@ namespace ErsatzTV.Infrastructure.Migrations
b.ToTable("EpisodeMetadata");
});
modelBuilder.Entity(
"ErsatzTV.Core.Domain.FFmpegProfile",
b =>
modelBuilder.Entity("ErsatzTV.Core.Domain.FFmpegProfile", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
@ -274,9 +260,7 @@ namespace ErsatzTV.Infrastructure.Migrations @@ -274,9 +260,7 @@ namespace ErsatzTV.Infrastructure.Migrations
b.ToTable("FFmpegProfile");
});
modelBuilder.Entity(
"ErsatzTV.Core.Domain.Genre",
b =>
modelBuilder.Entity("ErsatzTV.Core.Domain.Genre", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
@ -310,9 +294,7 @@ namespace ErsatzTV.Infrastructure.Migrations @@ -310,9 +294,7 @@ namespace ErsatzTV.Infrastructure.Migrations
b.ToTable("Genre");
});
modelBuilder.Entity(
"ErsatzTV.Core.Domain.Library",
b =>
modelBuilder.Entity("ErsatzTV.Core.Domain.Library", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
@ -337,9 +319,7 @@ namespace ErsatzTV.Infrastructure.Migrations @@ -337,9 +319,7 @@ namespace ErsatzTV.Infrastructure.Migrations
b.ToTable("Library");
});
modelBuilder.Entity(
"ErsatzTV.Core.Domain.LibraryPath",
b =>
modelBuilder.Entity("ErsatzTV.Core.Domain.LibraryPath", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
@ -358,9 +338,7 @@ namespace ErsatzTV.Infrastructure.Migrations @@ -358,9 +338,7 @@ namespace ErsatzTV.Infrastructure.Migrations
b.ToTable("LibraryPath");
});
modelBuilder.Entity(
"ErsatzTV.Core.Domain.MediaFile",
b =>
modelBuilder.Entity("ErsatzTV.Core.Domain.MediaFile", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
@ -382,9 +360,7 @@ namespace ErsatzTV.Infrastructure.Migrations @@ -382,9 +360,7 @@ namespace ErsatzTV.Infrastructure.Migrations
b.ToTable("MediaFile");
});
modelBuilder.Entity(
"ErsatzTV.Core.Domain.MediaItem",
b =>
modelBuilder.Entity("ErsatzTV.Core.Domain.MediaItem", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
@ -400,9 +376,7 @@ namespace ErsatzTV.Infrastructure.Migrations @@ -400,9 +376,7 @@ namespace ErsatzTV.Infrastructure.Migrations
b.ToTable("MediaItem");
});
modelBuilder.Entity(
"ErsatzTV.Core.Domain.MediaSource",
b =>
modelBuilder.Entity("ErsatzTV.Core.Domain.MediaSource", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
@ -413,9 +387,7 @@ namespace ErsatzTV.Infrastructure.Migrations @@ -413,9 +387,7 @@ namespace ErsatzTV.Infrastructure.Migrations
b.ToTable("MediaSource");
});
modelBuilder.Entity(
"ErsatzTV.Core.Domain.MediaVersion",
b =>
modelBuilder.Entity("ErsatzTV.Core.Domain.MediaVersion", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
@ -472,9 +444,7 @@ namespace ErsatzTV.Infrastructure.Migrations @@ -472,9 +444,7 @@ namespace ErsatzTV.Infrastructure.Migrations
b.ToTable("MediaVersion");
});
modelBuilder.Entity(
"ErsatzTV.Core.Domain.MovieMetadata",
b =>
modelBuilder.Entity("ErsatzTV.Core.Domain.MovieMetadata", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
@ -523,9 +493,7 @@ namespace ErsatzTV.Infrastructure.Migrations @@ -523,9 +493,7 @@ namespace ErsatzTV.Infrastructure.Migrations
b.ToTable("MovieMetadata");
});
modelBuilder.Entity(
"ErsatzTV.Core.Domain.Playout",
b =>
modelBuilder.Entity("ErsatzTV.Core.Domain.Playout", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
@ -549,9 +517,7 @@ namespace ErsatzTV.Infrastructure.Migrations @@ -549,9 +517,7 @@ namespace ErsatzTV.Infrastructure.Migrations
b.ToTable("Playout");
});
modelBuilder.Entity(
"ErsatzTV.Core.Domain.PlayoutItem",
b =>
modelBuilder.Entity("ErsatzTV.Core.Domain.PlayoutItem", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
@ -578,9 +544,7 @@ namespace ErsatzTV.Infrastructure.Migrations @@ -578,9 +544,7 @@ namespace ErsatzTV.Infrastructure.Migrations
b.ToTable("PlayoutItem");
});
modelBuilder.Entity(
"ErsatzTV.Core.Domain.PlayoutProgramScheduleAnchor",
b =>
modelBuilder.Entity("ErsatzTV.Core.Domain.PlayoutProgramScheduleAnchor", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
@ -614,9 +578,7 @@ namespace ErsatzTV.Infrastructure.Migrations @@ -614,9 +578,7 @@ namespace ErsatzTV.Infrastructure.Migrations
b.ToTable("PlayoutProgramScheduleAnchor");
});
modelBuilder.Entity(
"ErsatzTV.Core.Domain.PlexConnection",
b =>
modelBuilder.Entity("ErsatzTV.Core.Domain.PlexConnection", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
@ -638,9 +600,7 @@ namespace ErsatzTV.Infrastructure.Migrations @@ -638,9 +600,7 @@ namespace ErsatzTV.Infrastructure.Migrations
b.ToTable("PlexConnection");
});
modelBuilder.Entity(
"ErsatzTV.Core.Domain.PlexPathReplacement",
b =>
modelBuilder.Entity("ErsatzTV.Core.Domain.PlexPathReplacement", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
@ -662,9 +622,7 @@ namespace ErsatzTV.Infrastructure.Migrations @@ -662,9 +622,7 @@ namespace ErsatzTV.Infrastructure.Migrations
b.ToTable("PlexPathReplacement");
});
modelBuilder.Entity(
"ErsatzTV.Core.Domain.ProgramSchedule",
b =>
modelBuilder.Entity("ErsatzTV.Core.Domain.ProgramSchedule", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
@ -684,9 +642,7 @@ namespace ErsatzTV.Infrastructure.Migrations @@ -684,9 +642,7 @@ namespace ErsatzTV.Infrastructure.Migrations
b.ToTable("ProgramSchedule");
});
modelBuilder.Entity(
"ErsatzTV.Core.Domain.ProgramScheduleItem",
b =>
modelBuilder.Entity("ErsatzTV.Core.Domain.ProgramScheduleItem", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
@ -721,9 +677,7 @@ namespace ErsatzTV.Infrastructure.Migrations @@ -721,9 +677,7 @@ namespace ErsatzTV.Infrastructure.Migrations
b.ToTable("ProgramScheduleItem");
});
modelBuilder.Entity(
"ErsatzTV.Core.Domain.Resolution",
b =>
modelBuilder.Entity("ErsatzTV.Core.Domain.Resolution", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
@ -743,9 +697,7 @@ namespace ErsatzTV.Infrastructure.Migrations @@ -743,9 +697,7 @@ namespace ErsatzTV.Infrastructure.Migrations
b.ToTable("Resolution");
});
modelBuilder.Entity(
"ErsatzTV.Core.Domain.SeasonMetadata",
b =>
modelBuilder.Entity("ErsatzTV.Core.Domain.SeasonMetadata", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
@ -788,9 +740,7 @@ namespace ErsatzTV.Infrastructure.Migrations @@ -788,9 +740,7 @@ namespace ErsatzTV.Infrastructure.Migrations
b.ToTable("SeasonMetadata");
});
modelBuilder.Entity(
"ErsatzTV.Core.Domain.ShowMetadata",
b =>
modelBuilder.Entity("ErsatzTV.Core.Domain.ShowMetadata", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
@ -839,18 +789,14 @@ namespace ErsatzTV.Infrastructure.Migrations @@ -839,18 +789,14 @@ namespace ErsatzTV.Infrastructure.Migrations
b.ToTable("ShowMetadata");
});
modelBuilder.Entity(
"ErsatzTV.Core.Domain.LocalLibrary",
b =>
modelBuilder.Entity("ErsatzTV.Core.Domain.LocalLibrary", b =>
{
b.HasBaseType("ErsatzTV.Core.Domain.Library");
b.ToTable("LocalLibrary");
});
modelBuilder.Entity(
"ErsatzTV.Core.Domain.PlexLibrary",
b =>
modelBuilder.Entity("ErsatzTV.Core.Domain.PlexLibrary", b =>
{
b.HasBaseType("ErsatzTV.Core.Domain.Library");
@ -863,9 +809,7 @@ namespace ErsatzTV.Infrastructure.Migrations @@ -863,9 +809,7 @@ namespace ErsatzTV.Infrastructure.Migrations
b.ToTable("PlexLibrary");
});
modelBuilder.Entity(
"ErsatzTV.Core.Domain.PlexMediaFile",
b =>
modelBuilder.Entity("ErsatzTV.Core.Domain.PlexMediaFile", b =>
{
b.HasBaseType("ErsatzTV.Core.Domain.MediaFile");
@ -878,9 +822,7 @@ namespace ErsatzTV.Infrastructure.Migrations @@ -878,9 +822,7 @@ namespace ErsatzTV.Infrastructure.Migrations
b.ToTable("PlexMediaFile");
});
modelBuilder.Entity(
"ErsatzTV.Core.Domain.Episode",
b =>
modelBuilder.Entity("ErsatzTV.Core.Domain.Episode", b =>
{
b.HasBaseType("ErsatzTV.Core.Domain.MediaItem");
@ -895,18 +837,14 @@ namespace ErsatzTV.Infrastructure.Migrations @@ -895,18 +837,14 @@ namespace ErsatzTV.Infrastructure.Migrations
b.ToTable("Episode");
});
modelBuilder.Entity(
"ErsatzTV.Core.Domain.Movie",
b =>
modelBuilder.Entity("ErsatzTV.Core.Domain.Movie", b =>
{
b.HasBaseType("ErsatzTV.Core.Domain.MediaItem");
b.ToTable("Movie");
});
modelBuilder.Entity(
"ErsatzTV.Core.Domain.Season",
b =>
modelBuilder.Entity("ErsatzTV.Core.Domain.Season", b =>
{
b.HasBaseType("ErsatzTV.Core.Domain.MediaItem");
@ -921,27 +859,21 @@ namespace ErsatzTV.Infrastructure.Migrations @@ -921,27 +859,21 @@ namespace ErsatzTV.Infrastructure.Migrations
b.ToTable("Season");
});
modelBuilder.Entity(
"ErsatzTV.Core.Domain.Show",
b =>
modelBuilder.Entity("ErsatzTV.Core.Domain.Show", b =>
{
b.HasBaseType("ErsatzTV.Core.Domain.MediaItem");
b.ToTable("Show");
});
modelBuilder.Entity(
"ErsatzTV.Core.Domain.LocalMediaSource",
b =>
modelBuilder.Entity("ErsatzTV.Core.Domain.LocalMediaSource", b =>
{
b.HasBaseType("ErsatzTV.Core.Domain.MediaSource");
b.ToTable("LocalMediaSource");
});
modelBuilder.Entity(
"ErsatzTV.Core.Domain.PlexMediaSource",
b =>
modelBuilder.Entity("ErsatzTV.Core.Domain.PlexMediaSource", b =>
{
b.HasBaseType("ErsatzTV.Core.Domain.MediaSource");
@ -957,9 +889,7 @@ namespace ErsatzTV.Infrastructure.Migrations @@ -957,9 +889,7 @@ namespace ErsatzTV.Infrastructure.Migrations
b.ToTable("PlexMediaSource");
});
modelBuilder.Entity(
"ErsatzTV.Core.Domain.ProgramScheduleItemDuration",
b =>
modelBuilder.Entity("ErsatzTV.Core.Domain.ProgramScheduleItemDuration", b =>
{
b.HasBaseType("ErsatzTV.Core.Domain.ProgramScheduleItem");
@ -972,18 +902,14 @@ namespace ErsatzTV.Infrastructure.Migrations @@ -972,18 +902,14 @@ namespace ErsatzTV.Infrastructure.Migrations
b.ToTable("ProgramScheduleDurationItem");
});
modelBuilder.Entity(
"ErsatzTV.Core.Domain.ProgramScheduleItemFlood",
b =>
modelBuilder.Entity("ErsatzTV.Core.Domain.ProgramScheduleItemFlood", b =>
{
b.HasBaseType("ErsatzTV.Core.Domain.ProgramScheduleItem");
b.ToTable("ProgramScheduleFloodItem");
});
modelBuilder.Entity(
"ErsatzTV.Core.Domain.ProgramScheduleItemMultiple",
b =>
modelBuilder.Entity("ErsatzTV.Core.Domain.ProgramScheduleItemMultiple", b =>
{
b.HasBaseType("ErsatzTV.Core.Domain.ProgramScheduleItem");
@ -993,18 +919,14 @@ namespace ErsatzTV.Infrastructure.Migrations @@ -993,18 +919,14 @@ namespace ErsatzTV.Infrastructure.Migrations
b.ToTable("ProgramScheduleMultipleItem");
});
modelBuilder.Entity(
"ErsatzTV.Core.Domain.ProgramScheduleItemOne",
b =>
modelBuilder.Entity("ErsatzTV.Core.Domain.ProgramScheduleItemOne", b =>
{
b.HasBaseType("ErsatzTV.Core.Domain.ProgramScheduleItem");
b.ToTable("ProgramScheduleOneItem");
});
modelBuilder.Entity(
"ErsatzTV.Core.Domain.PlexMovie",
b =>
modelBuilder.Entity("ErsatzTV.Core.Domain.PlexMovie", b =>
{
b.HasBaseType("ErsatzTV.Core.Domain.Movie");
@ -1014,9 +936,7 @@ namespace ErsatzTV.Infrastructure.Migrations @@ -1014,9 +936,7 @@ namespace ErsatzTV.Infrastructure.Migrations
b.ToTable("PlexMovie");
});
modelBuilder.Entity(
"ErsatzTV.Core.Domain.Artwork",
b =>
modelBuilder.Entity("ErsatzTV.Core.Domain.Artwork", b =>
{
b.HasOne("ErsatzTV.Core.Domain.Channel", null)
.WithMany("Artwork")
@ -1044,9 +964,7 @@ namespace ErsatzTV.Infrastructure.Migrations @@ -1044,9 +964,7 @@ namespace ErsatzTV.Infrastructure.Migrations
.OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.Entity(
"ErsatzTV.Core.Domain.Channel",
b =>
modelBuilder.Entity("ErsatzTV.Core.Domain.Channel", b =>
{
b.HasOne("ErsatzTV.Core.Domain.FFmpegProfile", "FFmpegProfile")
.WithMany()
@ -1057,9 +975,7 @@ namespace ErsatzTV.Infrastructure.Migrations @@ -1057,9 +975,7 @@ namespace ErsatzTV.Infrastructure.Migrations
b.Navigation("FFmpegProfile");
});
modelBuilder.Entity(
"ErsatzTV.Core.Domain.CollectionItem",
b =>
modelBuilder.Entity("ErsatzTV.Core.Domain.CollectionItem", b =>
{
b.HasOne("ErsatzTV.Core.Domain.Collection", "Collection")
.WithMany("CollectionItems")
@ -1078,9 +994,7 @@ namespace ErsatzTV.Infrastructure.Migrations @@ -1078,9 +994,7 @@ namespace ErsatzTV.Infrastructure.Migrations
b.Navigation("MediaItem");
});
modelBuilder.Entity(
"ErsatzTV.Core.Domain.EpisodeMetadata",
b =>
modelBuilder.Entity("ErsatzTV.Core.Domain.EpisodeMetadata", b =>
{
b.HasOne("ErsatzTV.Core.Domain.Episode", "Episode")
.WithMany("EpisodeMetadata")
@ -1091,9 +1005,7 @@ namespace ErsatzTV.Infrastructure.Migrations @@ -1091,9 +1005,7 @@ namespace ErsatzTV.Infrastructure.Migrations
b.Navigation("Episode");
});
modelBuilder.Entity(
"ErsatzTV.Core.Domain.FFmpegProfile",
b =>
modelBuilder.Entity("ErsatzTV.Core.Domain.FFmpegProfile", b =>
{
b.HasOne("ErsatzTV.Core.Domain.Resolution", "Resolution")
.WithMany()
@ -1104,9 +1016,7 @@ namespace ErsatzTV.Infrastructure.Migrations @@ -1104,9 +1016,7 @@ namespace ErsatzTV.Infrastructure.Migrations
b.Navigation("Resolution");
});
modelBuilder.Entity(
"ErsatzTV.Core.Domain.Genre",
b =>
modelBuilder.Entity("ErsatzTV.Core.Domain.Genre", b =>
{
b.HasOne("ErsatzTV.Core.Domain.EpisodeMetadata", null)
.WithMany("Genres")
@ -1127,9 +1037,7 @@ namespace ErsatzTV.Infrastructure.Migrations @@ -1127,9 +1037,7 @@ namespace ErsatzTV.Infrastructure.Migrations
.OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.Entity(
"ErsatzTV.Core.Domain.Library",
b =>
modelBuilder.Entity("ErsatzTV.Core.Domain.Library", b =>
{
b.HasOne("ErsatzTV.Core.Domain.MediaSource", "MediaSource")
.WithMany("Libraries")
@ -1140,9 +1048,7 @@ namespace ErsatzTV.Infrastructure.Migrations @@ -1140,9 +1048,7 @@ namespace ErsatzTV.Infrastructure.Migrations
b.Navigation("MediaSource");
});
modelBuilder.Entity(
"ErsatzTV.Core.Domain.LibraryPath",
b =>
modelBuilder.Entity("ErsatzTV.Core.Domain.LibraryPath", b =>
{
b.HasOne("ErsatzTV.Core.Domain.Library", "Library")
.WithMany("Paths")
@ -1153,9 +1059,7 @@ namespace ErsatzTV.Infrastructure.Migrations @@ -1153,9 +1059,7 @@ namespace ErsatzTV.Infrastructure.Migrations
b.Navigation("Library");
});
modelBuilder.Entity(
"ErsatzTV.Core.Domain.MediaFile",
b =>
modelBuilder.Entity("ErsatzTV.Core.Domain.MediaFile", b =>
{
b.HasOne("ErsatzTV.Core.Domain.MediaVersion", "MediaVersion")
.WithMany("MediaFiles")
@ -1166,9 +1070,7 @@ namespace ErsatzTV.Infrastructure.Migrations @@ -1166,9 +1070,7 @@ namespace ErsatzTV.Infrastructure.Migrations
b.Navigation("MediaVersion");
});
modelBuilder.Entity(
"ErsatzTV.Core.Domain.MediaItem",
b =>
modelBuilder.Entity("ErsatzTV.Core.Domain.MediaItem", b =>
{
b.HasOne("ErsatzTV.Core.Domain.LibraryPath", "LibraryPath")
.WithMany("MediaItems")
@ -1179,9 +1081,7 @@ namespace ErsatzTV.Infrastructure.Migrations @@ -1179,9 +1081,7 @@ namespace ErsatzTV.Infrastructure.Migrations
b.Navigation("LibraryPath");
});
modelBuilder.Entity(
"ErsatzTV.Core.Domain.MediaVersion",
b =>
modelBuilder.Entity("ErsatzTV.Core.Domain.MediaVersion", b =>
{
b.HasOne("ErsatzTV.Core.Domain.Episode", null)
.WithMany("MediaVersions")
@ -1194,9 +1094,7 @@ namespace ErsatzTV.Infrastructure.Migrations @@ -1194,9 +1094,7 @@ namespace ErsatzTV.Infrastructure.Migrations
.OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.Entity(
"ErsatzTV.Core.Domain.MovieMetadata",
b =>
modelBuilder.Entity("ErsatzTV.Core.Domain.MovieMetadata", b =>
{
b.HasOne("ErsatzTV.Core.Domain.Movie", "Movie")
.WithMany("MovieMetadata")
@ -1207,9 +1105,7 @@ namespace ErsatzTV.Infrastructure.Migrations @@ -1207,9 +1105,7 @@ namespace ErsatzTV.Infrastructure.Migrations
b.Navigation("Movie");
});
modelBuilder.Entity(
"ErsatzTV.Core.Domain.Playout",
b =>
modelBuilder.Entity("ErsatzTV.Core.Domain.Playout", b =>
{
b.HasOne("ErsatzTV.Core.Domain.Channel", "Channel")
.WithMany("Playouts")
@ -1223,10 +1119,7 @@ namespace ErsatzTV.Infrastructure.Migrations @@ -1223,10 +1119,7 @@ namespace ErsatzTV.Infrastructure.Migrations
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.OwnsOne(
"ErsatzTV.Core.Domain.PlayoutAnchor",
"Anchor",
b1 =>
b.OwnsOne("ErsatzTV.Core.Domain.PlayoutAnchor", "Anchor", b1 =>
{
b1.Property<int>("PlayoutId")
.HasColumnType("INTEGER");
@ -1262,9 +1155,7 @@ namespace ErsatzTV.Infrastructure.Migrations @@ -1262,9 +1155,7 @@ namespace ErsatzTV.Infrastructure.Migrations
b.Navigation("ProgramSchedule");
});
modelBuilder.Entity(
"ErsatzTV.Core.Domain.PlayoutItem",
b =>
modelBuilder.Entity("ErsatzTV.Core.Domain.PlayoutItem", b =>
{
b.HasOne("ErsatzTV.Core.Domain.MediaItem", "MediaItem")
.WithMany()
@ -1283,9 +1174,7 @@ namespace ErsatzTV.Infrastructure.Migrations @@ -1283,9 +1174,7 @@ namespace ErsatzTV.Infrastructure.Migrations
b.Navigation("Playout");
});
modelBuilder.Entity(
"ErsatzTV.Core.Domain.PlayoutProgramScheduleAnchor",
b =>
modelBuilder.Entity("ErsatzTV.Core.Domain.PlayoutProgramScheduleAnchor", b =>
{
b.HasOne("ErsatzTV.Core.Domain.Collection", "Collection")
.WithMany()
@ -1309,10 +1198,7 @@ namespace ErsatzTV.Infrastructure.Migrations @@ -1309,10 +1198,7 @@ namespace ErsatzTV.Infrastructure.Migrations
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.OwnsOne(
"ErsatzTV.Core.Domain.CollectionEnumeratorState",
"EnumeratorState",
b1 =>
b.OwnsOne("ErsatzTV.Core.Domain.CollectionEnumeratorState", "EnumeratorState", b1 =>
{
b1.Property<int>("PlayoutProgramScheduleAnchorId")
.HasColumnType("INTEGER");
@ -1342,9 +1228,7 @@ namespace ErsatzTV.Infrastructure.Migrations @@ -1342,9 +1228,7 @@ namespace ErsatzTV.Infrastructure.Migrations
b.Navigation("ProgramSchedule");
});
modelBuilder.Entity(
"ErsatzTV.Core.Domain.PlexConnection",
b =>
modelBuilder.Entity("ErsatzTV.Core.Domain.PlexConnection", b =>
{
b.HasOne("ErsatzTV.Core.Domain.PlexMediaSource", "PlexMediaSource")
.WithMany("Connections")
@ -1355,9 +1239,7 @@ namespace ErsatzTV.Infrastructure.Migrations @@ -1355,9 +1239,7 @@ namespace ErsatzTV.Infrastructure.Migrations
b.Navigation("PlexMediaSource");
});
modelBuilder.Entity(
"ErsatzTV.Core.Domain.PlexPathReplacement",
b =>
modelBuilder.Entity("ErsatzTV.Core.Domain.PlexPathReplacement", b =>
{
b.HasOne("ErsatzTV.Core.Domain.PlexMediaSource", "PlexMediaSource")
.WithMany("PathReplacements")
@ -1368,9 +1250,7 @@ namespace ErsatzTV.Infrastructure.Migrations @@ -1368,9 +1250,7 @@ namespace ErsatzTV.Infrastructure.Migrations
b.Navigation("PlexMediaSource");
});
modelBuilder.Entity(
"ErsatzTV.Core.Domain.ProgramScheduleItem",
b =>
modelBuilder.Entity("ErsatzTV.Core.Domain.ProgramScheduleItem", b =>
{
b.HasOne("ErsatzTV.Core.Domain.Collection", "Collection")
.WithMany()
@ -1395,9 +1275,7 @@ namespace ErsatzTV.Infrastructure.Migrations @@ -1395,9 +1275,7 @@ namespace ErsatzTV.Infrastructure.Migrations
b.Navigation("ProgramSchedule");
});
modelBuilder.Entity(
"ErsatzTV.Core.Domain.SeasonMetadata",
b =>
modelBuilder.Entity("ErsatzTV.Core.Domain.SeasonMetadata", b =>
{
b.HasOne("ErsatzTV.Core.Domain.Season", "Season")
.WithMany("SeasonMetadata")
@ -1408,9 +1286,7 @@ namespace ErsatzTV.Infrastructure.Migrations @@ -1408,9 +1286,7 @@ namespace ErsatzTV.Infrastructure.Migrations
b.Navigation("Season");
});
modelBuilder.Entity(
"ErsatzTV.Core.Domain.ShowMetadata",
b =>
modelBuilder.Entity("ErsatzTV.Core.Domain.ShowMetadata", b =>
{
b.HasOne("ErsatzTV.Core.Domain.Show", "Show")
.WithMany("ShowMetadata")
@ -1421,9 +1297,7 @@ namespace ErsatzTV.Infrastructure.Migrations @@ -1421,9 +1297,7 @@ namespace ErsatzTV.Infrastructure.Migrations
b.Navigation("Show");
});
modelBuilder.Entity(
"ErsatzTV.Core.Domain.LocalLibrary",
b =>
modelBuilder.Entity("ErsatzTV.Core.Domain.LocalLibrary", b =>
{
b.HasOne("ErsatzTV.Core.Domain.Library", null)
.WithOne()
@ -1432,9 +1306,7 @@ namespace ErsatzTV.Infrastructure.Migrations @@ -1432,9 +1306,7 @@ namespace ErsatzTV.Infrastructure.Migrations
.IsRequired();
});
modelBuilder.Entity(
"ErsatzTV.Core.Domain.PlexLibrary",
b =>
modelBuilder.Entity("ErsatzTV.Core.Domain.PlexLibrary", b =>
{
b.HasOne("ErsatzTV.Core.Domain.Library", null)
.WithOne()
@ -1443,9 +1315,7 @@ namespace ErsatzTV.Infrastructure.Migrations @@ -1443,9 +1315,7 @@ namespace ErsatzTV.Infrastructure.Migrations
.IsRequired();
});
modelBuilder.Entity(
"ErsatzTV.Core.Domain.PlexMediaFile",
b =>
modelBuilder.Entity("ErsatzTV.Core.Domain.PlexMediaFile", b =>
{
b.HasOne("ErsatzTV.Core.Domain.MediaFile", null)
.WithOne()
@ -1454,9 +1324,7 @@ namespace ErsatzTV.Infrastructure.Migrations @@ -1454,9 +1324,7 @@ namespace ErsatzTV.Infrastructure.Migrations
.IsRequired();
});
modelBuilder.Entity(
"ErsatzTV.Core.Domain.Episode",
b =>
modelBuilder.Entity("ErsatzTV.Core.Domain.Episode", b =>
{
b.HasOne("ErsatzTV.Core.Domain.MediaItem", null)
.WithOne()
@ -1473,9 +1341,7 @@ namespace ErsatzTV.Infrastructure.Migrations @@ -1473,9 +1341,7 @@ namespace ErsatzTV.Infrastructure.Migrations
b.Navigation("Season");
});
modelBuilder.Entity(
"ErsatzTV.Core.Domain.Movie",
b =>
modelBuilder.Entity("ErsatzTV.Core.Domain.Movie", b =>
{
b.HasOne("ErsatzTV.Core.Domain.MediaItem", null)
.WithOne()
@ -1484,9 +1350,7 @@ namespace ErsatzTV.Infrastructure.Migrations @@ -1484,9 +1350,7 @@ namespace ErsatzTV.Infrastructure.Migrations
.IsRequired();
});
modelBuilder.Entity(
"ErsatzTV.Core.Domain.Season",
b =>
modelBuilder.Entity("ErsatzTV.Core.Domain.Season", b =>
{
b.HasOne("ErsatzTV.Core.Domain.MediaItem", null)
.WithOne()
@ -1503,9 +1367,7 @@ namespace ErsatzTV.Infrastructure.Migrations @@ -1503,9 +1367,7 @@ namespace ErsatzTV.Infrastructure.Migrations
b.Navigation("Show");
});
modelBuilder.Entity(
"ErsatzTV.Core.Domain.Show",
b =>
modelBuilder.Entity("ErsatzTV.Core.Domain.Show", b =>
{
b.HasOne("ErsatzTV.Core.Domain.MediaItem", null)
.WithOne()
@ -1514,9 +1376,7 @@ namespace ErsatzTV.Infrastructure.Migrations @@ -1514,9 +1376,7 @@ namespace ErsatzTV.Infrastructure.Migrations
.IsRequired();
});
modelBuilder.Entity(
"ErsatzTV.Core.Domain.LocalMediaSource",
b =>
modelBuilder.Entity("ErsatzTV.Core.Domain.LocalMediaSource", b =>
{
b.HasOne("ErsatzTV.Core.Domain.MediaSource", null)
.WithOne()
@ -1525,9 +1385,7 @@ namespace ErsatzTV.Infrastructure.Migrations @@ -1525,9 +1385,7 @@ namespace ErsatzTV.Infrastructure.Migrations
.IsRequired();
});
modelBuilder.Entity(
"ErsatzTV.Core.Domain.PlexMediaSource",
b =>
modelBuilder.Entity("ErsatzTV.Core.Domain.PlexMediaSource", b =>
{
b.HasOne("ErsatzTV.Core.Domain.MediaSource", null)
.WithOne()
@ -1536,9 +1394,7 @@ namespace ErsatzTV.Infrastructure.Migrations @@ -1536,9 +1394,7 @@ namespace ErsatzTV.Infrastructure.Migrations
.IsRequired();
});
modelBuilder.Entity(
"ErsatzTV.Core.Domain.ProgramScheduleItemDuration",
b =>
modelBuilder.Entity("ErsatzTV.Core.Domain.ProgramScheduleItemDuration", b =>
{
b.HasOne("ErsatzTV.Core.Domain.ProgramScheduleItem", null)
.WithOne()
@ -1547,9 +1403,7 @@ namespace ErsatzTV.Infrastructure.Migrations @@ -1547,9 +1403,7 @@ namespace ErsatzTV.Infrastructure.Migrations
.IsRequired();
});
modelBuilder.Entity(
"ErsatzTV.Core.Domain.ProgramScheduleItemFlood",
b =>
modelBuilder.Entity("ErsatzTV.Core.Domain.ProgramScheduleItemFlood", b =>
{
b.HasOne("ErsatzTV.Core.Domain.ProgramScheduleItem", null)
.WithOne()
@ -1558,9 +1412,7 @@ namespace ErsatzTV.Infrastructure.Migrations @@ -1558,9 +1412,7 @@ namespace ErsatzTV.Infrastructure.Migrations
.IsRequired();
});
modelBuilder.Entity(
"ErsatzTV.Core.Domain.ProgramScheduleItemMultiple",
b =>
modelBuilder.Entity("ErsatzTV.Core.Domain.ProgramScheduleItemMultiple", b =>
{
b.HasOne("ErsatzTV.Core.Domain.ProgramScheduleItem", null)
.WithOne()
@ -1569,9 +1421,7 @@ namespace ErsatzTV.Infrastructure.Migrations @@ -1569,9 +1421,7 @@ namespace ErsatzTV.Infrastructure.Migrations
.IsRequired();
});
modelBuilder.Entity(
"ErsatzTV.Core.Domain.ProgramScheduleItemOne",
b =>
modelBuilder.Entity("ErsatzTV.Core.Domain.ProgramScheduleItemOne", b =>
{
b.HasOne("ErsatzTV.Core.Domain.ProgramScheduleItem", null)
.WithOne()
@ -1580,9 +1430,7 @@ namespace ErsatzTV.Infrastructure.Migrations @@ -1580,9 +1430,7 @@ namespace ErsatzTV.Infrastructure.Migrations
.IsRequired();
});
modelBuilder.Entity(
"ErsatzTV.Core.Domain.PlexMovie",
b =>
modelBuilder.Entity("ErsatzTV.Core.Domain.PlexMovie", b =>
{
b.HasOne("ErsatzTV.Core.Domain.Movie", null)
.WithOne()
@ -1591,120 +1439,114 @@ namespace ErsatzTV.Infrastructure.Migrations @@ -1591,120 +1439,114 @@ namespace ErsatzTV.Infrastructure.Migrations
.IsRequired();
});
modelBuilder.Entity(
"ErsatzTV.Core.Domain.Channel",
b =>
modelBuilder.Entity("ErsatzTV.Core.Domain.Channel", b =>
{
b.Navigation("Artwork");
b.Navigation("Playouts");
});
modelBuilder.Entity("ErsatzTV.Core.Domain.Collection", b => { b.Navigation("CollectionItems"); });
modelBuilder.Entity("ErsatzTV.Core.Domain.Collection", b =>
{
b.Navigation("CollectionItems");
});
modelBuilder.Entity(
"ErsatzTV.Core.Domain.EpisodeMetadata",
b =>
modelBuilder.Entity("ErsatzTV.Core.Domain.EpisodeMetadata", b =>
{
b.Navigation("Artwork");
b.Navigation("Genres");
});
modelBuilder.Entity("ErsatzTV.Core.Domain.Library", b => { b.Navigation("Paths"); });
modelBuilder.Entity("ErsatzTV.Core.Domain.Library", b =>
{
b.Navigation("Paths");
});
modelBuilder.Entity("ErsatzTV.Core.Domain.LibraryPath", b => { b.Navigation("MediaItems"); });
modelBuilder.Entity("ErsatzTV.Core.Domain.LibraryPath", b =>
{
b.Navigation("MediaItems");
});
modelBuilder.Entity("ErsatzTV.Core.Domain.MediaItem", b => { b.Navigation("CollectionItems"); });
modelBuilder.Entity("ErsatzTV.Core.Domain.MediaItem", b =>
{
b.Navigation("CollectionItems");
});
modelBuilder.Entity("ErsatzTV.Core.Domain.MediaSource", b => { b.Navigation("Libraries"); });
modelBuilder.Entity("ErsatzTV.Core.Domain.MediaSource", b =>
{
b.Navigation("Libraries");
});
modelBuilder.Entity("ErsatzTV.Core.Domain.MediaVersion", b => { b.Navigation("MediaFiles"); });
modelBuilder.Entity("ErsatzTV.Core.Domain.MediaVersion", b =>
{
b.Navigation("MediaFiles");
});
modelBuilder.Entity(
"ErsatzTV.Core.Domain.MovieMetadata",
b =>
modelBuilder.Entity("ErsatzTV.Core.Domain.MovieMetadata", b =>
{
b.Navigation("Artwork");
b.Navigation("Genres");
});
modelBuilder.Entity(
"ErsatzTV.Core.Domain.Playout",
b =>
modelBuilder.Entity("ErsatzTV.Core.Domain.Playout", b =>
{
b.Navigation("Items");
b.Navigation("ProgramScheduleAnchors");
});
modelBuilder.Entity(
"ErsatzTV.Core.Domain.ProgramSchedule",
b =>
modelBuilder.Entity("ErsatzTV.Core.Domain.ProgramSchedule", b =>
{
b.Navigation("Items");
b.Navigation("Playouts");
});
modelBuilder.Entity(
"ErsatzTV.Core.Domain.SeasonMetadata",
b =>
modelBuilder.Entity("ErsatzTV.Core.Domain.SeasonMetadata", b =>
{
b.Navigation("Artwork");
b.Navigation("Genres");
});
modelBuilder.Entity(
"ErsatzTV.Core.Domain.ShowMetadata",
b =>
modelBuilder.Entity("ErsatzTV.Core.Domain.ShowMetadata", b =>
{
b.Navigation("Artwork");
b.Navigation("Genres");
});
modelBuilder.Entity(
"ErsatzTV.Core.Domain.Episode",
b =>
modelBuilder.Entity("ErsatzTV.Core.Domain.Episode", b =>
{
b.Navigation("EpisodeMetadata");
b.Navigation("MediaVersions");
});
modelBuilder.Entity(
"ErsatzTV.Core.Domain.Movie",
b =>
modelBuilder.Entity("ErsatzTV.Core.Domain.Movie", b =>
{
b.Navigation("MediaVersions");
b.Navigation("MovieMetadata");
});
modelBuilder.Entity(
"ErsatzTV.Core.Domain.Season",
b =>
modelBuilder.Entity("ErsatzTV.Core.Domain.Season", b =>
{
b.Navigation("Episodes");
b.Navigation("SeasonMetadata");
});
modelBuilder.Entity(
"ErsatzTV.Core.Domain.Show",
b =>
modelBuilder.Entity("ErsatzTV.Core.Domain.Show", b =>
{
b.Navigation("Seasons");
b.Navigation("ShowMetadata");
});
modelBuilder.Entity(
"ErsatzTV.Core.Domain.PlexMediaSource",
b =>
modelBuilder.Entity("ErsatzTV.Core.Domain.PlexMediaSource", b =>
{
b.Navigation("Connections");

11
ErsatzTV/Pages/Movie.razor

@ -15,7 +15,7 @@ @@ -15,7 +15,7 @@
}
</MudContainer>
<MudContainer MaxWidth="MaxWidth.Large" Style="margin-top: 200px">
<div style="display: flex; flex-direction: row;">
<div style="display: flex; flex-direction: row;" class="mb-6">
@if (!string.IsNullOrWhiteSpace(_movie.Poster))
{
<img class="mud-elevation-2 mr-6"
@ -43,6 +43,15 @@ @@ -43,6 +43,15 @@
</div>
</div>
</div>
@if (_movie.Genres.Any())
{
<div>
@foreach (string genre in _movie.Genres.OrderBy(g => g))
{
<MudFab Color="Color.Info" Size="Size.Small" Label="@genre" Class="mr-2" Link="@($"/search?query=genre%3a{genre}")" />
}
</div>
}
</MudContainer>
@code {

4
ErsatzTV/Pages/Search.razor

@ -23,7 +23,7 @@ @@ -23,7 +23,7 @@
<MudText GutterBottom="true" Typo="Typo.h4">Movies</MudText>
<MudContainer MaxWidth="MaxWidth.False" Class="media-card-grid">
@foreach (MovieCardViewModel card in _data.MovieCards)
@foreach (MovieCardViewModel card in _data.MovieCards.OrderBy(m => m.SortTitle))
{
<MediaCard Data="@card"
Link="@($"/media/movies/{card.MovieId}")"
@ -37,7 +37,7 @@ @@ -37,7 +37,7 @@
<MudText GutterBottom="true" Typo="Typo.h4">Television Shows</MudText>
<MudContainer MaxWidth="MaxWidth.False" Class="media-card-grid">
@foreach (TelevisionShowCardViewModel card in _data.ShowCards)
@foreach (TelevisionShowCardViewModel card in _data.ShowCards.OrderBy(s => s.SortTitle))
{
<MediaCard Data="@card"
Link="@($"/media/tv/shows/{card.TelevisionShowId}")"

11
ErsatzTV/Pages/TelevisionSeasonList.razor

@ -23,7 +23,7 @@ @@ -23,7 +23,7 @@
}
</MudContainer>
<MudContainer MaxWidth="MaxWidth.Large" Style="margin-top: 200px">
<div style="display: flex; flex-direction: row;">
<div style="display: flex; flex-direction: row;" class="mb-6">
@if (!string.IsNullOrWhiteSpace(_show.Poster))
{
<img class="mud-elevation-2 mr-6"
@ -58,6 +58,15 @@ @@ -58,6 +58,15 @@
</div>
</div>
</div>
@if (_show.Genres.Any())
{
<div>
@foreach (string genre in _show.Genres.OrderBy(g => g))
{
<MudFab Color="Color.Info" Size="Size.Small" Label="@genre" Class="mr-2" Link="@($"/search?query=genre%3a{genre}")"/>
}
</div>
}
</MudContainer>
<MudContainer MaxWidth="MaxWidth.Large" Class="media-card-grid mt-8">
@foreach (TelevisionSeasonCardViewModel card in _data.Cards)

Loading…
Cancel
Save