Remove the need for NullLogger
This commit is contained in:
parent
3d3ec3588b
commit
b7ebb67cbb
|
@ -173,16 +173,6 @@ namespace Emby.Dlna.Didl
|
|||
writer.WriteFullEndElement();
|
||||
}
|
||||
|
||||
private ILogger GetStreamBuilderLogger(DlnaOptions options)
|
||||
{
|
||||
if (options.EnableDebugLog)
|
||||
{
|
||||
return _logger;
|
||||
}
|
||||
|
||||
return null; // TODO: @bond NullLogger
|
||||
}
|
||||
|
||||
private string GetMimeType(string input)
|
||||
{
|
||||
var mime = MimeTypes.GetMimeType(input);
|
||||
|
@ -202,7 +192,7 @@ namespace Emby.Dlna.Didl
|
|||
{
|
||||
var sources = _mediaSourceManager.GetStaticMediaSources(video, true, _user);
|
||||
|
||||
streamInfo = new StreamBuilder(_mediaEncoder, GetStreamBuilderLogger(options)).BuildVideoItem(new VideoOptions
|
||||
streamInfo = new StreamBuilder(_mediaEncoder, _logger).BuildVideoItem(new VideoOptions
|
||||
{
|
||||
ItemId = video.Id,
|
||||
MediaSources = sources.ToArray(),
|
||||
|
@ -509,7 +499,7 @@ namespace Emby.Dlna.Didl
|
|||
{
|
||||
var sources = _mediaSourceManager.GetStaticMediaSources(audio, true, _user);
|
||||
|
||||
streamInfo = new StreamBuilder(_mediaEncoder, GetStreamBuilderLogger(options)).BuildAudioItem(new AudioOptions
|
||||
streamInfo = new StreamBuilder(_mediaEncoder, _logger).BuildAudioItem(new AudioOptions
|
||||
{
|
||||
ItemId = audio.Id,
|
||||
MediaSources = sources.ToArray(),
|
||||
|
|
|
@ -532,23 +532,13 @@ namespace Emby.Dlna.PlayTo
|
|||
return null;
|
||||
}
|
||||
|
||||
private ILogger GetStreamBuilderLogger()
|
||||
{
|
||||
if (_config.GetDlnaConfiguration().EnableDebugLog)
|
||||
{
|
||||
return _logger;
|
||||
}
|
||||
|
||||
return null; // TODO: @bond NullLogger
|
||||
}
|
||||
|
||||
private PlaylistItem GetPlaylistItem(BaseItem item, List<MediaSourceInfo> mediaSources, DeviceProfile profile, string deviceId, string mediaSourceId, int? audioStreamIndex, int? subtitleStreamIndex)
|
||||
{
|
||||
if (string.Equals(item.MediaType, MediaType.Video, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return new PlaylistItem
|
||||
{
|
||||
StreamInfo = new StreamBuilder(_mediaEncoder, GetStreamBuilderLogger()).BuildVideoItem(new VideoOptions
|
||||
StreamInfo = new StreamBuilder(_mediaEncoder, _logger).BuildVideoItem(new VideoOptions
|
||||
{
|
||||
ItemId = item.Id,
|
||||
MediaSources = mediaSources.ToArray(),
|
||||
|
@ -568,7 +558,7 @@ namespace Emby.Dlna.PlayTo
|
|||
{
|
||||
return new PlaylistItem
|
||||
{
|
||||
StreamInfo = new StreamBuilder(_mediaEncoder, GetStreamBuilderLogger()).BuildAudioItem(new AudioOptions
|
||||
StreamInfo = new StreamBuilder(_mediaEncoder, _logger).BuildAudioItem(new AudioOptions
|
||||
{
|
||||
ItemId = item.Id,
|
||||
MediaSources = mediaSources.ToArray(),
|
||||
|
|
|
@ -484,10 +484,9 @@ namespace Emby.Server.Implementations.Channels
|
|||
_libraryManager.CreateItem(item, null);
|
||||
}
|
||||
|
||||
await item.RefreshMetadata(new MetadataRefreshOptions(_fileSystem)
|
||||
await item.RefreshMetadata(new MetadataRefreshOptions(new DirectoryService(_logger, _fileSystem))
|
||||
{
|
||||
ForceSave = !isNew && forceUpdate
|
||||
|
||||
}, cancellationToken);
|
||||
|
||||
return item;
|
||||
|
@ -1178,7 +1177,7 @@ namespace Emby.Server.Implementations.Channels
|
|||
|
||||
if (isNew || forceUpdate || item.DateLastRefreshed == default(DateTime))
|
||||
{
|
||||
_providerManager.QueueRefresh(item.Id, new MetadataRefreshOptions(_fileSystem), RefreshPriority.Normal);
|
||||
_providerManager.QueueRefresh(item.Id, new MetadataRefreshOptions(new DirectoryService(_logger, _fileSystem)), RefreshPriority.Normal);
|
||||
}
|
||||
|
||||
return item;
|
||||
|
|
|
@ -143,7 +143,7 @@ namespace Emby.Server.Implementations.Collections
|
|||
|
||||
if (options.ItemIdList.Length > 0)
|
||||
{
|
||||
AddToCollection(collection.Id, options.ItemIdList, false, new MetadataRefreshOptions(_fileSystem)
|
||||
AddToCollection(collection.Id, options.ItemIdList, false, new MetadataRefreshOptions(new DirectoryService(_logger, _fileSystem))
|
||||
{
|
||||
// The initial adding of items is going to create a local metadata file
|
||||
// This will cause internet metadata to be skipped as a result
|
||||
|
@ -152,7 +152,7 @@ namespace Emby.Server.Implementations.Collections
|
|||
}
|
||||
else
|
||||
{
|
||||
_providerManager.QueueRefresh(collection.Id, new MetadataRefreshOptions(_fileSystem), RefreshPriority.High);
|
||||
_providerManager.QueueRefresh(collection.Id, new MetadataRefreshOptions(new DirectoryService(_logger, _fileSystem)), RefreshPriority.High);
|
||||
}
|
||||
|
||||
EventHelper.FireEventIfNotNull(CollectionCreated, this, new CollectionCreatedEventArgs
|
||||
|
@ -173,12 +173,12 @@ namespace Emby.Server.Implementations.Collections
|
|||
|
||||
public void AddToCollection(Guid collectionId, IEnumerable<string> ids)
|
||||
{
|
||||
AddToCollection(collectionId, ids, true, new MetadataRefreshOptions(_fileSystem));
|
||||
AddToCollection(collectionId, ids, true, new MetadataRefreshOptions(new DirectoryService(_logger, _fileSystem)));
|
||||
}
|
||||
|
||||
public void AddToCollection(Guid collectionId, IEnumerable<Guid> ids)
|
||||
{
|
||||
AddToCollection(collectionId, ids.Select(i => i.ToString("N")), true, new MetadataRefreshOptions(_fileSystem));
|
||||
AddToCollection(collectionId, ids.Select(i => i.ToString("N")), true, new MetadataRefreshOptions(new DirectoryService(_logger, _fileSystem)));
|
||||
}
|
||||
|
||||
private void AddToCollection(Guid collectionId, IEnumerable<string> ids, bool fireEvent, MetadataRefreshOptions refreshOptions)
|
||||
|
@ -283,7 +283,7 @@ namespace Emby.Server.Implementations.Collections
|
|||
}
|
||||
|
||||
collection.UpdateToRepository(ItemUpdateType.MetadataEdit, CancellationToken.None);
|
||||
_providerManager.QueueRefresh(collection.Id, new MetadataRefreshOptions(_fileSystem)
|
||||
_providerManager.QueueRefresh(collection.Id, new MetadataRefreshOptions(new DirectoryService(_logger, _fileSystem))
|
||||
{
|
||||
ForceSave = true
|
||||
}, RefreshPriority.High);
|
||||
|
|
|
@ -7,6 +7,7 @@ using System.Linq;
|
|||
using System.Threading.Tasks;
|
||||
using MediaBrowser.Controller.Providers;
|
||||
using MediaBrowser.Model.IO;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace Emby.Server.Implementations.EntryPoints
|
||||
{
|
||||
|
@ -15,10 +16,12 @@ namespace Emby.Server.Implementations.EntryPoints
|
|||
/// </summary>
|
||||
public class RefreshUsersMetadata : IScheduledTask, IConfigurableScheduledTask
|
||||
{
|
||||
private readonly ILogger _logger;
|
||||
/// <summary>
|
||||
/// The _user manager
|
||||
/// </summary>
|
||||
private readonly IUserManager _userManager;
|
||||
|
||||
private IFileSystem _fileSystem;
|
||||
|
||||
public string Name => "Refresh Users";
|
||||
|
@ -41,8 +44,9 @@ namespace Emby.Server.Implementations.EntryPoints
|
|||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="RefreshUsersMetadata" /> class.
|
||||
/// </summary>
|
||||
public RefreshUsersMetadata(IUserManager userManager, IFileSystem fileSystem)
|
||||
public RefreshUsersMetadata(ILogger logger, IUserManager userManager, IFileSystem fileSystem)
|
||||
{
|
||||
_logger = logger;
|
||||
_userManager = userManager;
|
||||
_fileSystem = fileSystem;
|
||||
}
|
||||
|
@ -55,7 +59,7 @@ namespace Emby.Server.Implementations.EntryPoints
|
|||
{
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
|
||||
await user.RefreshMetadata(new MetadataRefreshOptions(_fileSystem), cancellationToken).ConfigureAwait(false);
|
||||
await user.RefreshMetadata(new MetadataRefreshOptions(new DirectoryService(_logger, _fileSystem)), cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -718,7 +718,7 @@ namespace Emby.Server.Implementations.HttpServer
|
|||
}
|
||||
|
||||
string contentType;
|
||||
var restPath = ServiceHandler.FindMatchingRestPath(httpReq.HttpMethod, pathInfo, _logger, out contentType);
|
||||
var restPath = ServiceHandler.FindMatchingRestPath(httpReq.HttpMethod, pathInfo, out contentType);
|
||||
|
||||
if (restPath != null)
|
||||
{
|
||||
|
|
|
@ -1065,11 +1065,11 @@ namespace Emby.Server.Implementations.Library
|
|||
await RootFolder.RefreshMetadata(cancellationToken).ConfigureAwait(false);
|
||||
|
||||
// Start by just validating the children of the root, but go no further
|
||||
await RootFolder.ValidateChildren(new SimpleProgress<double>(), cancellationToken, new MetadataRefreshOptions(_fileSystem), recursive: false);
|
||||
await RootFolder.ValidateChildren(new SimpleProgress<double>(), cancellationToken, new MetadataRefreshOptions(new DirectoryService(_logger, _fileSystem)), recursive: false);
|
||||
|
||||
await GetUserRootFolder().RefreshMetadata(cancellationToken).ConfigureAwait(false);
|
||||
|
||||
await GetUserRootFolder().ValidateChildren(new SimpleProgress<double>(), cancellationToken, new MetadataRefreshOptions(_fileSystem), recursive: false).ConfigureAwait(false);
|
||||
await GetUserRootFolder().ValidateChildren(new SimpleProgress<double>(), cancellationToken, new MetadataRefreshOptions(new DirectoryService(_logger, _fileSystem)), recursive: false).ConfigureAwait(false);
|
||||
|
||||
// Quickly scan CollectionFolders for changes
|
||||
foreach (var folder in GetUserRootFolder().Children.OfType<Folder>().ToList())
|
||||
|
@ -1089,7 +1089,7 @@ namespace Emby.Server.Implementations.Library
|
|||
innerProgress.RegisterAction(pct => progress.Report(pct * .96));
|
||||
|
||||
// Now validate the entire media library
|
||||
await RootFolder.ValidateChildren(innerProgress, cancellationToken, new MetadataRefreshOptions(_fileSystem), recursive: true).ConfigureAwait(false);
|
||||
await RootFolder.ValidateChildren(innerProgress, cancellationToken, new MetadataRefreshOptions(new DirectoryService(_logger, _fileSystem)), recursive: true).ConfigureAwait(false);
|
||||
|
||||
progress.Report(96);
|
||||
|
||||
|
@ -2176,7 +2176,7 @@ namespace Emby.Server.Implementations.Library
|
|||
if (refresh)
|
||||
{
|
||||
item.UpdateToRepository(ItemUpdateType.MetadataImport, CancellationToken.None);
|
||||
_providerManagerFactory().QueueRefresh(item.Id, new MetadataRefreshOptions(_fileSystem), RefreshPriority.Normal);
|
||||
_providerManagerFactory().QueueRefresh(item.Id, new MetadataRefreshOptions(new DirectoryService(_logger, _fileSystem)), RefreshPriority.Normal);
|
||||
}
|
||||
|
||||
return item;
|
||||
|
@ -2231,7 +2231,7 @@ namespace Emby.Server.Implementations.Library
|
|||
|
||||
if (refresh)
|
||||
{
|
||||
_providerManagerFactory().QueueRefresh(item.Id, new MetadataRefreshOptions(_fileSystem)
|
||||
_providerManagerFactory().QueueRefresh(item.Id, new MetadataRefreshOptions(new DirectoryService(_logger, _fileSystem))
|
||||
{
|
||||
// Need to force save to increment DateLastSaved
|
||||
ForceSave = true
|
||||
|
@ -2295,7 +2295,7 @@ namespace Emby.Server.Implementations.Library
|
|||
|
||||
if (refresh)
|
||||
{
|
||||
_providerManagerFactory().QueueRefresh(item.Id, new MetadataRefreshOptions(_fileSystem)
|
||||
_providerManagerFactory().QueueRefresh(item.Id, new MetadataRefreshOptions(new DirectoryService(_logger, _fileSystem))
|
||||
{
|
||||
// Need to force save to increment DateLastSaved
|
||||
ForceSave = true
|
||||
|
@ -2369,7 +2369,7 @@ namespace Emby.Server.Implementations.Library
|
|||
|
||||
if (refresh)
|
||||
{
|
||||
_providerManagerFactory().QueueRefresh(item.Id, new MetadataRefreshOptions(_fileSystem)
|
||||
_providerManagerFactory().QueueRefresh(item.Id, new MetadataRefreshOptions(new DirectoryService(_logger, _fileSystem))
|
||||
{
|
||||
// Need to force save to increment DateLastSaved
|
||||
ForceSave = true
|
||||
|
|
|
@ -4,6 +4,7 @@ using MediaBrowser.Controller.Entities.Audio;
|
|||
using MediaBrowser.Controller.Library;
|
||||
using MediaBrowser.Controller.MediaEncoding;
|
||||
using MediaBrowser.Controller.Persistence;
|
||||
using MediaBrowser.Controller.Providers;
|
||||
using MediaBrowser.Model.Dto;
|
||||
using MediaBrowser.Model.Entities;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
@ -127,7 +128,7 @@ namespace Emby.Server.Implementations.Library
|
|||
|
||||
if (allowMediaProbe && mediaSources[0].Type != MediaSourceType.Placeholder && !mediaSources[0].MediaStreams.Any(i => i.Type == MediaStreamType.Audio || i.Type == MediaStreamType.Video))
|
||||
{
|
||||
await item.RefreshMetadata(new MediaBrowser.Controller.Providers.MetadataRefreshOptions(_fileSystem)
|
||||
await item.RefreshMetadata(new MediaBrowser.Controller.Providers.MetadataRefreshOptions(new DirectoryService(_logger, _fileSystem))
|
||||
{
|
||||
EnableRemoteContentProbe = true,
|
||||
MetadataRefreshMode = MediaBrowser.Controller.Providers.MetadataRefreshMode.FullRefresh
|
||||
|
|
|
@ -613,7 +613,7 @@ namespace Emby.Server.Implementations.Library
|
|||
{
|
||||
foreach (var user in Users)
|
||||
{
|
||||
await user.RefreshMetadata(new MetadataRefreshOptions(_fileSystem), cancellationToken).ConfigureAwait(false);
|
||||
await user.RefreshMetadata(new MetadataRefreshOptions(new DirectoryService(_logger, _fileSystem)), cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -64,7 +64,7 @@ namespace Emby.Server.Implementations.Library.Validators
|
|||
{
|
||||
var item = _libraryManager.GetPerson(person);
|
||||
|
||||
var options = new MetadataRefreshOptions(_fileSystem)
|
||||
var options = new MetadataRefreshOptions(new DirectoryService(_logger, _fileSystem))
|
||||
{
|
||||
ImageRefreshMode = MetadataRefreshMode.ValidationOnly,
|
||||
MetadataRefreshMode = MetadataRefreshMode.ValidationOnly
|
||||
|
|
|
@ -1526,7 +1526,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
|
|||
{
|
||||
_logger.LogInformation("Refreshing recording parent {0}", item.Path);
|
||||
|
||||
_providerManager.QueueRefresh(item.Id, new MetadataRefreshOptions(_fileSystem)
|
||||
_providerManager.QueueRefresh(item.Id, new MetadataRefreshOptions(new DirectoryService(_logger, _fileSystem))
|
||||
{
|
||||
RefreshPaths = new string[]
|
||||
{
|
||||
|
|
|
@ -1292,7 +1292,7 @@ namespace Emby.Server.Implementations.LiveTv
|
|||
}
|
||||
|
||||
//currentChannel.UpdateToRepository(ItemUpdateType.MetadataImport, cancellationToken);
|
||||
await currentChannel.RefreshMetadata(new MetadataRefreshOptions(_fileSystem)
|
||||
await currentChannel.RefreshMetadata(new MetadataRefreshOptions(new DirectoryService(_logger, _fileSystem))
|
||||
{
|
||||
ForceSave = true
|
||||
|
||||
|
|
|
@ -136,7 +136,7 @@ namespace Emby.Server.Implementations.Playlists
|
|||
|
||||
parentFolder.AddChild(playlist, CancellationToken.None);
|
||||
|
||||
await playlist.RefreshMetadata(new MetadataRefreshOptions(_fileSystem) { ForceSave = true }, CancellationToken.None)
|
||||
await playlist.RefreshMetadata(new MetadataRefreshOptions(new DirectoryService(_logger, _fileSystem)) { ForceSave = true }, CancellationToken.None)
|
||||
.ConfigureAwait(false);
|
||||
|
||||
if (options.ItemIdList.Length > 0)
|
||||
|
@ -217,7 +217,7 @@ namespace Emby.Server.Implementations.Playlists
|
|||
SavePlaylistFile(playlist);
|
||||
}
|
||||
|
||||
_providerManager.QueueRefresh(playlist.Id, new MetadataRefreshOptions(_fileSystem)
|
||||
_providerManager.QueueRefresh(playlist.Id, new MetadataRefreshOptions(new DirectoryService(_logger, _fileSystem))
|
||||
{
|
||||
ForceSave = true
|
||||
|
||||
|
@ -250,7 +250,7 @@ namespace Emby.Server.Implementations.Playlists
|
|||
SavePlaylistFile(playlist);
|
||||
}
|
||||
|
||||
_providerManager.QueueRefresh(playlist.Id, new MetadataRefreshOptions(_fileSystem)
|
||||
_providerManager.QueueRefresh(playlist.Id, new MetadataRefreshOptions(new DirectoryService(_logger, _fileSystem))
|
||||
{
|
||||
ForceSave = true
|
||||
|
||||
|
|
|
@ -121,7 +121,7 @@ namespace Emby.Server.Implementations.ScheduledTasks
|
|||
previouslyFailedImages = new List<string>();
|
||||
}
|
||||
|
||||
var directoryService = new DirectoryService(_fileSystem);
|
||||
var directoryService = new DirectoryService(_logger, _fileSystem);
|
||||
|
||||
foreach (var video in videos)
|
||||
{
|
||||
|
|
|
@ -99,7 +99,7 @@ namespace Emby.Server.Implementations.Services
|
|||
pathsAtFirstMatch.Add(restPath);
|
||||
}
|
||||
|
||||
public RestPath GetRestPathForRequest(string httpMethod, string pathInfo, ILogger logger)
|
||||
public RestPath GetRestPathForRequest(string httpMethod, string pathInfo)
|
||||
{
|
||||
var matchUsingPathParts = RestPath.GetPathPartsForMatching(pathInfo);
|
||||
|
||||
|
@ -117,7 +117,7 @@ namespace Emby.Server.Implementations.Services
|
|||
RestPath bestMatch = null;
|
||||
foreach (var restPath in firstMatches)
|
||||
{
|
||||
var score = restPath.MatchScore(httpMethod, matchUsingPathParts, logger);
|
||||
var score = restPath.MatchScore(httpMethod, matchUsingPathParts);
|
||||
if (score > bestScore)
|
||||
{
|
||||
bestScore = score;
|
||||
|
@ -140,7 +140,7 @@ namespace Emby.Server.Implementations.Services
|
|||
RestPath bestMatch = null;
|
||||
foreach (var restPath in firstMatches)
|
||||
{
|
||||
var score = restPath.MatchScore(httpMethod, matchUsingPathParts, logger);
|
||||
var score = restPath.MatchScore(httpMethod, matchUsingPathParts);
|
||||
if (score > bestScore)
|
||||
{
|
||||
bestScore = score;
|
||||
|
|
|
@ -24,11 +24,11 @@ namespace Emby.Server.Implementations.Services
|
|||
return Task.FromResult(host.CreateInstance(requestType));
|
||||
}
|
||||
|
||||
public static RestPath FindMatchingRestPath(string httpMethod, string pathInfo, ILogger logger, out string contentType)
|
||||
public static RestPath FindMatchingRestPath(string httpMethod, string pathInfo, out string contentType)
|
||||
{
|
||||
pathInfo = GetSanitizedPathInfo(pathInfo, out contentType);
|
||||
|
||||
return ServiceController.Instance.GetRestPathForRequest(httpMethod, pathInfo, logger);
|
||||
return ServiceController.Instance.GetRestPathForRequest(httpMethod, pathInfo);
|
||||
}
|
||||
|
||||
public static string GetSanitizedPathInfo(string pathInfo, out string contentType)
|
||||
|
@ -63,8 +63,7 @@ namespace Emby.Server.Implementations.Services
|
|||
if (this.RestPath == null)
|
||||
{
|
||||
string contentType;
|
||||
// TODO: @bond NullLogger
|
||||
this.RestPath = FindMatchingRestPath(httpMethod, pathInfo, null, out contentType);
|
||||
this.RestPath = FindMatchingRestPath(httpMethod, pathInfo, out contentType);
|
||||
|
||||
if (contentType != null)
|
||||
ResponseContentType = contentType;
|
||||
|
|
|
@ -309,10 +309,10 @@ namespace Emby.Server.Implementations.Services
|
|||
|
||||
private readonly Dictionary<string, string> propertyNamesMap = new Dictionary<string, string>();
|
||||
|
||||
public int MatchScore(string httpMethod, string[] withPathInfoParts, ILogger logger)
|
||||
public int MatchScore(string httpMethod, string[] withPathInfoParts)
|
||||
{
|
||||
int wildcardMatchCount;
|
||||
var isMatch = IsMatch(httpMethod, withPathInfoParts, logger, out wildcardMatchCount);
|
||||
var isMatch = IsMatch(httpMethod, withPathInfoParts, out wildcardMatchCount);
|
||||
if (!isMatch)
|
||||
{
|
||||
return -1;
|
||||
|
@ -348,31 +348,27 @@ namespace Emby.Server.Implementations.Services
|
|||
/// For performance withPathInfoParts should already be a lower case string
|
||||
/// to minimize redundant matching operations.
|
||||
/// </summary>
|
||||
public bool IsMatch(string httpMethod, string[] withPathInfoParts, ILogger logger, out int wildcardMatchCount)
|
||||
public bool IsMatch(string httpMethod, string[] withPathInfoParts, out int wildcardMatchCount)
|
||||
{
|
||||
wildcardMatchCount = 0;
|
||||
|
||||
if (withPathInfoParts.Length != this.PathComponentsCount && !this.IsWildCardPath)
|
||||
{
|
||||
//logger.LogInformation("withPathInfoParts mismatch for {0} for {1}", httpMethod, string.Join("/", withPathInfoParts));
|
||||
return false;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!Verbs.Contains(httpMethod, StringComparer.OrdinalIgnoreCase))
|
||||
{
|
||||
//logger.LogInformation("allowsAllVerbs mismatch for {0} for {1} allowedverbs {2}", httpMethod, string.Join("/", withPathInfoParts), this.allowedVerbs);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!ExplodeComponents(ref withPathInfoParts))
|
||||
{
|
||||
//logger.LogInformation("ExplodeComponents mismatch for {0} for {1}", httpMethod, string.Join("/", withPathInfoParts));
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this.TotalComponentsCount != withPathInfoParts.Length && !this.IsWildCardPath)
|
||||
{
|
||||
//logger.LogInformation("TotalComponentsCount mismatch for {0} for {1}", httpMethod, string.Join("/", withPathInfoParts));
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -393,7 +389,6 @@ namespace Emby.Server.Implementations.Services
|
|||
// Ensure there are still enough parts left to match the remainder
|
||||
if ((withPathInfoParts.Length - pathIx) < (this.TotalComponentsCount - i - 1))
|
||||
{
|
||||
//logger.LogInformation("withPathInfoParts length mismatch for {0} for {1}", httpMethod, string.Join("/", withPathInfoParts));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -416,7 +411,6 @@ namespace Emby.Server.Implementations.Services
|
|||
|
||||
if (withPathInfoParts.Length <= pathIx || !LiteralsEqual(withPathInfoParts[pathIx], literalToMatch))
|
||||
{
|
||||
//logger.LogInformation("withPathInfoParts2 length mismatch for {0} for {1}. not equals: {2} != {3}.", httpMethod, string.Join("/", withPathInfoParts), withPathInfoParts[pathIx], literalToMatch);
|
||||
return false;
|
||||
}
|
||||
pathIx++;
|
||||
|
|
|
@ -240,7 +240,7 @@ namespace MediaBrowser.Api
|
|||
//item.ProductionYear = request.ProductionYear;
|
||||
//item.Name = request.Name;
|
||||
|
||||
return _providerManager.RefreshFullItem(item, new MetadataRefreshOptions(_fileSystem)
|
||||
return _providerManager.RefreshFullItem(item, new MetadataRefreshOptions(new DirectoryService(Logger, _fileSystem))
|
||||
{
|
||||
MetadataRefreshMode = MetadataRefreshMode.FullRefresh,
|
||||
ImageRefreshMode = MetadataRefreshMode.FullRefresh,
|
||||
|
|
|
@ -230,7 +230,7 @@ namespace MediaBrowser.Api
|
|||
|
||||
if (displayOrderChanged)
|
||||
{
|
||||
_providerManager.QueueRefresh(series.Id, new MetadataRefreshOptions(_fileSystem)
|
||||
_providerManager.QueueRefresh(series.Id, new MetadataRefreshOptions(new DirectoryService(Logger, _fileSystem))
|
||||
{
|
||||
MetadataRefreshMode = MetadataRefreshMode.FullRefresh,
|
||||
ImageRefreshMode = MetadataRefreshMode.FullRefresh,
|
||||
|
|
|
@ -274,7 +274,7 @@ namespace MediaBrowser.Api.Subtitles
|
|||
await _subtitleManager.DownloadSubtitles(video, request.SubtitleId, CancellationToken.None)
|
||||
.ConfigureAwait(false);
|
||||
|
||||
_providerManager.QueueRefresh(video.Id, new MetadataRefreshOptions(_fileSystem), RefreshPriority.High);
|
||||
_providerManager.QueueRefresh(video.Id, new MetadataRefreshOptions(new DirectoryService(Logger, _fileSystem)), RefreshPriority.High);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
|
|
@ -404,7 +404,7 @@ namespace MediaBrowser.Api.UserLibrary
|
|||
|
||||
if (!hasMetdata)
|
||||
{
|
||||
var options = new MetadataRefreshOptions(_fileSystem)
|
||||
var options = new MetadataRefreshOptions(new DirectoryService(Logger, _fileSystem))
|
||||
{
|
||||
MetadataRefreshMode = MetadataRefreshMode.FullRefresh,
|
||||
ImageRefreshMode = MetadataRefreshMode.FullRefresh,
|
||||
|
|
|
@ -2213,7 +2213,7 @@ namespace MediaBrowser.Controller.Entities
|
|||
/// <returns>Task.</returns>
|
||||
public virtual void ChangedExternally()
|
||||
{
|
||||
ProviderManager.QueueRefresh(Id, new MetadataRefreshOptions(FileSystem)
|
||||
ProviderManager.QueueRefresh(Id, new MetadataRefreshOptions(new DirectoryService(Logger, FileSystem))
|
||||
{
|
||||
|
||||
}, RefreshPriority.High);
|
||||
|
|
|
@ -26,11 +26,6 @@ namespace MediaBrowser.Controller.Providers
|
|||
_fileSystem = fileSystem;
|
||||
}
|
||||
|
||||
public DirectoryService(IFileSystem fileSystem)
|
||||
: this(null, fileSystem) // TODO: @bond NullLogger
|
||||
{
|
||||
}
|
||||
|
||||
public FileSystemMetadata[] GetFileSystemEntries(string path)
|
||||
{
|
||||
FileSystemMetadata[] entries;
|
||||
|
|
|
@ -24,11 +24,6 @@ namespace MediaBrowser.Controller.Providers
|
|||
public bool ForceSave { get; set; }
|
||||
public bool EnableRemoteContentProbe { get; set; }
|
||||
|
||||
public MetadataRefreshOptions(IFileSystem fileSystem)
|
||||
: this(new DirectoryService(null, fileSystem)) // TODO: @bond NullLogger
|
||||
{
|
||||
}
|
||||
|
||||
public MetadataRefreshOptions(IDirectoryService directoryService)
|
||||
: base(directoryService)
|
||||
{
|
||||
|
|
|
@ -329,7 +329,11 @@ namespace MediaBrowser.Providers.Manager
|
|||
var options = GetMetadataOptions(item);
|
||||
var libraryOptions = _libraryManagerFactory().GetLibraryOptions(item);
|
||||
|
||||
return GetImageProviders(item, libraryOptions, options, new ImageRefreshOptions(new DirectoryService(_logger, _fileSystem)), includeDisabled).OfType<IRemoteImageProvider>();
|
||||
return GetImageProviders(item, libraryOptions, options,
|
||||
new ImageRefreshOptions(
|
||||
new DirectoryService(_logger, _fileSystem)),
|
||||
includeDisabled)
|
||||
.OfType<IRemoteImageProvider>();
|
||||
}
|
||||
|
||||
private bool CanRefresh(IMetadataProvider provider, BaseItem item, LibraryOptions libraryOptions, MetadataOptions options, bool includeDisabled, bool forceEnableInternetMetadata)
|
||||
|
@ -506,7 +510,11 @@ namespace MediaBrowser.Providers.Manager
|
|||
|
||||
var libraryOptions = new LibraryOptions();
|
||||
|
||||
var imageProviders = GetImageProviders(dummy, libraryOptions, options, new ImageRefreshOptions(new DirectoryService(_logger, _fileSystem)), true).ToList();
|
||||
var imageProviders = GetImageProviders(dummy, libraryOptions, options,
|
||||
new ImageRefreshOptions(
|
||||
new DirectoryService(_logger, _fileSystem)),
|
||||
true)
|
||||
.ToList();
|
||||
|
||||
var pluginList = summary.Plugins.ToList();
|
||||
|
||||
|
|
|
@ -147,7 +147,7 @@ namespace MediaBrowser.Providers.TV
|
|||
|
||||
series.AddChild(season, cancellationToken);
|
||||
|
||||
await season.RefreshMetadata(new MetadataRefreshOptions(_fileSystem), cancellationToken).ConfigureAwait(false);
|
||||
await season.RefreshMetadata(new MetadataRefreshOptions(new DirectoryService(_logger, _fileSystem)), cancellationToken).ConfigureAwait(false);
|
||||
|
||||
return season;
|
||||
}
|
||||
|
|
|
@ -414,7 +414,7 @@ namespace MediaBrowser.Providers.TV
|
|||
|
||||
season.AddChild(episode, cancellationToken);
|
||||
|
||||
await episode.RefreshMetadata(new MetadataRefreshOptions(_fileSystem), cancellationToken).ConfigureAwait(false);
|
||||
await episode.RefreshMetadata(new MetadataRefreshOptions(new DirectoryService(_logger, _fileSystem)), cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -58,12 +58,6 @@ namespace SocketHttpListener.Net
|
|||
auth_schemes = AuthenticationSchemes.Anonymous;
|
||||
}
|
||||
|
||||
// TODO: @bond NullLogger
|
||||
public HttpListener(X509Certificate certificate, ICryptoProvider cryptoProvider, ISocketFactory socketFactory, INetworkManager networkManager, ITextEncoding textEncoding, IStreamHelper streamHelper, IFileSystem fileSystem, IEnvironmentInfo environmentInfo)
|
||||
:this(null, certificate, cryptoProvider, socketFactory, networkManager, textEncoding, streamHelper, fileSystem, environmentInfo)
|
||||
{
|
||||
}
|
||||
|
||||
public HttpListener(ILogger logger, X509Certificate certificate, ICryptoProvider cryptoProvider, ISocketFactory socketFactory, INetworkManager networkManager, ITextEncoding textEncoding, IStreamHelper streamHelper, IFileSystem fileSystem, IEnvironmentInfo environmentInfo)
|
||||
: this(logger, cryptoProvider, socketFactory, networkManager, textEncoding, streamHelper, fileSystem, environmentInfo)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue
Block a user