mirror of
https://github.com/MrSleeps/jellyfin-scene-search.git
synced 2026-11-19 00:03:36 +00:00
Prioritise precise caption matches in mixed Jellyfin search
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user