Browse Source

fix video_bit_depth search field for plex media (#1745)

pull/1746/head
Jason Dove 2 years ago committed by GitHub
parent
commit
beee038be3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 7
      ErsatzTV.Infrastructure/Search/ElasticSearchIndex.cs
  2. 7
      ErsatzTV.Infrastructure/Search/LuceneSearchIndex.cs

7
ErsatzTV.Infrastructure/Search/ElasticSearchIndex.cs

@ -46,7 +46,7 @@ public class ElasticSearchIndex : ISearchIndex
return exists.IsValidResponse; return exists.IsValidResponse;
} }
public int Version => 43; public int Version => 44;
public async Task<bool> Initialize( public async Task<bool> Initialize(
ILocalFileSystem localFileSystem, ILocalFileSystem localFileSystem,
@ -910,6 +910,11 @@ public class ElasticSearchIndex : ISearchIndex
doc.VideoBitDepth = pixelFormat.BitDepth; doc.VideoBitDepth = pixelFormat.BitDepth;
} }
if (maybePixelFormat.IsNone && videoStream.BitsPerRawSample > 0)
{
doc.VideoBitDepth = videoStream.BitsPerRawSample;
}
var colorParams = new ColorParams( var colorParams = new ColorParams(
videoStream.ColorRange, videoStream.ColorRange,
videoStream.ColorSpace, videoStream.ColorSpace,

7
ErsatzTV.Infrastructure/Search/LuceneSearchIndex.cs

@ -110,7 +110,7 @@ public sealed class LuceneSearchIndex : ISearchIndex
return Task.FromResult(directoryExists && fileExists); return Task.FromResult(directoryExists && fileExists);
} }
public int Version => 43; public int Version => 44;
public async Task<bool> Initialize( public async Task<bool> Initialize(
ILocalFileSystem localFileSystem, ILocalFileSystem localFileSystem,
@ -1395,6 +1395,11 @@ public sealed class LuceneSearchIndex : ISearchIndex
doc.Add(new Int32Field(VideoBitDepthField, pixelFormat.BitDepth, Field.Store.NO)); 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( var colorParams = new ColorParams(
videoStream.ColorRange, videoStream.ColorRange,
videoStream.ColorSpace, videoStream.ColorSpace,

Loading…
Cancel
Save