From beee038be3a019257e5ff4b7230dd9f2f8bec676 Mon Sep 17 00:00:00 2001 From: Jason Dove <1695733+jasongdove@users.noreply.github.com> Date: Mon, 10 Jun 2024 15:46:23 -0500 Subject: [PATCH] fix video_bit_depth search field for plex media (#1745) --- ErsatzTV.Infrastructure/Search/ElasticSearchIndex.cs | 7 ++++++- ErsatzTV.Infrastructure/Search/LuceneSearchIndex.cs | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/ErsatzTV.Infrastructure/Search/ElasticSearchIndex.cs b/ErsatzTV.Infrastructure/Search/ElasticSearchIndex.cs index 02e29ca89..267d2bd52 100644 --- a/ErsatzTV.Infrastructure/Search/ElasticSearchIndex.cs +++ b/ErsatzTV.Infrastructure/Search/ElasticSearchIndex.cs @@ -46,7 +46,7 @@ public class ElasticSearchIndex : ISearchIndex return exists.IsValidResponse; } - public int Version => 43; + public int Version => 44; public async Task Initialize( ILocalFileSystem localFileSystem, @@ -910,6 +910,11 @@ public class ElasticSearchIndex : ISearchIndex doc.VideoBitDepth = pixelFormat.BitDepth; } + if (maybePixelFormat.IsNone && videoStream.BitsPerRawSample > 0) + { + doc.VideoBitDepth = videoStream.BitsPerRawSample; + } + var colorParams = new ColorParams( videoStream.ColorRange, videoStream.ColorSpace, diff --git a/ErsatzTV.Infrastructure/Search/LuceneSearchIndex.cs b/ErsatzTV.Infrastructure/Search/LuceneSearchIndex.cs index ad0a68c72..82d149bf3 100644 --- a/ErsatzTV.Infrastructure/Search/LuceneSearchIndex.cs +++ b/ErsatzTV.Infrastructure/Search/LuceneSearchIndex.cs @@ -110,7 +110,7 @@ public sealed class LuceneSearchIndex : ISearchIndex return Task.FromResult(directoryExists && fileExists); } - public int Version => 43; + public int Version => 44; public async Task Initialize( ILocalFileSystem localFileSystem, @@ -1395,6 +1395,11 @@ public sealed class LuceneSearchIndex : ISearchIndex doc.Add(new Int32Field(VideoBitDepthField, pixelFormat.BitDepth, Field.Store.NO)); } + if (maybePixelFormat.IsNone && videoStream.BitsPerRawSample > 0) + { + doc.Add(new Int32Field(VideoBitDepthField, videoStream.BitsPerRawSample, Field.Store.NO)); + } + var colorParams = new ColorParams( videoStream.ColorRange, videoStream.ColorSpace,