Added a way for organizations to prohibit providers (#1105)

This commit is contained in:
Thorsten Sommer authored and GitHub committed 2026-10-22 18:57:12 +02:00
1 parent 052868b24e
commit 7ba5f01388
38 files changed
+1488 -629

No files matched your search

@@ -754,10 +754,11 @@ public sealed class MediaTranscriptionService(
/// <summary>Resolves the configured provider after confidence validation.</summary>
/// <remarks>
/// Checks the global minimum confidence only. A caller with rules of its own, such as the
/// confidence level of a data source, checks the provider against them as well.
/// Checks the global minimum confidence and whether the organization prohibited the provider. A
/// caller with rules of its own, such as the confidence level of a data source, checks the
/// provider against them as well.
/// </remarks>
/// <returns>The configured provider, or null when none is configured or it falls short of the global minimum.</returns>
/// <returns>The configured provider, or null when none is configured, it falls short of the global minimum, or it is prohibited.</returns>
public TranscriptionProvider? GetUsableProvider()
{
var providerId = settingsManager.ConfigurationData.App.UseTranscriptionProvider;
@@ -769,7 +770,7 @@ public sealed class MediaTranscriptionService(
return null;
var minimumLevel = settingsManager.GetMinimumConfidenceLevel(Components.NONE);
return providerSettings.UsedLLMProvider.GetConfidence(settingsManager).Level >= minimumLevel
return settingsManager.IsProviderUsable(providerSettings.UsedLLMProvider, minimumLevel)
? providerSettings
: null;
}