mirror of
https://github.com/MrSleeps/jellyfin-scene-search.git
synced 2026-11-19 00:03:36 +00:00
Allow Scene Search on unprefixed Jellyfin queries
This commit is contained in:
@@ -47,12 +47,6 @@ public sealed class SceneSearchProvider : IExternalSearchProvider
|
||||
return false;
|
||||
}
|
||||
|
||||
var config = Configuration;
|
||||
if (config.RequirePrefix && !HasPrefix(query.SearchTerm, config.SearchPrefix))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (query.IncludeItemTypes.Length > 0
|
||||
&& !query.IncludeItemTypes.Any(SupportedKinds.Contains))
|
||||
{
|
||||
@@ -142,14 +136,10 @@ public sealed class SceneSearchProvider : IExternalSearchProvider
|
||||
private static PluginConfiguration Configuration
|
||||
=> Plugin.Instance?.Configuration ?? new PluginConfiguration();
|
||||
|
||||
private static bool HasPrefix(string term, string prefix)
|
||||
=> !string.IsNullOrWhiteSpace(prefix)
|
||||
&& term.TrimStart().StartsWith(prefix, StringComparison.OrdinalIgnoreCase);
|
||||
|
||||
private static string StripPrefix(string term, PluginConfiguration config)
|
||||
{
|
||||
var trimmed = term.Trim();
|
||||
if (!config.RequirePrefix || string.IsNullOrWhiteSpace(config.SearchPrefix))
|
||||
if (string.IsNullOrWhiteSpace(config.SearchPrefix))
|
||||
{
|
||||
return trimmed;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user