mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-21 17:44:43 +01:00
allow request header overrides
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
using System.Globalization;
|
||||
using MediaBrowser.Common.IO;
|
||||
using MediaBrowser.Common.IO;
|
||||
using MediaBrowser.Controller.Configuration;
|
||||
using MediaBrowser.Controller.Entities;
|
||||
using MediaBrowser.Controller.Entities.Audio;
|
||||
@@ -7,6 +6,7 @@ using MediaBrowser.Controller.Entities.TV;
|
||||
using MediaBrowser.Controller.IO;
|
||||
using MediaBrowser.Model.Entities;
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
|
||||
@@ -92,13 +92,21 @@ namespace MediaBrowser.Server.Implementations.Providers
|
||||
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
|
||||
var enableInternetProviders = ConfigurationManager.Configuration.EnableInternetProviders;
|
||||
var excludeTypes = ConfigurationManager.Configuration.InternetProviderExcludeTypes;
|
||||
|
||||
// Run the normal providers sequentially in order of priority
|
||||
foreach (var provider in MetadataProviders.Where(p => ProviderSupportsItem(p, item)))
|
||||
foreach (var provider in MetadataProviders)
|
||||
{
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
|
||||
if (!ProviderSupportsItem(provider, item))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
// Skip if internet providers are currently disabled
|
||||
if (provider.RequiresInternet && !ConfigurationManager.Configuration.EnableInternetProviders)
|
||||
if (provider.RequiresInternet && !enableInternetProviders)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
@@ -110,7 +118,10 @@ namespace MediaBrowser.Server.Implementations.Providers
|
||||
}
|
||||
|
||||
// Skip if internet provider and this type is not allowed
|
||||
if (provider.RequiresInternet && ConfigurationManager.Configuration.EnableInternetProviders && ConfigurationManager.Configuration.InternetProviderExcludeTypes.Contains(item.GetType().Name, StringComparer.OrdinalIgnoreCase))
|
||||
if (provider.RequiresInternet &&
|
||||
enableInternetProviders &&
|
||||
excludeTypes.Length > 0 &&
|
||||
excludeTypes.Contains(item.GetType().Name, StringComparer.OrdinalIgnoreCase))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user