Browse Source

add music video album to search index (#409)

* add music video album to search index

* update search docs
pull/410/head
Jason Dove 4 years ago committed by GitHub
parent
commit
d7d3ec1235
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      CHANGELOG.md
  2. 4
      ErsatzTV.Application/MediaCards/Mapper.cs
  3. 1
      ErsatzTV.Application/MediaCards/MusicVideoCardViewModel.cs
  4. 8
      ErsatzTV.Infrastructure/Search/SearchIndex.cs
  5. 7
      ErsatzTV/Pages/Artist.razor
  6. 1
      docs/user-guide/search.md

4
CHANGELOG.md

@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file. @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
## [Unreleased]
### Added
- Add music video album to search index
- This requires rebuilding the search index and search results may be empty or incomplete until the rebuild is complete
### Changed
- Remove forced initial delay from `HLS Segmenter` streaming mode

4
ErsatzTV.Application/MediaCards/Mapper.cs

@ -1,5 +1,4 @@ @@ -1,5 +1,4 @@
using System;
using System.Linq;
using System.Linq;
using ErsatzTV.Core;
using ErsatzTV.Core.Domain;
using ErsatzTV.Core.Emby;
@ -101,6 +100,7 @@ namespace ErsatzTV.Application.MediaCards @@ -101,6 +100,7 @@ namespace ErsatzTV.Application.MediaCards
musicVideoMetadata.MusicVideo.Artist.ArtistMetadata.Head().Title,
musicVideoMetadata.SortTitle,
musicVideoMetadata.Plot,
musicVideoMetadata.Album,
GetThumbnail(musicVideoMetadata, None, None));
internal static ArtistCardViewModel ProjectToViewModel(ArtistMetadata artistMetadata) =>

1
ErsatzTV.Application/MediaCards/MusicVideoCardViewModel.cs

@ -7,6 +7,7 @@ @@ -7,6 +7,7 @@
string Subtitle,
string SortTitle,
string Plot,
string Album,
string Poster) : MediaCardViewModel(
MusicVideoId,
Title,

8
ErsatzTV.Infrastructure/Search/SearchIndex.cs

@ -52,6 +52,7 @@ namespace ErsatzTV.Infrastructure.Search @@ -52,6 +52,7 @@ namespace ErsatzTV.Infrastructure.Search
private const string DirectorField = "director";
private const string WriterField = "writer";
private const string TraktListField = "trakt_list";
private const string AlbumField = "album";
public const string MovieType = "movie";
public const string ShowType = "show";
@ -74,7 +75,7 @@ namespace ErsatzTV.Infrastructure.Search @@ -74,7 +75,7 @@ namespace ErsatzTV.Infrastructure.Search
_initialized = false;
}
public int Version => 16;
public int Version => 17;
public Task<bool> Initialize(ILocalFileSystem localFileSystem)
{
@ -624,6 +625,11 @@ namespace ErsatzTV.Infrastructure.Search @@ -624,6 +625,11 @@ namespace ErsatzTV.Infrastructure.Search
Field.Store.NO));
}
if (!string.IsNullOrWhiteSpace(metadata.Album))
{
doc.Add(new TextField(AlbumField, metadata.Album, Field.Store.NO));
}
if (!string.IsNullOrWhiteSpace(metadata.Plot))
{
doc.Add(new TextField(PlotField, metadata.Plot ?? string.Empty, Field.Store.NO));

7
ErsatzTV/Pages/Artist.razor

@ -139,6 +139,13 @@ @@ -139,6 +139,13 @@
<MudCardContent Class="ml-3">
<div style="display: flex; flex-direction: column; height: 100%">
<MudText Typo="Typo.h4">@musicVideo.Title</MudText>
@if (!string.IsNullOrWhiteSpace(musicVideo.Album))
{
<div style="display: flex; flex-direction: row">
<MudText GutterBottom="true">Album:&nbsp;</MudText>
<MudLink Href="@(@$"album:""{musicVideo.Album}""".GetRelativeSearchQuery())">@musicVideo.Album</MudLink>
</div>
}
<MudText Style="flex-grow: 1">@musicVideo.Plot</MudText>
<div class="mt-6">
<MudButton Variant="Variant.Filled"

1
docs/user-guide/search.md

@ -71,6 +71,7 @@ The following fields are available for searching artists: @@ -71,6 +71,7 @@ The following fields are available for searching artists:
The following fields are available for searching music videos:
- `title`: The music video title
- `album`: The music video album
- `genre`: The music video genre
- `library_name`: The name of the library that contains the music video
- `language`: The music video audio stream language

Loading…
Cancel
Save