fix television metadata (#161)
This commit is contained in:
@@ -1,7 +1,13 @@
|
||||
namespace ErsatzTV.Application.MediaCards
|
||||
{
|
||||
public record MusicVideoCardViewModel
|
||||
(int MusicVideoId, string Title, string Subtitle, string SortTitle, string Plot, string Poster) : MediaCardViewModel(
|
||||
(
|
||||
int MusicVideoId,
|
||||
string Title,
|
||||
string Subtitle,
|
||||
string SortTitle,
|
||||
string Plot,
|
||||
string Poster) : MediaCardViewModel(
|
||||
MusicVideoId,
|
||||
Title,
|
||||
Subtitle,
|
||||
|
||||
@@ -12,9 +12,9 @@ namespace ErsatzTV.Application.MediaCollections.Commands
|
||||
public class
|
||||
AddArtistToCollectionHandler : MediatR.IRequestHandler<AddArtistToCollection, Either<BaseError, Unit>>
|
||||
{
|
||||
private readonly IArtistRepository _artistRepository;
|
||||
private readonly ChannelWriter<IBackgroundServiceRequest> _channel;
|
||||
private readonly IMediaCollectionRepository _mediaCollectionRepository;
|
||||
private readonly IArtistRepository _artistRepository;
|
||||
|
||||
public AddArtistToCollectionHandler(
|
||||
IMediaCollectionRepository mediaCollectionRepository,
|
||||
|
||||
@@ -2,5 +2,9 @@
|
||||
|
||||
namespace ErsatzTV.Application.Search
|
||||
{
|
||||
public record SearchResultAllItemsViewModel(List<int> MovieIds, List<int> ShowIds, List<int> ArtistIds, List<int> MusicVideoIds);
|
||||
public record SearchResultAllItemsViewModel(
|
||||
List<int> MovieIds,
|
||||
List<int> ShowIds,
|
||||
List<int> ArtistIds,
|
||||
List<int> MusicVideoIds);
|
||||
}
|
||||
|
||||
@@ -9,25 +9,25 @@ namespace ErsatzTV.Infrastructure.Migrations
|
||||
migrationBuilder.Sql(
|
||||
@"DELETE FROM Genre
|
||||
WHERE MovieMetadataId NOT IN (SELECT Id FROM MovieMetadata)
|
||||
OR ShowMetadataId NOT IN (SELECT Id FROM Show)
|
||||
OR SeasonMetadataId NOT IN (SELECT Id FROM Season)
|
||||
OR EpisodeMetadataId NOT IN (SELECT Id FROM Episode)
|
||||
OR ShowMetadataId NOT IN (SELECT Id FROM ShowMetadata)
|
||||
OR SeasonMetadataId NOT IN (SELECT Id FROM SeasonMetadata)
|
||||
OR EpisodeMetadataId NOT IN (SELECT Id FROM EpisodeMetadata)
|
||||
OR MusicVideoMetadataId NOT IN (SELECT Id FROM MusicVideoMetadata)");
|
||||
|
||||
migrationBuilder.Sql(
|
||||
@"DELETE FROM Tag
|
||||
WHERE MovieMetadataId NOT IN (SELECT Id FROM MovieMetadata)
|
||||
OR ShowMetadataId NOT IN (SELECT Id FROM Show)
|
||||
OR SeasonMetadataId NOT IN (SELECT Id FROM Season)
|
||||
OR EpisodeMetadataId NOT IN (SELECT Id FROM Episode)
|
||||
OR ShowMetadataId NOT IN (SELECT Id FROM ShowMetadata)
|
||||
OR SeasonMetadataId NOT IN (SELECT Id FROM SeasonMetadata)
|
||||
OR EpisodeMetadataId NOT IN (SELECT Id FROM EpisodeMetadata)
|
||||
OR MusicVideoMetadataId NOT IN (SELECT Id FROM MusicVideoMetadata)");
|
||||
|
||||
migrationBuilder.Sql(
|
||||
@"DELETE FROM Studio
|
||||
WHERE MovieMetadataId NOT IN (SELECT Id FROM MovieMetadata)
|
||||
OR ShowMetadataId NOT IN (SELECT Id FROM Show)
|
||||
OR SeasonMetadataId NOT IN (SELECT Id FROM Season)
|
||||
OR EpisodeMetadataId NOT IN (SELECT Id FROM Episode)
|
||||
OR ShowMetadataId NOT IN (SELECT Id FROM ShowMetadata)
|
||||
OR SeasonMetadataId NOT IN (SELECT Id FROM SeasonMetadata)
|
||||
OR EpisodeMetadataId NOT IN (SELECT Id FROM EpisodeMetadata)
|
||||
OR MusicVideoMetadataId NOT IN (SELECT Id FROM MusicVideoMetadata)");
|
||||
}
|
||||
|
||||
|
||||
Generated
+2164
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,24 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace ErsatzTV.Infrastructure.Migrations
|
||||
{
|
||||
public partial class Update_LibraryLastScan_Metadata : 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 = 2)");
|
||||
|
||||
migrationBuilder.Sql(
|
||||
@"UPDATE Library SET LastScan = '0001-01-01 00:00:00' WHERE MediaKind = 2");
|
||||
|
||||
migrationBuilder.Sql(
|
||||
@"UPDATE ShowMetadata SET DateUpdated = '0001-01-01 00:00:00' WHERE MetadataKind = 1");
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -101,7 +101,7 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
<MudSkeleton SkeletonType="SkeletonType.Rectangle" Animation="Animation.False" Height="220px" Width="293px" />
|
||||
<MudSkeleton SkeletonType="SkeletonType.Rectangle" Animation="Animation.False" Height="220px" Width="293px"/>
|
||||
}
|
||||
<MudCardContent Class="ml-3">
|
||||
<div style="display: flex; flex-direction: column; height: 100%">
|
||||
|
||||
@@ -131,7 +131,10 @@
|
||||
|
||||
private void SelectClicked(MediaCardViewModel card, MouseEventArgs e)
|
||||
{
|
||||
List<MediaCardViewModel> GetSortedItems() => _data.Cards.OrderBy(m => m.SortTitle).ToList<MediaCardViewModel>();
|
||||
List<MediaCardViewModel> GetSortedItems()
|
||||
{
|
||||
return _data.Cards.OrderBy(m => m.SortTitle).ToList<MediaCardViewModel>();
|
||||
}
|
||||
|
||||
SelectClicked(GetSortedItems, card, e);
|
||||
}
|
||||
|
||||
@@ -271,13 +271,16 @@
|
||||
|
||||
private void SelectClicked(MediaCardViewModel card, MouseEventArgs e)
|
||||
{
|
||||
List<MediaCardViewModel> GetSortedItems() => _data.MovieCards.OrderBy(m => m.SortTitle)
|
||||
List<MediaCardViewModel> GetSortedItems()
|
||||
{
|
||||
return _data.MovieCards.OrderBy(m => m.SortTitle)
|
||||
.Append<MediaCardViewModel>(_data.ShowCards.OrderBy(s => s.SortTitle))
|
||||
.Append(_data.SeasonCards.OrderBy(s => s.SortTitle))
|
||||
.Append(_data.EpisodeCards.OrderBy(ep => ep.Aired))
|
||||
.Append(_data.ArtistCards.OrderBy(a => a.SortTitle))
|
||||
.Append(_data.MusicVideoCards.OrderBy(mv => mv.SortTitle))
|
||||
.ToList();
|
||||
}
|
||||
|
||||
SelectClicked(GetSortedItems, card, e);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user