diff --git a/jellyfin-plugin/Jellyfin.Plugin.SceneSearch/SceneSearchProvider.cs b/jellyfin-plugin/Jellyfin.Plugin.SceneSearch/SceneSearchProvider.cs index e038207..bff438e 100644 --- a/jellyfin-plugin/Jellyfin.Plugin.SceneSearch/SceneSearchProvider.cs +++ b/jellyfin-plugin/Jellyfin.Plugin.SceneSearch/SceneSearchProvider.cs @@ -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 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);