Prioritise precise caption matches in mixed Jellyfin search

This commit is contained in:
Sleeps
2026-10-08 10:30:48 +01:00
parent cb4fd84809
commit dead4b5db7
@@ -18,6 +18,11 @@ public sealed class SceneSearchProvider : IExternalSearchProvider
// modifying or forking the other provider.
private const float ExplicitSceneScoreFloor = 1.1f;
private const float ExplicitSceneScoreRange = 0.9f;
// Small boost for at most two exact caption-text matches returned by the
// backend. This prevents a full page of ordinary Meilisearch results from
// pushing all caption matches beyond Jellyfin's result cap.
private const float CaptionTextScoreFloor = 1.01f;
private const float CaptionTextScoreRange = 0.05f;
private static readonly HashSet<BaseItemKind> SupportedKinds =
[
@@ -124,6 +129,10 @@ public sealed class SceneSearchProvider : IExternalSearchProvider
{
score = ExplicitSceneScoreFloor + (ExplicitSceneScoreRange * score);
}
else if (result.CaptionTextMatch)
{
score = CaptionTextScoreFloor + (CaptionTextScoreRange * score);
}
yielded++;
yield return new SearchResult(itemId, score);