commit
443218e3f1
1
.gitattributes
vendored
Normal file
1
.gitattributes
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
CONTRIBUTORS.md merge=union
|
|
@ -1,4 +0,0 @@
|
|||
1. Don't sneakily relicense free software.
|
||||
2. Don't continually nag users to give you money.
|
||||
3. Don't hide binary blobs in otherwise free software.
|
||||
4. Don't needlessly obfuscate the build process or any other part of free software.
|
|
@ -4,6 +4,10 @@
|
|||
- [nvllsvm](https://github.com/nvllsvm)
|
||||
- [JustAMan](https://github.com/JustAMan)
|
||||
- [dcrdev](https://github.com/dcrdev)
|
||||
- [EraYaN](https://github.com/EraYaN)
|
||||
- [flemse](https://github.com/flemse)
|
||||
- [bfayers](https://github.com/bfayers)
|
||||
- [Bond_009](https://github.com/Bond-009)
|
||||
|
||||
# Emby Contributors
|
||||
|
||||
|
|
|
@ -2,9 +2,9 @@
|
|||
using MediaBrowser.Controller.Configuration;
|
||||
using MediaBrowser.Controller.Dlna;
|
||||
using Emby.Dlna.Service;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using System.Collections.Generic;
|
||||
using MediaBrowser.Model.Xml;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace Emby.Dlna.ConnectionManager
|
||||
{
|
||||
|
|
|
@ -3,7 +3,7 @@ using MediaBrowser.Controller.Configuration;
|
|||
using Emby.Dlna.Server;
|
||||
using Emby.Dlna.Service;
|
||||
using MediaBrowser.Model.Dlna;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using MediaBrowser.Model.Xml;
|
||||
|
|
|
@ -6,7 +6,7 @@ using MediaBrowser.Controller.Entities;
|
|||
using MediaBrowser.Controller.Library;
|
||||
using Emby.Dlna.Service;
|
||||
using MediaBrowser.Model.Dlna;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using MediaBrowser.Controller.MediaEncoding;
|
||||
|
|
|
@ -12,7 +12,7 @@ using Emby.Dlna.Service;
|
|||
using MediaBrowser.Model.Configuration;
|
||||
using MediaBrowser.Model.Dlna;
|
||||
using MediaBrowser.Model.Entities;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using MediaBrowser.Model.Querying;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
@ -68,7 +68,7 @@ namespace Emby.Dlna.ContentDirectory
|
|||
_profile = profile;
|
||||
_config = config;
|
||||
|
||||
_didlBuilder = new DidlBuilder(profile, user, imageProcessor, serverAddress, accessToken, userDataManager, localization, mediaSourceManager, Logger, libraryManager, mediaEncoder);
|
||||
_didlBuilder = new DidlBuilder(profile, user, imageProcessor, serverAddress, accessToken, userDataManager, localization, mediaSourceManager, _logger, libraryManager, mediaEncoder);
|
||||
}
|
||||
|
||||
protected override IEnumerable<KeyValuePair<string, string>> GetResult(string methodName, IDictionary<string, string> methodParams)
|
||||
|
@ -467,7 +467,7 @@ namespace Emby.Dlna.ContentDirectory
|
|||
IsMissing = false,
|
||||
ExcludeItemTypes = new[] { typeof(Game).Name, typeof(Book).Name },
|
||||
IsFolder = isFolder,
|
||||
MediaTypes = mediaTypes.ToArray(mediaTypes.Count),
|
||||
MediaTypes = mediaTypes.ToArray(),
|
||||
DtoOptions = GetDtoOptions()
|
||||
});
|
||||
}
|
||||
|
@ -676,7 +676,7 @@ namespace Emby.Dlna.ContentDirectory
|
|||
|
||||
return new QueryResult<ServerItem>
|
||||
{
|
||||
Items = list.ToArray(list.Count),
|
||||
Items = list.ToArray(),
|
||||
TotalRecordCount = list.Count
|
||||
};
|
||||
}
|
||||
|
@ -754,7 +754,7 @@ namespace Emby.Dlna.ContentDirectory
|
|||
|
||||
return new QueryResult<ServerItem>
|
||||
{
|
||||
Items = list.ToArray(list.Count),
|
||||
Items = list.ToArray(),
|
||||
TotalRecordCount = list.Count
|
||||
};
|
||||
}
|
||||
|
@ -859,7 +859,7 @@ namespace Emby.Dlna.ContentDirectory
|
|||
|
||||
return new QueryResult<ServerItem>
|
||||
{
|
||||
Items = list.ToArray(list.Count),
|
||||
Items = list.ToArray(),
|
||||
TotalRecordCount = list.Count
|
||||
};
|
||||
}
|
||||
|
@ -1026,7 +1026,7 @@ namespace Emby.Dlna.ContentDirectory
|
|||
var result = new QueryResult<BaseItem>
|
||||
{
|
||||
TotalRecordCount = genresResult.TotalRecordCount,
|
||||
Items = genresResult.Items.Select(i => i.Item1).ToArray(genresResult.Items.Length)
|
||||
Items = genresResult.Items.Select(i => i.Item1).ToArray()
|
||||
};
|
||||
|
||||
return ToResult(result);
|
||||
|
@ -1044,7 +1044,7 @@ namespace Emby.Dlna.ContentDirectory
|
|||
var result = new QueryResult<BaseItem>
|
||||
{
|
||||
TotalRecordCount = genresResult.TotalRecordCount,
|
||||
Items = genresResult.Items.Select(i => i.Item1).ToArray(genresResult.Items.Length)
|
||||
Items = genresResult.Items.Select(i => i.Item1).ToArray()
|
||||
};
|
||||
|
||||
return ToResult(result);
|
||||
|
@ -1062,7 +1062,7 @@ namespace Emby.Dlna.ContentDirectory
|
|||
var result = new QueryResult<BaseItem>
|
||||
{
|
||||
TotalRecordCount = artists.TotalRecordCount,
|
||||
Items = artists.Items.Select(i => i.Item1).ToArray(artists.Items.Length)
|
||||
Items = artists.Items.Select(i => i.Item1).ToArray()
|
||||
};
|
||||
|
||||
return ToResult(result);
|
||||
|
@ -1080,7 +1080,7 @@ namespace Emby.Dlna.ContentDirectory
|
|||
var result = new QueryResult<BaseItem>
|
||||
{
|
||||
TotalRecordCount = artists.TotalRecordCount,
|
||||
Items = artists.Items.Select(i => i.Item1).ToArray(artists.Items.Length)
|
||||
Items = artists.Items.Select(i => i.Item1).ToArray()
|
||||
};
|
||||
|
||||
return ToResult(result);
|
||||
|
@ -1099,7 +1099,7 @@ namespace Emby.Dlna.ContentDirectory
|
|||
var result = new QueryResult<BaseItem>
|
||||
{
|
||||
TotalRecordCount = artists.TotalRecordCount,
|
||||
Items = artists.Items.Select(i => i.Item1).ToArray(artists.Items.Length)
|
||||
Items = artists.Items.Select(i => i.Item1).ToArray()
|
||||
};
|
||||
|
||||
return ToResult(result);
|
||||
|
@ -1247,7 +1247,7 @@ namespace Emby.Dlna.ContentDirectory
|
|||
{
|
||||
var serverItems = result
|
||||
.Select(i => new ServerItem(i))
|
||||
.ToArray(result.Length);
|
||||
.ToArray();
|
||||
|
||||
return new QueryResult<ServerItem>
|
||||
{
|
||||
|
@ -1334,7 +1334,7 @@ namespace Emby.Dlna.ContentDirectory
|
|||
};
|
||||
}
|
||||
|
||||
Logger.Error("Error parsing item Id: {0}. Returning user root folder.", id);
|
||||
_logger.LogError("Error parsing item Id: {id}. Returning user root folder.", id);
|
||||
|
||||
return new ServerItem(_libraryManager.GetUserRootFolder());
|
||||
}
|
||||
|
|
|
@ -11,7 +11,7 @@ using Emby.Dlna.ContentDirectory;
|
|||
using MediaBrowser.Model.Dlna;
|
||||
using MediaBrowser.Model.Drawing;
|
||||
using MediaBrowser.Model.Entities;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using MediaBrowser.Model.Net;
|
||||
using System;
|
||||
using System.Globalization;
|
||||
|
@ -173,16 +173,6 @@ namespace Emby.Dlna.Didl
|
|||
writer.WriteFullEndElement();
|
||||
}
|
||||
|
||||
private ILogger GetStreamBuilderLogger(DlnaOptions options)
|
||||
{
|
||||
if (options.EnableDebugLog)
|
||||
{
|
||||
return _logger;
|
||||
}
|
||||
|
||||
return new 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,10 +499,10 @@ 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(sources.Count),
|
||||
MediaSources = sources.ToArray(),
|
||||
Profile = _profile,
|
||||
DeviceId = deviceId
|
||||
});
|
||||
|
@ -923,9 +913,9 @@ namespace Emby.Dlna.Didl
|
|||
|
||||
writer.WriteFullEndElement();
|
||||
}
|
||||
catch (XmlException)
|
||||
catch (XmlException ex)
|
||||
{
|
||||
//_logger.Error("Error adding xml value: " + value);
|
||||
_logger.LogError(ex, "Error adding xml value: {value}", name);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -935,9 +925,9 @@ namespace Emby.Dlna.Didl
|
|||
{
|
||||
writer.WriteElementString(prefix, name, namespaceUri, value);
|
||||
}
|
||||
catch (XmlException)
|
||||
catch (XmlException ex)
|
||||
{
|
||||
//_logger.Error("Error adding xml value: " + value);
|
||||
_logger.LogError(ex, "Error adding xml value: {value}", value);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1080,9 +1070,9 @@ namespace Emby.Dlna.Didl
|
|||
{
|
||||
tag = _imageProcessor.GetImageCacheTag(item, type);
|
||||
}
|
||||
catch
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
_logger.LogError(ex, "Error getting image cache tag");
|
||||
}
|
||||
|
||||
int? width = imageInfo.Width;
|
||||
|
|
|
@ -8,7 +8,7 @@ using Emby.Dlna.Profiles;
|
|||
using Emby.Dlna.Server;
|
||||
using MediaBrowser.Model.Dlna;
|
||||
using MediaBrowser.Model.Drawing;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using MediaBrowser.Model.Serialization;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
@ -58,7 +58,7 @@ namespace Emby.Dlna
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.ErrorException("Error extracting DLNA profiles.", ex);
|
||||
_logger.LogError(ex, "Error extracting DLNA profiles.");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -103,7 +103,7 @@ namespace Emby.Dlna
|
|||
|
||||
if (profile != null)
|
||||
{
|
||||
_logger.Debug("Found matching device profile: {0}", profile.Name);
|
||||
_logger.LogDebug("Found matching device profile: {0}", profile.Name);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -117,6 +117,7 @@ namespace Emby.Dlna
|
|||
{
|
||||
var builder = new StringBuilder();
|
||||
|
||||
builder.AppendLine("No matching device profile found. The default will need to be used.");
|
||||
builder.AppendLine(string.Format("DeviceDescription:{0}", profile.DeviceDescription ?? string.Empty));
|
||||
builder.AppendLine(string.Format("FriendlyName:{0}", profile.FriendlyName ?? string.Empty));
|
||||
builder.AppendLine(string.Format("Manufacturer:{0}", profile.Manufacturer ?? string.Empty));
|
||||
|
@ -127,7 +128,7 @@ namespace Emby.Dlna
|
|||
builder.AppendLine(string.Format("ModelUrl:{0}", profile.ModelUrl ?? string.Empty));
|
||||
builder.AppendLine(string.Format("SerialNumber:{0}", profile.SerialNumber ?? string.Empty));
|
||||
|
||||
_logger.LogMultiline("No matching device profile found. The default will need to be used.", LogSeverity.Info, builder);
|
||||
_logger.LogInformation(builder.ToString());
|
||||
}
|
||||
|
||||
private bool IsMatch(DeviceIdentification deviceInfo, DeviceIdentification profileInfo)
|
||||
|
@ -197,7 +198,7 @@ namespace Emby.Dlna
|
|||
}
|
||||
catch (ArgumentException ex)
|
||||
{
|
||||
_logger.ErrorException("Error evaluating regex pattern {0}", ex, pattern);
|
||||
_logger.LogError(ex, "Error evaluating regex pattern {Pattern}", pattern);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -216,12 +217,12 @@ namespace Emby.Dlna
|
|||
|
||||
if (profile != null)
|
||||
{
|
||||
_logger.Debug("Found matching device profile: {0}", profile.Name);
|
||||
_logger.LogDebug("Found matching device profile: {0}", profile.Name);
|
||||
}
|
||||
else
|
||||
{
|
||||
var headerString = string.Join(", ", headers.Select(i => string.Format("{0}={1}", i.Key, i.Value)).ToArray());
|
||||
_logger.Debug("No matching device profile found. {0}", headerString);
|
||||
_logger.LogDebug("No matching device profile found. {0}", headerString);
|
||||
}
|
||||
|
||||
return profile;
|
||||
|
@ -250,7 +251,7 @@ namespace Emby.Dlna
|
|||
return string.Equals(value, header.Value, StringComparison.OrdinalIgnoreCase);
|
||||
case HeaderMatchType.Substring:
|
||||
var isMatch = value.IndexOf(header.Value, StringComparison.OrdinalIgnoreCase) != -1;
|
||||
//_logger.Debug("IsMatch-Substring value: {0} testValue: {1} isMatch: {2}", value, header.Value, isMatch);
|
||||
//_logger.LogDebug("IsMatch-Substring value: {0} testValue: {1} isMatch: {2}", value, header.Value, isMatch);
|
||||
return isMatch;
|
||||
case HeaderMatchType.Regex:
|
||||
return Regex.IsMatch(value, header.Value, RegexOptions.IgnoreCase);
|
||||
|
@ -323,7 +324,7 @@ namespace Emby.Dlna
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.ErrorException("Error parsing profile file: {0}", ex, path);
|
||||
_logger.LogError(ex, "Error parsing profile file: {Path}", path);
|
||||
|
||||
return null;
|
||||
}
|
||||
|
@ -530,8 +531,8 @@ namespace Emby.Dlna
|
|||
};
|
||||
}
|
||||
}
|
||||
|
||||
class DlnaProfileEntryPoint /*: IServerEntryPoint*/
|
||||
/*
|
||||
class DlnaProfileEntryPoint : IServerEntryPoint
|
||||
{
|
||||
private readonly IApplicationPaths _appPaths;
|
||||
private readonly IFileSystem _fileSystem;
|
||||
|
@ -551,7 +552,7 @@ namespace Emby.Dlna
|
|||
|
||||
private void DumpProfiles()
|
||||
{
|
||||
var list = new List<DeviceProfile>
|
||||
DeviceProfile[] list = new []
|
||||
{
|
||||
new SamsungSmartTvProfile(),
|
||||
new XboxOneProfile(),
|
||||
|
@ -596,5 +597,5 @@ namespace Emby.Dlna
|
|||
public void Dispose()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
using MediaBrowser.Common.Extensions;
|
||||
using MediaBrowser.Common.Net;
|
||||
using MediaBrowser.Controller.Dlna;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System;
|
||||
using System.Collections.Concurrent;
|
||||
using System.Collections.Generic;
|
||||
|
@ -34,7 +34,7 @@ namespace Emby.Dlna.Eventing
|
|||
|
||||
// Remove logging for now because some devices are sending this very frequently
|
||||
// TODO re-enable with dlna debug logging setting
|
||||
//_logger.Debug("Renewing event subscription for {0} with timeout of {1} to {2}",
|
||||
//_logger.LogDebug("Renewing event subscription for {0} with timeout of {1} to {2}",
|
||||
// subscription.NotificationType,
|
||||
// timeout,
|
||||
// subscription.CallbackUrl);
|
||||
|
@ -60,7 +60,7 @@ namespace Emby.Dlna.Eventing
|
|||
|
||||
// Remove logging for now because some devices are sending this very frequently
|
||||
// TODO re-enable with dlna debug logging setting
|
||||
//_logger.Debug("Creating event subscription for {0} with timeout of {1} to {2}",
|
||||
//_logger.LogDebug("Creating event subscription for {0} with timeout of {1} to {2}",
|
||||
// notificationType,
|
||||
// timeout,
|
||||
// callbackUrl);
|
||||
|
@ -96,7 +96,7 @@ namespace Emby.Dlna.Eventing
|
|||
|
||||
public EventSubscriptionResponse CancelEventSubscription(string subscriptionId)
|
||||
{
|
||||
_logger.Debug("Cancelling event subscription {0}", subscriptionId);
|
||||
_logger.LogDebug("Cancelling event subscription {0}", subscriptionId);
|
||||
|
||||
EventSubscription sub;
|
||||
_subscriptions.TryRemove(subscriptionId, out sub);
|
||||
|
|
|
@ -11,7 +11,7 @@ using MediaBrowser.Controller.Session;
|
|||
using MediaBrowser.Controller.TV;
|
||||
using Emby.Dlna.PlayTo;
|
||||
using Emby.Dlna.Ssdp;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
@ -64,7 +64,7 @@ namespace Emby.Dlna.Main
|
|||
public static DlnaEntryPoint Current;
|
||||
|
||||
public DlnaEntryPoint(IServerConfigurationManager config,
|
||||
ILogManager logManager,
|
||||
ILoggerFactory loggerFactory,
|
||||
IServerApplicationHost appHost,
|
||||
ISessionManager sessionManager,
|
||||
IHttpClient httpClient,
|
||||
|
@ -102,7 +102,7 @@ namespace Emby.Dlna.Main
|
|||
_timerFactory = timerFactory;
|
||||
_environmentInfo = environmentInfo;
|
||||
_networkManager = networkManager;
|
||||
_logger = logManager.GetLogger("Dlna");
|
||||
_logger = loggerFactory.CreateLogger("Dlna");
|
||||
|
||||
ContentDirectory = new ContentDirectory.ContentDirectory(dlnaManager,
|
||||
userDataManager,
|
||||
|
@ -185,13 +185,13 @@ namespace Emby.Dlna.Main
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.ErrorException("Error starting ssdp handlers", ex);
|
||||
_logger.LogError(ex, "Error starting ssdp handlers");
|
||||
}
|
||||
}
|
||||
|
||||
private void LogMessage(string msg)
|
||||
{
|
||||
_logger.Debug(msg);
|
||||
_logger.LogDebug(msg);
|
||||
}
|
||||
|
||||
private void StartDeviceDiscovery(ISsdpCommunicationsServer communicationsServer)
|
||||
|
@ -202,7 +202,7 @@ namespace Emby.Dlna.Main
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.ErrorException("Error starting device discovery", ex);
|
||||
_logger.LogError(ex, "Error starting device discovery");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -210,12 +210,12 @@ namespace Emby.Dlna.Main
|
|||
{
|
||||
try
|
||||
{
|
||||
_logger.Info("Disposing DeviceDiscovery");
|
||||
_logger.LogInformation("Disposing DeviceDiscovery");
|
||||
((DeviceDiscovery)_deviceDiscovery).Dispose();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.ErrorException("Error stopping device discovery", ex);
|
||||
_logger.LogError(ex, "Error stopping device discovery");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -243,7 +243,7 @@ namespace Emby.Dlna.Main
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.ErrorException("Error registering endpoint", ex);
|
||||
_logger.LogError(ex, "Error registering endpoint");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -263,7 +263,7 @@ namespace Emby.Dlna.Main
|
|||
|
||||
var fullService = "urn:schemas-upnp-org:device:MediaServer:1";
|
||||
|
||||
_logger.Info("Registering publisher for {0} on {1}", fullService, address.ToString());
|
||||
_logger.LogInformation("Registering publisher for {0} on {1}", fullService, address.ToString());
|
||||
|
||||
var descriptorUri = "/dlna/" + udn + "/description.xml";
|
||||
var uri = new Uri(_appHost.GetLocalApiUrl(address) + descriptorUri);
|
||||
|
@ -361,7 +361,7 @@ namespace Emby.Dlna.Main
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.ErrorException("Error starting PlayTo manager", ex);
|
||||
_logger.LogError(ex, "Error starting PlayTo manager");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -374,12 +374,12 @@ namespace Emby.Dlna.Main
|
|||
{
|
||||
try
|
||||
{
|
||||
_logger.Info("Disposing PlayToManager");
|
||||
_logger.LogInformation("Disposing PlayToManager");
|
||||
_manager.Dispose();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.ErrorException("Error disposing PlayTo manager", ex);
|
||||
_logger.LogError(ex, "Error disposing PlayTo manager");
|
||||
}
|
||||
_manager = null;
|
||||
}
|
||||
|
@ -394,7 +394,7 @@ namespace Emby.Dlna.Main
|
|||
|
||||
if (_communicationsServer != null)
|
||||
{
|
||||
_logger.Info("Disposing SsdpCommunicationsServer");
|
||||
_logger.LogInformation("Disposing SsdpCommunicationsServer");
|
||||
_communicationsServer.Dispose();
|
||||
_communicationsServer = null;
|
||||
}
|
||||
|
@ -409,7 +409,7 @@ namespace Emby.Dlna.Main
|
|||
{
|
||||
if (_Publisher != null)
|
||||
{
|
||||
_logger.Info("Disposing SsdpDevicePublisher");
|
||||
_logger.LogInformation("Disposing SsdpDevicePublisher");
|
||||
_Publisher.Dispose();
|
||||
_Publisher = null;
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
using MediaBrowser.Controller.Configuration;
|
||||
using Emby.Dlna.Server;
|
||||
using Emby.Dlna.Service;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using MediaBrowser.Model.Xml;
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
using MediaBrowser.Controller.Configuration;
|
||||
using MediaBrowser.Controller.Dlna;
|
||||
using Emby.Dlna.Service;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using MediaBrowser.Model.Xml;
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
using MediaBrowser.Controller.Configuration;
|
||||
using Emby.Dlna.Common;
|
||||
using Emby.Dlna.Ssdp;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using MediaBrowser.Model.Net;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
@ -108,7 +108,7 @@ namespace Emby.Dlna.PlayTo
|
|||
|
||||
public void Start()
|
||||
{
|
||||
_logger.Debug("Dlna Device.Start");
|
||||
_logger.LogDebug("Dlna Device.Start");
|
||||
_timer = _timerFactory.Create(TimerCallback, null, 1000, Timeout.Infinite);
|
||||
}
|
||||
|
||||
|
@ -140,7 +140,7 @@ namespace Emby.Dlna.PlayTo
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.ErrorException("Error updating device volume info for {0}", ex, Properties.Name);
|
||||
_logger.LogError(ex, "Error updating device volume info for {DeviceName}", Properties.Name);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -259,7 +259,7 @@ namespace Emby.Dlna.PlayTo
|
|||
return false;
|
||||
}
|
||||
|
||||
_logger.Debug("Setting mute");
|
||||
_logger.LogDebug("Setting mute");
|
||||
var value = mute ? 1 : 0;
|
||||
|
||||
await new SsdpHttpClient(_httpClient, _config).SendCommandAsync(Properties.BaseUrl, service, command.Name, rendererCommands.BuildPost(command, service.ServiceType, value))
|
||||
|
@ -323,7 +323,7 @@ namespace Emby.Dlna.PlayTo
|
|||
|
||||
url = url.Replace("&", "&");
|
||||
|
||||
_logger.Debug("{0} - SetAvTransport Uri: {1} DlnaHeaders: {2}", Properties.Name, url, header);
|
||||
_logger.LogDebug("{0} - SetAvTransport Uri: {1} DlnaHeaders: {2}", Properties.Name, url, header);
|
||||
|
||||
var command = avCommands.ServiceActions.FirstOrDefault(c => c.Name == "SetAVTransportURI");
|
||||
if (command == null)
|
||||
|
@ -507,7 +507,7 @@ namespace Emby.Dlna.PlayTo
|
|||
if (_disposed)
|
||||
return;
|
||||
|
||||
//_logger.ErrorException("Error updating device info for {0}", ex, Properties.Name);
|
||||
_logger.LogError(ex, "Error updating device info for {DeviceName}", Properties.Name);
|
||||
|
||||
_connectFailureCount++;
|
||||
|
||||
|
@ -516,7 +516,7 @@ namespace Emby.Dlna.PlayTo
|
|||
var action = OnDeviceUnavailable;
|
||||
if (action != null)
|
||||
{
|
||||
_logger.Debug("Disposing device due to loss of connection");
|
||||
_logger.LogDebug("Disposing device due to loss of connection");
|
||||
action();
|
||||
return;
|
||||
}
|
||||
|
@ -767,7 +767,7 @@ namespace Emby.Dlna.PlayTo
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.ErrorException("Unable to parse xml {0}", ex, trackString);
|
||||
_logger.LogError(ex, "Unable to parse xml {0}", trackString);
|
||||
return new Tuple<bool, uBaseObject>(true, null);
|
||||
}
|
||||
}
|
||||
|
@ -887,7 +887,7 @@ namespace Emby.Dlna.PlayTo
|
|||
string url = NormalizeUrl(Properties.BaseUrl, avService.ScpdUrl);
|
||||
|
||||
var httpClient = new SsdpHttpClient(_httpClient, _config);
|
||||
_logger.Debug("Dlna Device.GetRenderingProtocolAsync");
|
||||
_logger.LogDebug("Dlna Device.GetRenderingProtocolAsync");
|
||||
var document = await httpClient.GetDataAsync(url, cancellationToken).ConfigureAwait(false);
|
||||
|
||||
rendererCommands = TransportCommands.Create(document);
|
||||
|
@ -941,7 +941,7 @@ namespace Emby.Dlna.PlayTo
|
|||
if (room != null && !string.IsNullOrWhiteSpace(room.Value))
|
||||
friendlyNames.Add(room.Value);
|
||||
|
||||
deviceProperties.Name = string.Join(" ", friendlyNames.ToArray(friendlyNames.Count));
|
||||
deviceProperties.Name = string.Join(" ", friendlyNames.ToArray());
|
||||
|
||||
var model = document.Descendants(uPnpNamespaces.ud.GetName("modelName")).FirstOrDefault();
|
||||
if (model != null)
|
||||
|
|
|
@ -7,7 +7,7 @@ using Emby.Dlna.Didl;
|
|||
using MediaBrowser.Model.Dlna;
|
||||
using MediaBrowser.Model.Dto;
|
||||
using MediaBrowser.Model.Entities;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using MediaBrowser.Model.Session;
|
||||
using MediaBrowser.Model.System;
|
||||
using System;
|
||||
|
@ -156,7 +156,7 @@ namespace Emby.Dlna.PlayTo
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.ErrorException("Error reporting progress", ex);
|
||||
_logger.LogError(ex, "Error reporting progress");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -204,7 +204,7 @@ namespace Emby.Dlna.PlayTo
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.ErrorException("Error reporting playback stopped", ex);
|
||||
_logger.LogError(ex, "Error reporting playback stopped");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -223,7 +223,7 @@ namespace Emby.Dlna.PlayTo
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.ErrorException("Error reporting progress", ex);
|
||||
_logger.LogError(ex, "Error reporting progress");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -247,7 +247,7 @@ namespace Emby.Dlna.PlayTo
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.ErrorException("Error reporting progress", ex);
|
||||
_logger.LogError(ex, "Error reporting progress");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -278,7 +278,7 @@ namespace Emby.Dlna.PlayTo
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.ErrorException("Error reporting progress", ex);
|
||||
_logger.LogError(ex, "Error reporting progress");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -319,7 +319,7 @@ namespace Emby.Dlna.PlayTo
|
|||
|
||||
public async Task SendPlayCommand(PlayRequest command, CancellationToken cancellationToken)
|
||||
{
|
||||
_logger.Debug("{0} - Received PlayRequest: {1}", this._session.DeviceName, command.PlayCommand);
|
||||
_logger.LogDebug("{0} - Received PlayRequest: {1}", this._session.DeviceName, command.PlayCommand);
|
||||
|
||||
var user = command.ControllingUserId.Equals(Guid.Empty) ? null : _userManager.GetUserById(command.ControllingUserId);
|
||||
|
||||
|
@ -351,7 +351,7 @@ namespace Emby.Dlna.PlayTo
|
|||
}
|
||||
}
|
||||
|
||||
_logger.Debug("{0} - Playlist created", _session.DeviceName);
|
||||
_logger.LogDebug("{0} - Playlist created", _session.DeviceName);
|
||||
|
||||
if (command.PlayCommand == PlayCommand.PlayLast)
|
||||
{
|
||||
|
@ -532,23 +532,13 @@ namespace Emby.Dlna.PlayTo
|
|||
return null;
|
||||
}
|
||||
|
||||
private ILogger GetStreamBuilderLogger()
|
||||
{
|
||||
if (_config.GetDlnaConfiguration().EnableDebugLog)
|
||||
{
|
||||
return _logger;
|
||||
}
|
||||
|
||||
return new 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,10 +558,10 @@ 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(mediaSources.Count),
|
||||
MediaSources = mediaSources.ToArray(),
|
||||
Profile = profile,
|
||||
DeviceId = deviceId,
|
||||
MaxBitrate = profile.MaxStreamingBitrate,
|
||||
|
@ -599,7 +589,7 @@ namespace Emby.Dlna.PlayTo
|
|||
{
|
||||
Playlist.Clear();
|
||||
Playlist.AddRange(items);
|
||||
_logger.Debug("{0} - Playing {1} items", _session.DeviceName, Playlist.Count);
|
||||
_logger.LogDebug("{0} - Playing {1} items", _session.DeviceName, Playlist.Count);
|
||||
|
||||
await SetPlaylistIndex(0).ConfigureAwait(false);
|
||||
return true;
|
||||
|
|
|
@ -5,7 +5,7 @@ using MediaBrowser.Controller.Dlna;
|
|||
using MediaBrowser.Controller.Drawing;
|
||||
using MediaBrowser.Controller.Library;
|
||||
using MediaBrowser.Controller.Session;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using MediaBrowser.Model.Session;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
@ -93,7 +93,7 @@ namespace Emby.Dlna.PlayTo
|
|||
if (usn.IndexOf("MediaRenderer:", StringComparison.OrdinalIgnoreCase) == -1 &&
|
||||
nt.IndexOf("MediaRenderer:", StringComparison.OrdinalIgnoreCase) == -1)
|
||||
{
|
||||
//_logger.Debug("Upnp device {0} does not contain a MediaRenderer device (0).", location);
|
||||
//_logger.LogDebug("Upnp device {0} does not contain a MediaRenderer device (0).", location);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -121,7 +121,7 @@ namespace Emby.Dlna.PlayTo
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.ErrorException("Error creating PlayTo device.", ex);
|
||||
_logger.LogError(ex, "Error creating PlayTo device.");
|
||||
}
|
||||
finally
|
||||
{
|
||||
|
@ -155,9 +155,9 @@ namespace Emby.Dlna.PlayTo
|
|||
private async Task AddDevice(UpnpDeviceInfo info, string location, CancellationToken cancellationToken)
|
||||
{
|
||||
var uri = info.Location;
|
||||
_logger.Debug("Attempting to create PlayToController from location {0}", location);
|
||||
_logger.LogDebug("Attempting to create PlayToController from location {0}", location);
|
||||
|
||||
_logger.Debug("Logging session activity from location {0}", location);
|
||||
_logger.LogDebug("Logging session activity from location {0}", location);
|
||||
string uuid;
|
||||
if (info.Headers.TryGetValue("USN", out uuid))
|
||||
{
|
||||
|
@ -237,7 +237,7 @@ namespace Emby.Dlna.PlayTo
|
|||
SupportsMediaControl = true
|
||||
});
|
||||
|
||||
_logger.Info("DLNA Session created for {0} - {1}", device.Properties.Name, device.Properties.ModelName);
|
||||
_logger.LogInformation("DLNA Session created for {0} - {1}", device.Properties.Name, device.Properties.ModelName);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -173,7 +173,7 @@ namespace Emby.Dlna.Profiles
|
|||
Value = value
|
||||
});
|
||||
|
||||
XmlRootAttributes = list.ToArray(list.Count);
|
||||
XmlRootAttributes = list.ToArray();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
using MediaBrowser.Controller.Configuration;
|
||||
using MediaBrowser.Controller.Dlna;
|
||||
using Emby.Dlna.Server;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
@ -20,13 +20,13 @@ namespace Emby.Dlna.Service
|
|||
private const string NS_SOAPENV = "http://schemas.xmlsoap.org/soap/envelope/";
|
||||
|
||||
protected readonly IServerConfigurationManager Config;
|
||||
protected readonly ILogger Logger;
|
||||
protected readonly ILogger _logger;
|
||||
protected readonly IXmlReaderSettingsFactory XmlReaderSettingsFactory;
|
||||
|
||||
protected BaseControlHandler(IServerConfigurationManager config, ILogger logger, IXmlReaderSettingsFactory xmlReaderSettingsFactory)
|
||||
{
|
||||
Config = config;
|
||||
Logger = logger;
|
||||
_logger = logger;
|
||||
XmlReaderSettingsFactory = xmlReaderSettingsFactory;
|
||||
}
|
||||
|
||||
|
@ -52,7 +52,7 @@ namespace Emby.Dlna.Service
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.ErrorException("Error processing control request", ex);
|
||||
_logger.LogError(ex, "Error processing control request");
|
||||
|
||||
return new ControlErrorHandler().GetResponse(ex);
|
||||
}
|
||||
|
@ -76,7 +76,7 @@ namespace Emby.Dlna.Service
|
|||
}
|
||||
}
|
||||
|
||||
Logger.Debug("Received control request {0}", requestInfo.LocalName);
|
||||
_logger.LogDebug("Received control request {0}", requestInfo.LocalName);
|
||||
|
||||
var result = GetResult(requestInfo.LocalName, requestInfo.Headers);
|
||||
|
||||
|
@ -118,7 +118,7 @@ namespace Emby.Dlna.Service
|
|||
IsSuccessful = true
|
||||
};
|
||||
|
||||
//Logger.Debug(xml);
|
||||
//logger.LogDebug(xml);
|
||||
|
||||
controlResponse.Headers.Add("EXT", string.Empty);
|
||||
|
||||
|
@ -242,9 +242,9 @@ namespace Emby.Dlna.Service
|
|||
}
|
||||
|
||||
var originalHeaders = request.Headers;
|
||||
var headers = string.Join(", ", originalHeaders.Select(i => string.Format("{0}={1}", i.Key, i.Value)).ToArray(originalHeaders.Count));
|
||||
var headers = string.Join(", ", originalHeaders.Select(i => string.Format("{0}={1}", i.Key, i.Value)).ToArray());
|
||||
|
||||
Logger.Debug("Control request. Headers: {0}", headers);
|
||||
_logger.LogDebug("Control request. Headers: {0}", headers);
|
||||
}
|
||||
|
||||
private void LogResponse(ControlResponse response)
|
||||
|
@ -258,7 +258,7 @@ namespace Emby.Dlna.Service
|
|||
var headers = string.Join(", ", originalHeaders.Select(i => string.Format("{0}={1}", i.Key, i.Value)).ToArray());
|
||||
//builder.Append(response.Xml);
|
||||
|
||||
Logger.Debug("Control response. Headers: {0}", headers);
|
||||
_logger.LogDebug("Control response. Headers: {0}", headers);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
using MediaBrowser.Common.Net;
|
||||
using MediaBrowser.Controller.Dlna;
|
||||
using Emby.Dlna.Eventing;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace Emby.Dlna.Service
|
||||
{
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
using MediaBrowser.Controller;
|
||||
using MediaBrowser.Controller.Configuration;
|
||||
using MediaBrowser.Controller.Dlna;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
|
|
@ -4,7 +4,7 @@ using MediaBrowser.Common.Configuration;
|
|||
using MediaBrowser.Common.Net;
|
||||
using MediaBrowser.Controller.Drawing;
|
||||
using MediaBrowser.Model.Drawing;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System;
|
||||
using System.IO;
|
||||
using MediaBrowser.Model.IO;
|
||||
|
@ -78,7 +78,7 @@ namespace Emby.Drawing.ImageMagick
|
|||
|
||||
private void LogVersion()
|
||||
{
|
||||
_logger.Info("ImageMagick version: " + GetVersion());
|
||||
_logger.LogInformation("ImageMagick version: " + GetVersion());
|
||||
TestWebp();
|
||||
Wand.SetMagickThreadCount(1);
|
||||
}
|
||||
|
@ -101,9 +101,9 @@ namespace Emby.Drawing.ImageMagick
|
|||
wand.SaveImage(tmpPath);
|
||||
}
|
||||
}
|
||||
catch
|
||||
catch (Exception ex)
|
||||
{
|
||||
//_logger.ErrorException("Error loading webp: ", ex);
|
||||
_logger.LogError(ex, "Error loading webp");
|
||||
_webpAvailable = false;
|
||||
}
|
||||
}
|
||||
|
@ -295,7 +295,7 @@ namespace Emby.Drawing.ImageMagick
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.ErrorException("Error drawing indicator overlay", ex);
|
||||
_logger.LogError(ex, "Error drawing indicator overlay");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
using MediaBrowser.Controller.Drawing;
|
||||
using MediaBrowser.Model.Drawing;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Drawing2D;
|
||||
|
@ -30,7 +30,7 @@ namespace Emby.Drawing.Net
|
|||
|
||||
private void LogInfo()
|
||||
{
|
||||
_logger.Info("GDIImageEncoder starting");
|
||||
_logger.LogInformation("GDIImageEncoder starting");
|
||||
using (var stream = GetType().Assembly.GetManifestResourceStream(GetType().Namespace + ".empty.png"))
|
||||
{
|
||||
using (var img = Image.FromStream(stream))
|
||||
|
@ -38,7 +38,7 @@ namespace Emby.Drawing.Net
|
|||
|
||||
}
|
||||
}
|
||||
_logger.Info("GDIImageEncoder started");
|
||||
_logger.LogInformation("GDIImageEncoder started");
|
||||
}
|
||||
|
||||
public string[] SupportedInputFormats
|
||||
|
@ -214,7 +214,7 @@ namespace Emby.Drawing.Net
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.ErrorException("Error drawing indicator overlay", ex);
|
||||
_logger.LogError(ex, "Error drawing indicator overlay");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@ using MediaBrowser.Common.Net;
|
|||
using MediaBrowser.Controller.Drawing;
|
||||
using MediaBrowser.Model.Drawing;
|
||||
using MediaBrowser.Model.IO;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using SkiaSharp;
|
||||
using System;
|
||||
using System.IO;
|
||||
|
@ -81,7 +81,7 @@ namespace Emby.Drawing.Skia
|
|||
// test an operation that requires the native library
|
||||
SKPMColor.PreMultiply(SKColors.Black);
|
||||
|
||||
_logger.Info("SkiaSharp version: " + GetVersion());
|
||||
_logger.LogInformation("SkiaSharp version: " + GetVersion());
|
||||
}
|
||||
|
||||
public static string GetVersion()
|
||||
|
@ -530,7 +530,7 @@ namespace Emby.Drawing.Skia
|
|||
throw new ArgumentOutOfRangeException(string.Format("Skia unable to read image {0}", inputPath));
|
||||
}
|
||||
|
||||
//_logger.Info("Color type {0}", bitmap.Info.ColorType);
|
||||
//_logger.LogInformation("Color type {0}", bitmap.Info.ColorType);
|
||||
|
||||
var originalImageSize = new ImageSize(bitmap.Width, bitmap.Height);
|
||||
|
||||
|
@ -660,7 +660,7 @@ namespace Emby.Drawing.Skia
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.ErrorException("Error drawing indicator overlay", ex);
|
||||
_logger.LogError(ex, "Error drawing indicator overlay");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
using MediaBrowser.Model.Drawing;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
@ -235,4 +235,4 @@ namespace Emby.Drawing.Common
|
|||
throw new ArgumentException(ErrorMessage);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@ using MediaBrowser.Controller.Entities;
|
|||
using MediaBrowser.Controller.Providers;
|
||||
using MediaBrowser.Model.Drawing;
|
||||
using MediaBrowser.Model.Entities;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using MediaBrowser.Model.Serialization;
|
||||
using System;
|
||||
using System.Collections.Concurrent;
|
||||
|
@ -261,7 +261,7 @@ namespace Emby.Drawing
|
|||
//if (originalImageSize.HasValue && options.HasDefaultOptions(originalImagePath, originalImageSize.Value) && !autoOrient)
|
||||
//{
|
||||
// // Just spit out the original file if all the options are default
|
||||
// _logger.Info("Returning original image {0}", originalImagePath);
|
||||
// _logger.LogInformation("Returning original image {0}", originalImagePath);
|
||||
// return new ValueTuple<string, string, DateTime>(originalImagePath, MimeTypes.GetMimeType(originalImagePath), dateModified);
|
||||
//}
|
||||
|
||||
|
@ -302,7 +302,7 @@ namespace Emby.Drawing
|
|||
{
|
||||
// Decoder failed to decode it
|
||||
#if DEBUG
|
||||
_logger.ErrorException("Error encoding image", ex);
|
||||
_logger.LogError(ex, "Error encoding image");
|
||||
#endif
|
||||
// Just spit out the original file if all the options are default
|
||||
return new Tuple<string, string, DateTime>(originalImagePath, MimeTypes.GetMimeType(originalImagePath), dateModified);
|
||||
|
@ -310,7 +310,7 @@ namespace Emby.Drawing
|
|||
catch (Exception ex)
|
||||
{
|
||||
// If it fails for whatever reason, return the original image
|
||||
_logger.ErrorException("Error encoding image", ex);
|
||||
_logger.LogError(ex, "Error encoding image");
|
||||
|
||||
// Just spit out the original file if all the options are default
|
||||
return new Tuple<string, string, DateTime>(originalImagePath, MimeTypes.GetMimeType(originalImagePath), dateModified);
|
||||
|
@ -464,7 +464,7 @@ namespace Emby.Drawing
|
|||
}
|
||||
|
||||
var path = info.Path;
|
||||
_logger.Info("Getting image size for item {0} {1}", item.GetType().Name, path);
|
||||
_logger.LogInformation("Getting image size for item {0} {1}", item.GetType().Name, path);
|
||||
|
||||
var size = GetImageSize(path, allowSlowMethods);
|
||||
|
||||
|
@ -564,7 +564,7 @@ namespace Emby.Drawing
|
|||
var cacheKeys = imageEnhancers.Select(i => i.GetConfigurationCacheKey(item, imageType)).ToList();
|
||||
cacheKeys.Add(originalImagePath + dateModified.Ticks);
|
||||
|
||||
return string.Join("|", cacheKeys.ToArray(cacheKeys.Count)).GetMD5().ToString("N");
|
||||
return string.Join("|", cacheKeys.ToArray()).GetMD5().ToString("N");
|
||||
}
|
||||
|
||||
private async Task<ValueTuple<string, DateTime>> GetSupportedImage(string originalImagePath, DateTime dateModified)
|
||||
|
@ -603,7 +603,7 @@ namespace Emby.Drawing
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.ErrorException("Image conversion failed for {0}", ex, originalImagePath);
|
||||
_logger.LogError(ex, "Image conversion failed for {originalImagePath}", originalImagePath);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -646,21 +646,21 @@ namespace Emby.Drawing
|
|||
var cacheGuid = GetImageCacheTag(item, image, enhancers);
|
||||
|
||||
// Enhance if we have enhancers
|
||||
var ehnancedImageInfo = await GetEnhancedImageInternal(originalImagePath, item, imageType, imageIndex, enhancers, cacheGuid, cancellationToken).ConfigureAwait(false);
|
||||
var enhancedImageInfo = await GetEnhancedImageInternal(originalImagePath, item, imageType, imageIndex, enhancers, cacheGuid, cancellationToken).ConfigureAwait(false);
|
||||
|
||||
var ehnancedImagePath = ehnancedImageInfo.Item1;
|
||||
var enhancedImagePath = enhancedImageInfo.Item1;
|
||||
|
||||
// If the path changed update dateModified
|
||||
if (!string.Equals(ehnancedImagePath, originalImagePath, StringComparison.OrdinalIgnoreCase))
|
||||
if (!string.Equals(enhancedImagePath, originalImagePath, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
var treatmentRequiresTransparency = ehnancedImageInfo.Item2;
|
||||
var treatmentRequiresTransparency = enhancedImageInfo.Item2;
|
||||
|
||||
return new ValueTuple<string, DateTime, bool>(ehnancedImagePath, _fileSystem.GetLastWriteTimeUtc(ehnancedImagePath), treatmentRequiresTransparency);
|
||||
return new ValueTuple<string, DateTime, bool>(enhancedImagePath, _fileSystem.GetLastWriteTimeUtc(enhancedImagePath), treatmentRequiresTransparency);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.ErrorException("Error enhancing image", ex);
|
||||
_logger.LogError(ex, "Error enhancing image");
|
||||
}
|
||||
|
||||
return new ValueTuple<string, DateTime, bool>(originalImagePath, dateModified, inputImageSupportsTransparency);
|
||||
|
@ -827,11 +827,11 @@ namespace Emby.Drawing
|
|||
|
||||
public void CreateImageCollage(ImageCollageOptions options)
|
||||
{
|
||||
_logger.Info("Creating image collage and saving to {0}", options.OutputPath);
|
||||
_logger.LogInformation("Creating image collage and saving to {0}", options.OutputPath);
|
||||
|
||||
_imageEncoder.CreateImageCollage(options);
|
||||
|
||||
_logger.Info("Completed creation of image collage and saved to {0}", options.OutputPath);
|
||||
_logger.LogInformation("Completed creation of image collage and saved to {0}", options.OutputPath);
|
||||
}
|
||||
|
||||
public IImageEnhancer[] GetSupportedEnhancers(BaseItem item, ImageType imageType)
|
||||
|
@ -853,7 +853,7 @@ namespace Emby.Drawing
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.ErrorException("Error in image enhancer: {0}", ex, i.GetType().Name);
|
||||
_logger.LogError(ex, "Error in image enhancer: {0}", i.GetType().Name);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -919,4 +919,4 @@ namespace Emby.Drawing
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@ using System.Threading;
|
|||
using System.Threading.Tasks;
|
||||
using MediaBrowser.Model.Diagnostics;
|
||||
using MediaBrowser.Model.IO;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using MediaBrowser.Model.System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
|
@ -20,7 +20,7 @@ namespace IsoMounter
|
|||
private readonly IEnvironmentInfo EnvironmentInfo;
|
||||
private readonly bool ExecutablesAvailable;
|
||||
private readonly IFileSystem FileSystem;
|
||||
private readonly ILogger Logger;
|
||||
private readonly ILogger _logger;
|
||||
private readonly string MountCommand;
|
||||
private readonly string MountPointRoot;
|
||||
private readonly IProcessFactory ProcessFactory;
|
||||
|
@ -36,24 +36,24 @@ namespace IsoMounter
|
|||
|
||||
EnvironmentInfo = environment;
|
||||
FileSystem = fileSystem;
|
||||
Logger = logger;
|
||||
_logger = logger;
|
||||
ProcessFactory = processFactory;
|
||||
|
||||
MountPointRoot = FileSystem.DirectorySeparatorChar + "tmp" + FileSystem.DirectorySeparatorChar + "Emby";
|
||||
|
||||
Logger.Debug(
|
||||
_logger.LogDebug(
|
||||
"[{0}] System PATH is currently set to [{1}].",
|
||||
Name,
|
||||
EnvironmentInfo.GetEnvironmentVariable("PATH") ?? ""
|
||||
);
|
||||
|
||||
Logger.Debug(
|
||||
_logger.LogDebug(
|
||||
"[{0}] System path separator is [{1}].",
|
||||
Name,
|
||||
EnvironmentInfo.PathSeparator
|
||||
);
|
||||
|
||||
Logger.Debug(
|
||||
_logger.LogDebug(
|
||||
"[{0}] Mount point root is [{1}].",
|
||||
Name,
|
||||
MountPointRoot
|
||||
|
@ -65,7 +65,7 @@ namespace IsoMounter
|
|||
|
||||
SudoCommand = GetFullPathForExecutable("sudo");
|
||||
|
||||
Logger.Info(
|
||||
_logger.LogInformation(
|
||||
"[{0}] Using version of [sudo] located at [{1}].",
|
||||
Name,
|
||||
SudoCommand
|
||||
|
@ -73,7 +73,7 @@ namespace IsoMounter
|
|||
|
||||
MountCommand = GetFullPathForExecutable("mount");
|
||||
|
||||
Logger.Info(
|
||||
_logger.LogInformation(
|
||||
"[{0}] Using version of [mount] located at [{1}].",
|
||||
Name,
|
||||
MountCommand
|
||||
|
@ -81,7 +81,7 @@ namespace IsoMounter
|
|||
|
||||
UmountCommand = GetFullPathForExecutable("umount");
|
||||
|
||||
Logger.Info(
|
||||
_logger.LogInformation(
|
||||
"[{0}] Using version of [umount] located at [{1}].",
|
||||
Name,
|
||||
UmountCommand
|
||||
|
@ -119,7 +119,7 @@ namespace IsoMounter
|
|||
{
|
||||
|
||||
if (EnvironmentInfo.OperatingSystem == MediaBrowser.Model.System.OperatingSystem.Linux) {
|
||||
Logger.Info(
|
||||
_logger.LogInformation(
|
||||
"[{0}] Checking we can attempt to mount [{1}], Extension = [{2}], Operating System = [{3}], Executables Available = [{4}].",
|
||||
Name,
|
||||
path,
|
||||
|
@ -182,7 +182,7 @@ namespace IsoMounter
|
|||
return;
|
||||
}
|
||||
|
||||
Logger.Info(
|
||||
_logger.LogInformation(
|
||||
"[{0}] Disposing [{1}].",
|
||||
Name,
|
||||
disposing.ToString()
|
||||
|
@ -230,7 +230,7 @@ namespace IsoMounter
|
|||
|
||||
var uid = getuid();
|
||||
|
||||
Logger.Debug(
|
||||
_logger.LogDebug(
|
||||
"[{0}] Our current UID is [{1}], GetUserId() returned [{2}].",
|
||||
Name,
|
||||
uid.ToString(),
|
||||
|
@ -260,35 +260,29 @@ namespace IsoMounter
|
|||
}
|
||||
);
|
||||
|
||||
try {
|
||||
|
||||
try
|
||||
{
|
||||
process.Start();
|
||||
|
||||
//StreamReader outputReader = process.StandardOutput.;
|
||||
//StreamReader errorReader = process.StandardError;
|
||||
|
||||
Logger.Debug(
|
||||
"[{0}] Standard output from process is [{1}].",
|
||||
_logger.LogDebug(
|
||||
"[{Name}] Standard output from process is [{Error}].",
|
||||
Name,
|
||||
process.StandardOutput.ReadToEnd()
|
||||
);
|
||||
|
||||
Logger.Debug(
|
||||
"[{0}] Standard error from process is [{1}].",
|
||||
_logger.LogDebug(
|
||||
"[{Name}] Standard error from process is [{Error}].",
|
||||
Name,
|
||||
process.StandardError.ReadToEnd()
|
||||
);
|
||||
|
||||
} catch (Exception ex) {
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
processFailed = true;
|
||||
|
||||
Logger.Debug(
|
||||
"[{0}] Unhandled exception executing command, exception is [{1}].",
|
||||
Name,
|
||||
ex.Message
|
||||
);
|
||||
|
||||
_logger.LogDebug(ex, "[{Name}] Unhandled exception executing command.", Name);
|
||||
}
|
||||
|
||||
if (!processFailed && process.ExitCode == 0) {
|
||||
|
@ -308,14 +302,14 @@ namespace IsoMounter
|
|||
|
||||
if (!string.IsNullOrEmpty(isoPath)) {
|
||||
|
||||
Logger.Info(
|
||||
"[{0}] Attempting to mount [{1}].",
|
||||
_logger.LogInformation(
|
||||
"[{Name}] Attempting to mount [{Path}].",
|
||||
Name,
|
||||
isoPath
|
||||
);
|
||||
|
||||
Logger.Debug(
|
||||
"[{0}] ISO will be mounted at [{1}].",
|
||||
_logger.LogDebug(
|
||||
"[{Name}] ISO will be mounted at [{Path}].",
|
||||
Name,
|
||||
mountPoint
|
||||
);
|
||||
|
@ -326,11 +320,16 @@ namespace IsoMounter
|
|||
|
||||
}
|
||||
|
||||
try {
|
||||
try
|
||||
{
|
||||
FileSystem.CreateDirectory(mountPoint);
|
||||
} catch (UnauthorizedAccessException) {
|
||||
}
|
||||
catch (UnauthorizedAccessException)
|
||||
{
|
||||
throw new IOException("Unable to create mount point(Permission denied) for " + isoPath);
|
||||
} catch (Exception) {
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
throw new IOException("Unable to create mount point for " + isoPath);
|
||||
}
|
||||
|
||||
|
@ -342,7 +341,7 @@ namespace IsoMounter
|
|||
cmdArguments = string.Format("\"{0}\" \"{1}\" \"{2}\"", MountCommand, isoPath, mountPoint);
|
||||
}
|
||||
|
||||
Logger.Debug(
|
||||
_logger.LogDebug(
|
||||
"[{0}] Mount command [{1}], mount arguments [{2}].",
|
||||
Name,
|
||||
cmdFilename,
|
||||
|
@ -351,7 +350,7 @@ namespace IsoMounter
|
|||
|
||||
if (ExecuteCommand(cmdFilename, cmdArguments)) {
|
||||
|
||||
Logger.Info(
|
||||
_logger.LogInformation(
|
||||
"[{0}] ISO mount completed successfully.",
|
||||
Name
|
||||
);
|
||||
|
@ -360,23 +359,18 @@ namespace IsoMounter
|
|||
|
||||
} else {
|
||||
|
||||
Logger.Info(
|
||||
_logger.LogInformation(
|
||||
"[{0}] ISO mount completed with errors.",
|
||||
Name
|
||||
);
|
||||
|
||||
try {
|
||||
|
||||
try
|
||||
{
|
||||
FileSystem.DeleteDirectory(mountPoint, false);
|
||||
|
||||
} catch (Exception ex) {
|
||||
|
||||
Logger.Info(
|
||||
"[{0}] Unhandled exception removing mount point, exception is [{1}].",
|
||||
Name,
|
||||
ex.Message
|
||||
);
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogInformation(ex, "[{Name}] Unhandled exception removing mount point.", Name);
|
||||
}
|
||||
|
||||
mountedISO = null;
|
||||
|
@ -395,7 +389,7 @@ namespace IsoMounter
|
|||
|
||||
if (mount != null) {
|
||||
|
||||
Logger.Info(
|
||||
_logger.LogInformation(
|
||||
"[{0}] Attempting to unmount ISO [{1}] mounted on [{2}].",
|
||||
Name,
|
||||
mount.IsoPath,
|
||||
|
@ -416,7 +410,7 @@ namespace IsoMounter
|
|||
cmdArguments = string.Format("\"{0}\" \"{1}\"", UmountCommand, mount.MountedPath);
|
||||
}
|
||||
|
||||
Logger.Debug(
|
||||
_logger.LogDebug(
|
||||
"[{0}] Umount command [{1}], umount arguments [{2}].",
|
||||
Name,
|
||||
cmdFilename,
|
||||
|
@ -425,34 +419,28 @@ namespace IsoMounter
|
|||
|
||||
if (ExecuteCommand(cmdFilename, cmdArguments)) {
|
||||
|
||||
Logger.Info(
|
||||
_logger.LogInformation(
|
||||
"[{0}] ISO unmount completed successfully.",
|
||||
Name
|
||||
);
|
||||
|
||||
} else {
|
||||
|
||||
Logger.Info(
|
||||
_logger.LogInformation(
|
||||
"[{0}] ISO unmount completed with errors.",
|
||||
Name
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
try {
|
||||
|
||||
try
|
||||
{
|
||||
FileSystem.DeleteDirectory(mount.MountedPath, false);
|
||||
|
||||
} catch (Exception ex) {
|
||||
|
||||
Logger.Info(
|
||||
"[{0}] Unhandled exception removing mount point, exception is [{1}].",
|
||||
Name,
|
||||
ex.Message
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogInformation(ex, "[{Name}] Unhandled exception removing mount point.", Name);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
|
|
@ -79,4 +79,3 @@ namespace IsoMounter
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ using MediaBrowser.Controller.Configuration;
|
|||
using MediaBrowser.Controller.Entities;
|
||||
using MediaBrowser.Controller.Library;
|
||||
using MediaBrowser.Controller.Notifications;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using MediaBrowser.Model.Notifications;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
@ -25,11 +25,11 @@ namespace Emby.Notifications
|
|||
private INotificationService[] _services;
|
||||
private INotificationTypeFactory[] _typeFactories;
|
||||
|
||||
public NotificationManager(ILogManager logManager, IUserManager userManager, IServerConfigurationManager config)
|
||||
public NotificationManager(ILoggerFactory loggerFactory, IUserManager userManager, IServerConfigurationManager config)
|
||||
{
|
||||
_userManager = userManager;
|
||||
_config = config;
|
||||
_logger = logManager.GetLogger(GetType().Name);
|
||||
_logger = loggerFactory.CreateLogger(GetType().Name);
|
||||
}
|
||||
|
||||
private NotificationOptions GetConfiguration()
|
||||
|
@ -126,7 +126,7 @@ namespace Emby.Notifications
|
|||
User = user
|
||||
};
|
||||
|
||||
_logger.Debug("Sending notification via {0} to user {1}", service.Name, user.Name);
|
||||
_logger.LogDebug("Sending notification via {0} to user {1}", service.Name, user.Name);
|
||||
|
||||
try
|
||||
{
|
||||
|
@ -134,7 +134,7 @@ namespace Emby.Notifications
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.ErrorException("Error sending notification to {0}", ex, service.Name);
|
||||
_logger.LogError(ex, "Error sending notification to {0}", service.Name);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -146,7 +146,7 @@ namespace Emby.Notifications
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.ErrorException("Error in IsEnabledForUser", ex);
|
||||
_logger.LogError(ex, "Error in IsEnabledForUser");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -177,7 +177,7 @@ namespace Emby.Notifications
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.ErrorException("Error in GetNotificationTypes", ex);
|
||||
_logger.LogError(ex, "Error in GetNotificationTypes");
|
||||
return new List<NotificationTypeInfo>();
|
||||
}
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ using MediaBrowser.Controller.Library;
|
|||
using MediaBrowser.Controller.Notifications;
|
||||
using MediaBrowser.Controller.Plugins;
|
||||
using MediaBrowser.Controller.Session;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using MediaBrowser.Model.Notifications;
|
||||
using MediaBrowser.Model.Tasks;
|
||||
using System;
|
||||
|
@ -137,7 +137,7 @@ namespace Emby.Notifications
|
|||
|
||||
var notification = new NotificationRequest
|
||||
{
|
||||
Description = "Please see emby.media for details.",
|
||||
Description = "Please see jellyfin.media for details.",
|
||||
NotificationType = type,
|
||||
Name = _localization.GetLocalizedString("NewVersionIsAvailable")
|
||||
};
|
||||
|
@ -273,7 +273,7 @@ namespace Emby.Notifications
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.ErrorException("Error sending notification", ex);
|
||||
_logger.LogError(ex, "Error sending notification");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ using MediaBrowser.Controller.Library;
|
|||
using MediaBrowser.Controller.Providers;
|
||||
using MediaBrowser.Model.Entities;
|
||||
using MediaBrowser.Model.IO;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using TagLib;
|
||||
using TagLib.IFD;
|
||||
using TagLib.IFD.Entries;
|
||||
|
@ -170,9 +170,9 @@ namespace Emby.Photos
|
|||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.ErrorException("Image Provider - Error reading image tag for {0}", e, item.Path);
|
||||
_logger.LogError(ex, "Image Provider - Error reading image tag for {0}", item.Path);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ using MediaBrowser.Controller.Session;
|
|||
using MediaBrowser.Controller.Subtitles;
|
||||
using MediaBrowser.Model.Activity;
|
||||
using MediaBrowser.Model.Events;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using MediaBrowser.Model.Tasks;
|
||||
using MediaBrowser.Model.Updates;
|
||||
using System;
|
||||
|
@ -129,7 +129,7 @@ namespace Emby.Server.Implementations.Activity
|
|||
|
||||
if (item == null)
|
||||
{
|
||||
//_logger.Warn("PlaybackStopped reported with null media info.");
|
||||
//_logger.LogWarning("PlaybackStopped reported with null media info.");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -160,7 +160,7 @@ namespace Emby.Server.Implementations.Activity
|
|||
|
||||
if (item == null)
|
||||
{
|
||||
//_logger.Warn("PlaybackStart reported with null media info.");
|
||||
//_logger.LogWarning("PlaybackStart reported with null media info.");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -284,7 +284,7 @@ namespace Emby.Server.Implementations.Activity
|
|||
Name = string.Format(_localization.GetLocalizedString("FailedLoginAttemptWithUserName"), e.Argument.Username),
|
||||
Type = "AuthenticationFailed",
|
||||
ShortOverview = string.Format(_localization.GetLocalizedString("LabelIpAddressValue"), e.Argument.RemoteEndPoint),
|
||||
Severity = LogSeverity.Error
|
||||
Severity = LogLevel.Error
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -466,9 +466,9 @@ namespace Emby.Server.Implementations.Activity
|
|||
{
|
||||
Name = string.Format(_localization.GetLocalizedString("ScheduledTaskFailedWithName"), task.Name),
|
||||
Type = NotificationType.TaskFailed.ToString(),
|
||||
Overview = string.Join(Environment.NewLine, vals.ToArray(vals.Count)),
|
||||
Overview = string.Join(Environment.NewLine, vals.ToArray()),
|
||||
ShortOverview = runningTime,
|
||||
Severity = LogSeverity.Error
|
||||
Severity = LogLevel.Error
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
using MediaBrowser.Controller.Library;
|
||||
using MediaBrowser.Model.Activity;
|
||||
using MediaBrowser.Model.Events;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using MediaBrowser.Model.Querying;
|
||||
using System;
|
||||
using System.Linq;
|
||||
|
|
|
@ -6,7 +6,7 @@ using System.Linq;
|
|||
using Emby.Server.Implementations.Data;
|
||||
using MediaBrowser.Controller;
|
||||
using MediaBrowser.Model.Activity;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using MediaBrowser.Model.Querying;
|
||||
using SQLitePCL.pretty;
|
||||
using MediaBrowser.Model.Extensions;
|
||||
|
@ -34,7 +34,7 @@ namespace Emby.Server.Implementations.Activity
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.ErrorException("Error loading database file. Will reset and retry.", ex);
|
||||
Logger.LogError(ex, "Error loading database file. Will reset and retry.");
|
||||
|
||||
FileSystem.DeleteFile(DbFilePath);
|
||||
|
||||
|
@ -73,7 +73,7 @@ namespace Emby.Server.Implementations.Activity
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.ErrorException("Error migrating activity log database", ex);
|
||||
Logger.LogError(ex, "Error migrating activity log database");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -87,36 +87,34 @@ namespace Emby.Server.Implementations.Activity
|
|||
}
|
||||
|
||||
using (WriteLock.Write())
|
||||
using (var connection = CreateConnection())
|
||||
{
|
||||
using (var connection = CreateConnection())
|
||||
connection.RunInTransaction(db =>
|
||||
{
|
||||
connection.RunInTransaction(db =>
|
||||
using (var statement = db.PrepareStatement("insert into ActivityLog (Name, Overview, ShortOverview, Type, ItemId, UserId, DateCreated, LogSeverity) values (@Name, @Overview, @ShortOverview, @Type, @ItemId, @UserId, @DateCreated, @LogSeverity)"))
|
||||
{
|
||||
using (var statement = db.PrepareStatement("insert into ActivityLog (Name, Overview, ShortOverview, Type, ItemId, UserId, DateCreated, LogSeverity) values (@Name, @Overview, @ShortOverview, @Type, @ItemId, @UserId, @DateCreated, @LogSeverity)"))
|
||||
statement.TryBind("@Name", entry.Name);
|
||||
|
||||
statement.TryBind("@Overview", entry.Overview);
|
||||
statement.TryBind("@ShortOverview", entry.ShortOverview);
|
||||
statement.TryBind("@Type", entry.Type);
|
||||
statement.TryBind("@ItemId", entry.ItemId);
|
||||
|
||||
if (entry.UserId.Equals(Guid.Empty))
|
||||
{
|
||||
statement.TryBind("@Name", entry.Name);
|
||||
|
||||
statement.TryBind("@Overview", entry.Overview);
|
||||
statement.TryBind("@ShortOverview", entry.ShortOverview);
|
||||
statement.TryBind("@Type", entry.Type);
|
||||
statement.TryBind("@ItemId", entry.ItemId);
|
||||
|
||||
if (entry.UserId.Equals(Guid.Empty))
|
||||
{
|
||||
statement.TryBindNull("@UserId");
|
||||
}
|
||||
else
|
||||
{
|
||||
statement.TryBind("@UserId", entry.UserId.ToString("N"));
|
||||
}
|
||||
|
||||
statement.TryBind("@DateCreated", entry.Date.ToDateTimeParamValue());
|
||||
statement.TryBind("@LogSeverity", entry.Severity.ToString());
|
||||
|
||||
statement.MoveNext();
|
||||
statement.TryBindNull("@UserId");
|
||||
}
|
||||
}, TransactionMode);
|
||||
}
|
||||
else
|
||||
{
|
||||
statement.TryBind("@UserId", entry.UserId.ToString("N"));
|
||||
}
|
||||
|
||||
statement.TryBind("@DateCreated", entry.Date.ToDateTimeParamValue());
|
||||
statement.TryBind("@LogSeverity", entry.Severity.ToString());
|
||||
|
||||
statement.MoveNext();
|
||||
}
|
||||
}, TransactionMode);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -128,132 +126,128 @@ namespace Emby.Server.Implementations.Activity
|
|||
}
|
||||
|
||||
using (WriteLock.Write())
|
||||
using (var connection = CreateConnection())
|
||||
{
|
||||
using (var connection = CreateConnection())
|
||||
connection.RunInTransaction(db =>
|
||||
{
|
||||
connection.RunInTransaction(db =>
|
||||
using (var statement = db.PrepareStatement("Update ActivityLog set Name=@Name,Overview=@Overview,ShortOverview=@ShortOverview,Type=@Type,ItemId=@ItemId,UserId=@UserId,DateCreated=@DateCreated,LogSeverity=@LogSeverity where Id=@Id"))
|
||||
{
|
||||
using (var statement = db.PrepareStatement("Update ActivityLog set Name=@Name,Overview=@Overview,ShortOverview=@ShortOverview,Type=@Type,ItemId=@ItemId,UserId=@UserId,DateCreated=@DateCreated,LogSeverity=@LogSeverity where Id=@Id"))
|
||||
statement.TryBind("@Id", entry.Id);
|
||||
|
||||
statement.TryBind("@Name", entry.Name);
|
||||
statement.TryBind("@Overview", entry.Overview);
|
||||
statement.TryBind("@ShortOverview", entry.ShortOverview);
|
||||
statement.TryBind("@Type", entry.Type);
|
||||
statement.TryBind("@ItemId", entry.ItemId);
|
||||
|
||||
if (entry.UserId.Equals(Guid.Empty))
|
||||
{
|
||||
statement.TryBind("@Id", entry.Id);
|
||||
|
||||
statement.TryBind("@Name", entry.Name);
|
||||
statement.TryBind("@Overview", entry.Overview);
|
||||
statement.TryBind("@ShortOverview", entry.ShortOverview);
|
||||
statement.TryBind("@Type", entry.Type);
|
||||
statement.TryBind("@ItemId", entry.ItemId);
|
||||
|
||||
if (entry.UserId.Equals(Guid.Empty))
|
||||
{
|
||||
statement.TryBindNull("@UserId");
|
||||
}
|
||||
else
|
||||
{
|
||||
statement.TryBind("@UserId", entry.UserId.ToString("N"));
|
||||
}
|
||||
|
||||
statement.TryBind("@DateCreated", entry.Date.ToDateTimeParamValue());
|
||||
statement.TryBind("@LogSeverity", entry.Severity.ToString());
|
||||
|
||||
statement.MoveNext();
|
||||
statement.TryBindNull("@UserId");
|
||||
}
|
||||
}, TransactionMode);
|
||||
}
|
||||
else
|
||||
{
|
||||
statement.TryBind("@UserId", entry.UserId.ToString("N"));
|
||||
}
|
||||
|
||||
statement.TryBind("@DateCreated", entry.Date.ToDateTimeParamValue());
|
||||
statement.TryBind("@LogSeverity", entry.Severity.ToString());
|
||||
|
||||
statement.MoveNext();
|
||||
}
|
||||
}, TransactionMode);
|
||||
}
|
||||
}
|
||||
|
||||
public QueryResult<ActivityLogEntry> GetActivityLogEntries(DateTime? minDate, bool? hasUserId, int? startIndex, int? limit)
|
||||
{
|
||||
using (WriteLock.Read())
|
||||
using (var connection = CreateConnection(true))
|
||||
{
|
||||
using (var connection = CreateConnection(true))
|
||||
var commandText = BaseActivitySelectText;
|
||||
var whereClauses = new List<string>();
|
||||
|
||||
if (minDate.HasValue)
|
||||
{
|
||||
var commandText = BaseActivitySelectText;
|
||||
var whereClauses = new List<string>();
|
||||
|
||||
if (minDate.HasValue)
|
||||
{
|
||||
whereClauses.Add("DateCreated>=@DateCreated");
|
||||
}
|
||||
if (hasUserId.HasValue)
|
||||
{
|
||||
if (hasUserId.Value)
|
||||
{
|
||||
whereClauses.Add("UserId not null");
|
||||
}
|
||||
else
|
||||
{
|
||||
whereClauses.Add("UserId is null");
|
||||
}
|
||||
}
|
||||
|
||||
var whereTextWithoutPaging = whereClauses.Count == 0 ?
|
||||
string.Empty :
|
||||
" where " + string.Join(" AND ", whereClauses.ToArray(whereClauses.Count));
|
||||
|
||||
if (startIndex.HasValue && startIndex.Value > 0)
|
||||
{
|
||||
var pagingWhereText = whereClauses.Count == 0 ?
|
||||
string.Empty :
|
||||
" where " + string.Join(" AND ", whereClauses.ToArray(whereClauses.Count));
|
||||
|
||||
whereClauses.Add(string.Format("Id NOT IN (SELECT Id FROM ActivityLog {0} ORDER BY DateCreated DESC LIMIT {1})",
|
||||
pagingWhereText,
|
||||
startIndex.Value.ToString(_usCulture)));
|
||||
}
|
||||
|
||||
var whereText = whereClauses.Count == 0 ?
|
||||
string.Empty :
|
||||
" where " + string.Join(" AND ", whereClauses.ToArray(whereClauses.Count));
|
||||
|
||||
commandText += whereText;
|
||||
|
||||
commandText += " ORDER BY DateCreated DESC";
|
||||
|
||||
if (limit.HasValue)
|
||||
{
|
||||
commandText += " LIMIT " + limit.Value.ToString(_usCulture);
|
||||
}
|
||||
|
||||
var statementTexts = new List<string>();
|
||||
statementTexts.Add(commandText);
|
||||
statementTexts.Add("select count (Id) from ActivityLog" + whereTextWithoutPaging);
|
||||
|
||||
return connection.RunInTransaction(db =>
|
||||
{
|
||||
var list = new List<ActivityLogEntry>();
|
||||
var result = new QueryResult<ActivityLogEntry>();
|
||||
|
||||
var statements = PrepareAllSafe(db, statementTexts).ToList();
|
||||
|
||||
using (var statement = statements[0])
|
||||
{
|
||||
if (minDate.HasValue)
|
||||
{
|
||||
statement.TryBind("@DateCreated", minDate.Value.ToDateTimeParamValue());
|
||||
}
|
||||
|
||||
foreach (var row in statement.ExecuteQuery())
|
||||
{
|
||||
list.Add(GetEntry(row));
|
||||
}
|
||||
}
|
||||
|
||||
using (var statement = statements[1])
|
||||
{
|
||||
if (minDate.HasValue)
|
||||
{
|
||||
statement.TryBind("@DateCreated", minDate.Value.ToDateTimeParamValue());
|
||||
}
|
||||
|
||||
result.TotalRecordCount = statement.ExecuteQuery().SelectScalarInt().First();
|
||||
}
|
||||
|
||||
result.Items = list.ToArray(list.Count);
|
||||
return result;
|
||||
|
||||
}, ReadTransactionMode);
|
||||
whereClauses.Add("DateCreated>=@DateCreated");
|
||||
}
|
||||
if (hasUserId.HasValue)
|
||||
{
|
||||
if (hasUserId.Value)
|
||||
{
|
||||
whereClauses.Add("UserId not null");
|
||||
}
|
||||
else
|
||||
{
|
||||
whereClauses.Add("UserId is null");
|
||||
}
|
||||
}
|
||||
|
||||
var whereTextWithoutPaging = whereClauses.Count == 0 ?
|
||||
string.Empty :
|
||||
" where " + string.Join(" AND ", whereClauses.ToArray());
|
||||
|
||||
if (startIndex.HasValue && startIndex.Value > 0)
|
||||
{
|
||||
var pagingWhereText = whereClauses.Count == 0 ?
|
||||
string.Empty :
|
||||
" where " + string.Join(" AND ", whereClauses.ToArray());
|
||||
|
||||
whereClauses.Add(string.Format("Id NOT IN (SELECT Id FROM ActivityLog {0} ORDER BY DateCreated DESC LIMIT {1})",
|
||||
pagingWhereText,
|
||||
startIndex.Value.ToString(_usCulture)));
|
||||
}
|
||||
|
||||
var whereText = whereClauses.Count == 0 ?
|
||||
string.Empty :
|
||||
" where " + string.Join(" AND ", whereClauses.ToArray());
|
||||
|
||||
commandText += whereText;
|
||||
|
||||
commandText += " ORDER BY DateCreated DESC";
|
||||
|
||||
if (limit.HasValue)
|
||||
{
|
||||
commandText += " LIMIT " + limit.Value.ToString(_usCulture);
|
||||
}
|
||||
|
||||
var statementTexts = new List<string>();
|
||||
statementTexts.Add(commandText);
|
||||
statementTexts.Add("select count (Id) from ActivityLog" + whereTextWithoutPaging);
|
||||
|
||||
return connection.RunInTransaction(db =>
|
||||
{
|
||||
var list = new List<ActivityLogEntry>();
|
||||
var result = new QueryResult<ActivityLogEntry>();
|
||||
|
||||
var statements = PrepareAllSafe(db, statementTexts).ToList();
|
||||
|
||||
using (var statement = statements[0])
|
||||
{
|
||||
if (minDate.HasValue)
|
||||
{
|
||||
statement.TryBind("@DateCreated", minDate.Value.ToDateTimeParamValue());
|
||||
}
|
||||
|
||||
foreach (var row in statement.ExecuteQuery())
|
||||
{
|
||||
list.Add(GetEntry(row));
|
||||
}
|
||||
}
|
||||
|
||||
using (var statement = statements[1])
|
||||
{
|
||||
if (minDate.HasValue)
|
||||
{
|
||||
statement.TryBind("@DateCreated", minDate.Value.ToDateTimeParamValue());
|
||||
}
|
||||
|
||||
result.TotalRecordCount = statement.ExecuteQuery().SelectScalarInt().First();
|
||||
}
|
||||
|
||||
result.Items = list.ToArray();
|
||||
return result;
|
||||
|
||||
}, ReadTransactionMode);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -308,7 +302,7 @@ namespace Emby.Server.Implementations.Activity
|
|||
index++;
|
||||
if (reader[index].SQLiteType != SQLiteType.Null)
|
||||
{
|
||||
info.Severity = (LogSeverity)Enum.Parse(typeof(LogSeverity), reader[index].ToString(), true);
|
||||
info.Severity = (LogLevel)Enum.Parse(typeof(LogLevel), reader[index].ToString(), true);
|
||||
}
|
||||
|
||||
return info;
|
||||
|
|
|
@ -9,7 +9,7 @@ using MediaBrowser.Common.Events;
|
|||
using MediaBrowser.Common.Extensions;
|
||||
using MediaBrowser.Model.Configuration;
|
||||
using MediaBrowser.Model.IO;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using MediaBrowser.Model.Serialization;
|
||||
|
||||
namespace Emby.Server.Implementations.AppBase
|
||||
|
@ -97,14 +97,14 @@ namespace Emby.Server.Implementations.AppBase
|
|||
/// Initializes a new instance of the <see cref="BaseConfigurationManager" /> class.
|
||||
/// </summary>
|
||||
/// <param name="applicationPaths">The application paths.</param>
|
||||
/// <param name="logManager">The log manager.</param>
|
||||
/// <param name="loggerFactory">The logger factory.</param>
|
||||
/// <param name="xmlSerializer">The XML serializer.</param>
|
||||
protected BaseConfigurationManager(IApplicationPaths applicationPaths, ILogManager logManager, IXmlSerializer xmlSerializer, IFileSystem fileSystem)
|
||||
protected BaseConfigurationManager(IApplicationPaths applicationPaths, ILoggerFactory loggerFactory, IXmlSerializer xmlSerializer, IFileSystem fileSystem)
|
||||
{
|
||||
CommonApplicationPaths = applicationPaths;
|
||||
XmlSerializer = xmlSerializer;
|
||||
FileSystem = fileSystem;
|
||||
Logger = logManager.GetLogger(GetType().Name);
|
||||
Logger = loggerFactory.CreateLogger(GetType().Name);
|
||||
|
||||
UpdateCachePath();
|
||||
}
|
||||
|
@ -123,7 +123,7 @@ namespace Emby.Server.Implementations.AppBase
|
|||
/// </summary>
|
||||
public void SaveConfiguration()
|
||||
{
|
||||
Logger.Info("Saving system configuration");
|
||||
Logger.LogInformation("Saving system configuration");
|
||||
var path = CommonApplicationPaths.SystemConfigurationFilePath;
|
||||
|
||||
FileSystem.CreateDirectory(FileSystem.GetDirectoryName(path));
|
||||
|
@ -259,7 +259,7 @@ namespace Emby.Server.Implementations.AppBase
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.ErrorException("Error loading configuration file: {0}", ex, path);
|
||||
Logger.LogError(ex, "Error loading configuration file: {path}", path);
|
||||
|
||||
return Activator.CreateInstance(configurationType);
|
||||
}
|
||||
|
|
|
@ -48,13 +48,11 @@ using MediaBrowser.Controller.Channels;
|
|||
using MediaBrowser.Controller.Chapters;
|
||||
using MediaBrowser.Controller.Collections;
|
||||
using MediaBrowser.Controller.Configuration;
|
||||
using MediaBrowser.Controller.Connect;
|
||||
using MediaBrowser.Controller.Devices;
|
||||
using MediaBrowser.Controller.Dlna;
|
||||
using MediaBrowser.Controller.Drawing;
|
||||
using MediaBrowser.Controller.Dto;
|
||||
using MediaBrowser.Controller.Entities;
|
||||
using MediaBrowser.Controller.IO;
|
||||
using MediaBrowser.Controller.Library;
|
||||
using MediaBrowser.Controller.LiveTv;
|
||||
using MediaBrowser.Controller.MediaEncoding;
|
||||
|
@ -80,7 +78,6 @@ using MediaBrowser.Model.Dlna;
|
|||
using MediaBrowser.Model.Events;
|
||||
using MediaBrowser.Model.Globalization;
|
||||
using MediaBrowser.Model.IO;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using MediaBrowser.Model.MediaInfo;
|
||||
using MediaBrowser.Model.Net;
|
||||
using MediaBrowser.Model.News;
|
||||
|
@ -117,6 +114,7 @@ using X509Certificate = System.Security.Cryptography.X509Certificates.X509Certif
|
|||
using MediaBrowser.Controller.Authentication;
|
||||
using System.Diagnostics;
|
||||
using ServiceStack.Text.Jsv;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace Emby.Server.Implementations
|
||||
{
|
||||
|
@ -202,10 +200,10 @@ namespace Emby.Server.Implementations
|
|||
public IPlugin[] Plugins { get; protected set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the log manager.
|
||||
/// Gets or sets the logger factory.
|
||||
/// </summary>
|
||||
/// <value>The log manager.</value>
|
||||
public ILogManager LogManager { get; protected set; }
|
||||
/// <value>The logger factory.</value>
|
||||
public ILoggerFactory LoggerFactory { get; protected set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the application paths.
|
||||
|
@ -275,12 +273,12 @@ namespace Emby.Server.Implementations
|
|||
/// <returns>IConfigurationManager.</returns>
|
||||
protected IConfigurationManager GetConfigurationManager()
|
||||
{
|
||||
return new ServerConfigurationManager(ApplicationPaths, LogManager, XmlSerializer, FileSystemManager);
|
||||
return new ServerConfigurationManager(ApplicationPaths, LoggerFactory, XmlSerializer, FileSystemManager);
|
||||
}
|
||||
|
||||
protected virtual IResourceFileManager CreateResourceFileManager()
|
||||
{
|
||||
return new ResourceFileManager(HttpResultFactory, LogManager.GetLogger("ResourceManager"), FileSystemManager);
|
||||
return new ResourceFileManager(HttpResultFactory, LoggerFactory.CreateLogger("ResourceManager"), FileSystemManager);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -391,7 +389,7 @@ namespace Emby.Server.Implementations
|
|||
/// Initializes a new instance of the <see cref="ApplicationHost" /> class.
|
||||
/// </summary>
|
||||
public ApplicationHost(ServerApplicationPaths applicationPaths,
|
||||
ILogManager logManager,
|
||||
ILoggerFactory loggerFactory,
|
||||
StartupOptions options,
|
||||
IFileSystem fileSystem,
|
||||
IPowerManagement powerManagement,
|
||||
|
@ -405,7 +403,7 @@ namespace Emby.Server.Implementations
|
|||
// hack alert, until common can target .net core
|
||||
BaseExtensions.CryptographyProvider = CryptographyProvider;
|
||||
|
||||
XmlSerializer = new MyXmlSerializer(fileSystem, logManager.GetLogger("XmlSerializer"));
|
||||
XmlSerializer = new MyXmlSerializer(fileSystem, loggerFactory.CreateLogger("XmlSerializer"));
|
||||
|
||||
NetworkManager = networkManager;
|
||||
networkManager.LocalSubnetsFn = GetConfiguredLocalSubnets;
|
||||
|
@ -413,13 +411,13 @@ namespace Emby.Server.Implementations
|
|||
SystemEvents = systemEvents;
|
||||
|
||||
ApplicationPaths = applicationPaths;
|
||||
LogManager = logManager;
|
||||
LoggerFactory = loggerFactory;
|
||||
FileSystemManager = fileSystem;
|
||||
|
||||
ConfigurationManager = GetConfigurationManager();
|
||||
|
||||
// Initialize this early in case the -v command line option is used
|
||||
Logger = LogManager.GetLogger("App");
|
||||
Logger = LoggerFactory.CreateLogger("App");
|
||||
|
||||
StartupOptions = options;
|
||||
ReleaseAssetFilename = releaseAssetFilename;
|
||||
|
@ -427,7 +425,7 @@ namespace Emby.Server.Implementations
|
|||
|
||||
ImageEncoder = imageEncoder;
|
||||
|
||||
SetBaseExceptionMessage();
|
||||
//SetBaseExceptionMessage();
|
||||
|
||||
fileSystem.AddShortcutHandler(new MbLinkShortcutHandler(fileSystem));
|
||||
|
||||
|
@ -480,7 +478,7 @@ namespace Emby.Server.Implementations
|
|||
{
|
||||
if (_deviceId == null)
|
||||
{
|
||||
_deviceId = new DeviceId(ApplicationPaths, LogManager.GetLogger("SystemId"), FileSystemManager);
|
||||
_deviceId = new DeviceId(ApplicationPaths, LoggerFactory.CreateLogger("SystemId"), FileSystemManager);
|
||||
}
|
||||
|
||||
return _deviceId.Value;
|
||||
|
@ -545,7 +543,7 @@ namespace Emby.Server.Implementations
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.ErrorException("Error creating {0}", ex, type.FullName);
|
||||
Logger.LogError(ex, "Error creating {type}", type.FullName);
|
||||
// Don't blow up in release mode
|
||||
return null;
|
||||
}
|
||||
|
@ -625,7 +623,7 @@ namespace Emby.Server.Implementations
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.ErrorException("Error loading assembly {0}", ex, file);
|
||||
Logger.LogError(ex, "Error loading assembly {file}", file);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
@ -648,7 +646,7 @@ namespace Emby.Server.Implementations
|
|||
/// <typeparam name="T"></typeparam>
|
||||
/// <param name="manageLiftime">if set to <c>true</c> [manage liftime].</param>
|
||||
/// <returns>IEnumerable{``0}.</returns>
|
||||
public IEnumerable<T> GetExports<T>(bool manageLiftime = true)
|
||||
public IEnumerable<T> GetExports<T>(bool manageLifetime = true)
|
||||
{
|
||||
var parts = GetExportTypes<T>()
|
||||
.Select(CreateInstanceSafe)
|
||||
|
@ -656,7 +654,7 @@ namespace Emby.Server.Implementations
|
|||
.Cast<T>()
|
||||
.ToList();
|
||||
|
||||
if (manageLiftime)
|
||||
if (manageLifetime)
|
||||
{
|
||||
lock (DisposableParts)
|
||||
{
|
||||
|
@ -667,7 +665,7 @@ namespace Emby.Server.Implementations
|
|||
return parts;
|
||||
}
|
||||
|
||||
public List<Tuple<T, string>> GetExportsWithInfo<T>(bool manageLiftime = true)
|
||||
public List<Tuple<T, string>> GetExportsWithInfo<T>(bool manageLifetime = true)
|
||||
{
|
||||
var parts = GetExportTypes<T>()
|
||||
.Select(i =>
|
||||
|
@ -683,7 +681,7 @@ namespace Emby.Server.Implementations
|
|||
.Where(i => i != null)
|
||||
.ToList();
|
||||
|
||||
if (manageLiftime)
|
||||
if (manageLifetime)
|
||||
{
|
||||
lock (DisposableParts)
|
||||
{
|
||||
|
@ -694,6 +692,8 @@ namespace Emby.Server.Implementations
|
|||
return parts;
|
||||
}
|
||||
|
||||
// TODO: @bond
|
||||
/*
|
||||
private void SetBaseExceptionMessage()
|
||||
{
|
||||
var builder = GetBaseExceptionMessage(ApplicationPaths);
|
||||
|
@ -701,8 +701,8 @@ namespace Emby.Server.Implementations
|
|||
builder.Insert(0, string.Format("Version: {0}{1}", ApplicationVersion, Environment.NewLine));
|
||||
builder.Insert(0, "*** Error Report ***" + Environment.NewLine);
|
||||
|
||||
LogManager.ExceptionMessagePrefix = builder.ToString();
|
||||
}
|
||||
LoggerFactory.ExceptionMessagePrefix = builder.ToString();
|
||||
}*/
|
||||
|
||||
/// <summary>
|
||||
/// Runs the startup tasks.
|
||||
|
@ -726,20 +726,20 @@ namespace Emby.Server.Implementations
|
|||
// }
|
||||
//}
|
||||
|
||||
Logger.Info("ServerId: {0}", SystemId);
|
||||
Logger.LogInformation("ServerId: {0}", SystemId);
|
||||
|
||||
var entryPoints = GetExports<IServerEntryPoint>().ToList();
|
||||
var entryPoints = GetExports<IServerEntryPoint>();
|
||||
RunEntryPoints(entryPoints, true);
|
||||
|
||||
Logger.Info("Core startup complete");
|
||||
Logger.LogInformation("Core startup complete");
|
||||
HttpServer.GlobalResponse = null;
|
||||
|
||||
Logger.Info("Post-init migrations complete");
|
||||
Logger.LogInformation("Post-init migrations complete");
|
||||
|
||||
RunEntryPoints(entryPoints, false);
|
||||
Logger.Info("All entry points have started");
|
||||
Logger.LogInformation("All entry points have started");
|
||||
|
||||
LogManager.RemoveConsoleOutput();
|
||||
//LoggerFactory.RemoveConsoleOutput();
|
||||
}
|
||||
|
||||
private void RunEntryPoints(IEnumerable<IServerEntryPoint> entryPoints, bool isBeforeStartup)
|
||||
|
@ -752,7 +752,7 @@ namespace Emby.Server.Implementations
|
|||
}
|
||||
|
||||
var name = entryPoint.GetType().FullName;
|
||||
Logger.Info("Starting entry point {0}", name);
|
||||
Logger.LogInformation("Starting entry point {0}", name);
|
||||
var now = DateTime.UtcNow;
|
||||
try
|
||||
{
|
||||
|
@ -760,9 +760,9 @@ namespace Emby.Server.Implementations
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.ErrorException("Error in {0}", ex, name);
|
||||
Logger.LogError(ex, "Error in {name}", name);
|
||||
}
|
||||
Logger.Info("Entry point completed: {0}. Duration: {1} seconds", name, (DateTime.UtcNow - now).TotalSeconds.ToString(CultureInfo.InvariantCulture), "ImageInfos");
|
||||
Logger.LogInformation("Entry point completed: {0}. Duration: {1} seconds", name, (DateTime.UtcNow - now).TotalSeconds.ToString(CultureInfo.InvariantCulture), "ImageInfos");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -777,13 +777,13 @@ namespace Emby.Server.Implementations
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.ErrorException("Error configuring autorun", ex);
|
||||
Logger.LogError(ex, "Error configuring autorun");
|
||||
}
|
||||
}
|
||||
|
||||
private IJsonSerializer CreateJsonSerializer()
|
||||
{
|
||||
return new JsonSerializer(FileSystemManager, LogManager.GetLogger("JsonSerializer"));
|
||||
return new JsonSerializer(FileSystemManager, LoggerFactory.CreateLogger("JsonSerializer"));
|
||||
}
|
||||
|
||||
public void Init()
|
||||
|
@ -801,11 +801,7 @@ namespace Emby.Server.Implementations
|
|||
JsonSerializer = CreateJsonSerializer();
|
||||
|
||||
OnLoggerLoaded(true);
|
||||
LogManager.LoggerLoaded += (s, e) => OnLoggerLoaded(false);
|
||||
|
||||
LogManager.LogSeverity = ConfigurationManager.CommonConfiguration.EnableDebugLevelLogging
|
||||
? LogSeverity.Debug
|
||||
: LogSeverity.Info;
|
||||
//LoggerFactory.LoggerLoaded += (s, e) => OnLoggerLoaded(false);
|
||||
|
||||
DiscoverTypes();
|
||||
|
||||
|
@ -818,7 +814,7 @@ namespace Emby.Server.Implementations
|
|||
|
||||
protected virtual void OnLoggerLoaded(bool isFirstLoad)
|
||||
{
|
||||
Logger.Info("Application version: {0}", ApplicationVersion);
|
||||
Logger.LogInformation("Application version: {0}", ApplicationVersion);
|
||||
|
||||
if (!isFirstLoad)
|
||||
{
|
||||
|
@ -834,13 +830,13 @@ namespace Emby.Server.Implementations
|
|||
pluginBuilder.AppendLine(string.Format("{0} {1}", plugin.Name, plugin.Version));
|
||||
}
|
||||
|
||||
Logger.LogMultiline("Plugins:", LogSeverity.Info, pluginBuilder);
|
||||
Logger.LogInformation("Plugins: {plugins}", pluginBuilder.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
protected virtual IHttpClient CreateHttpClient()
|
||||
{
|
||||
return new HttpClientManager.HttpClientManager(ApplicationPaths, LogManager.GetLogger("HttpClient"), FileSystemManager, GetDefaultUserAgent);
|
||||
return new HttpClientManager.HttpClientManager(ApplicationPaths, LoggerFactory.CreateLogger("HttpClient"), FileSystemManager, GetDefaultUserAgent);
|
||||
}
|
||||
|
||||
public static IStreamHelper StreamHelper { get; set; }
|
||||
|
@ -858,7 +854,7 @@ namespace Emby.Server.Implementations
|
|||
RegisterSingleInstance(JsonSerializer);
|
||||
RegisterSingleInstance(SystemEvents);
|
||||
|
||||
RegisterSingleInstance(LogManager, false);
|
||||
RegisterSingleInstance(LoggerFactory, false);
|
||||
RegisterSingleInstance(Logger);
|
||||
|
||||
RegisterSingleInstance(EnvironmentInfo);
|
||||
|
@ -873,7 +869,7 @@ namespace Emby.Server.Implementations
|
|||
IsoManager = new IsoManager();
|
||||
RegisterSingleInstance(IsoManager);
|
||||
|
||||
TaskManager = new TaskManager(ApplicationPaths, JsonSerializer, LogManager.GetLogger("TaskManager"), FileSystemManager, SystemEvents);
|
||||
TaskManager = new TaskManager(ApplicationPaths, JsonSerializer, LoggerFactory.CreateLogger("TaskManager"), FileSystemManager, SystemEvents);
|
||||
RegisterSingleInstance(TaskManager);
|
||||
|
||||
RegisterSingleInstance(XmlSerializer);
|
||||
|
@ -890,21 +886,21 @@ namespace Emby.Server.Implementations
|
|||
|
||||
RegisterSingleInstance(CryptographyProvider);
|
||||
|
||||
SocketFactory = new SocketFactory(LogManager.GetLogger("SocketFactory"));
|
||||
SocketFactory = new SocketFactory(LoggerFactory.CreateLogger("SocketFactory"));
|
||||
RegisterSingleInstance(SocketFactory);
|
||||
|
||||
RegisterSingleInstance(PowerManagement);
|
||||
|
||||
SecurityManager = new PluginSecurityManager(this, HttpClient, JsonSerializer, ApplicationPaths, LogManager, FileSystemManager, CryptographyProvider);
|
||||
SecurityManager = new PluginSecurityManager(this, HttpClient, JsonSerializer, ApplicationPaths, LoggerFactory, FileSystemManager, CryptographyProvider);
|
||||
RegisterSingleInstance(SecurityManager);
|
||||
|
||||
InstallationManager = new InstallationManager(LogManager.GetLogger("InstallationManager"), this, ApplicationPaths, HttpClient, JsonSerializer, SecurityManager, ServerConfigurationManager, FileSystemManager, CryptographyProvider, PackageRuntime);
|
||||
InstallationManager = new InstallationManager(LoggerFactory.CreateLogger("InstallationManager"), this, ApplicationPaths, HttpClient, JsonSerializer, SecurityManager, ServerConfigurationManager, FileSystemManager, CryptographyProvider, PackageRuntime);
|
||||
RegisterSingleInstance(InstallationManager);
|
||||
|
||||
ZipClient = new ZipClient(FileSystemManager);
|
||||
RegisterSingleInstance(ZipClient);
|
||||
|
||||
HttpResultFactory = new HttpResultFactory(LogManager, FileSystemManager, JsonSerializer, CreateBrotliCompressor());
|
||||
HttpResultFactory = new HttpResultFactory(LoggerFactory, FileSystemManager, JsonSerializer, CreateBrotliCompressor());
|
||||
RegisterSingleInstance(HttpResultFactory);
|
||||
|
||||
RegisterSingleInstance<IServerApplicationHost>(this);
|
||||
|
@ -915,36 +911,36 @@ namespace Emby.Server.Implementations
|
|||
IAssemblyInfo assemblyInfo = new AssemblyInfo();
|
||||
RegisterSingleInstance<IAssemblyInfo>(assemblyInfo);
|
||||
|
||||
LocalizationManager = new LocalizationManager(ServerConfigurationManager, FileSystemManager, JsonSerializer, LogManager.GetLogger("LocalizationManager"), assemblyInfo, new TextLocalizer());
|
||||
LocalizationManager = new LocalizationManager(ServerConfigurationManager, FileSystemManager, JsonSerializer, LoggerFactory.CreateLogger("LocalizationManager"), assemblyInfo, new TextLocalizer());
|
||||
StringExtensions.LocalizationManager = LocalizationManager;
|
||||
RegisterSingleInstance(LocalizationManager);
|
||||
|
||||
TextEncoding = new TextEncoding.TextEncoding(FileSystemManager, LogManager.GetLogger("TextEncoding"), JsonSerializer);
|
||||
TextEncoding = new TextEncoding.TextEncoding(FileSystemManager, LoggerFactory.CreateLogger("TextEncoding"), JsonSerializer);
|
||||
RegisterSingleInstance(TextEncoding);
|
||||
BlurayExaminer = new BdInfoExaminer(FileSystemManager, TextEncoding);
|
||||
RegisterSingleInstance(BlurayExaminer);
|
||||
|
||||
RegisterSingleInstance<IXmlReaderSettingsFactory>(new XmlReaderSettingsFactory());
|
||||
|
||||
UserDataManager = new UserDataManager(LogManager, ServerConfigurationManager, () => UserManager);
|
||||
UserDataManager = new UserDataManager(LoggerFactory, ServerConfigurationManager, () => UserManager);
|
||||
RegisterSingleInstance(UserDataManager);
|
||||
|
||||
UserRepository = GetUserRepository();
|
||||
// This is only needed for disposal purposes. If removing this, make sure to have the manager handle disposing it
|
||||
RegisterSingleInstance(UserRepository);
|
||||
|
||||
var displayPreferencesRepo = new SqliteDisplayPreferencesRepository(LogManager.GetLogger("SqliteDisplayPreferencesRepository"), JsonSerializer, ApplicationPaths, FileSystemManager);
|
||||
var displayPreferencesRepo = new SqliteDisplayPreferencesRepository(LoggerFactory.CreateLogger("SqliteDisplayPreferencesRepository"), JsonSerializer, ApplicationPaths, FileSystemManager);
|
||||
DisplayPreferencesRepository = displayPreferencesRepo;
|
||||
RegisterSingleInstance(DisplayPreferencesRepository);
|
||||
|
||||
var itemRepo = new SqliteItemRepository(ServerConfigurationManager, this, JsonSerializer, LogManager.GetLogger("SqliteItemRepository"), assemblyInfo, FileSystemManager, EnvironmentInfo, TimerFactory);
|
||||
var itemRepo = new SqliteItemRepository(ServerConfigurationManager, this, JsonSerializer, LoggerFactory.CreateLogger("SqliteItemRepository"), assemblyInfo, FileSystemManager, EnvironmentInfo, TimerFactory);
|
||||
ItemRepository = itemRepo;
|
||||
RegisterSingleInstance(ItemRepository);
|
||||
|
||||
AuthenticationRepository = GetAuthenticationRepository();
|
||||
RegisterSingleInstance(AuthenticationRepository);
|
||||
|
||||
UserManager = new UserManager(LogManager.GetLogger("UserManager"), ServerConfigurationManager, UserRepository, XmlSerializer, NetworkManager, () => ImageProcessor, () => DtoService, this, JsonSerializer, FileSystemManager, CryptographyProvider);
|
||||
UserManager = new UserManager(LoggerFactory.CreateLogger("UserManager"), ServerConfigurationManager, UserRepository, XmlSerializer, NetworkManager, () => ImageProcessor, () => DtoService, this, JsonSerializer, FileSystemManager, CryptographyProvider);
|
||||
RegisterSingleInstance(UserManager);
|
||||
|
||||
LibraryManager = new LibraryManager(this, Logger, TaskManager, UserManager, ServerConfigurationManager, UserDataManager, () => LibraryMonitor, FileSystemManager, () => ProviderManager, () => UserViewManager);
|
||||
|
@ -953,16 +949,16 @@ namespace Emby.Server.Implementations
|
|||
var musicManager = new MusicManager(LibraryManager);
|
||||
RegisterSingleInstance<IMusicManager>(new MusicManager(LibraryManager));
|
||||
|
||||
LibraryMonitor = new LibraryMonitor(LogManager, TaskManager, LibraryManager, ServerConfigurationManager, FileSystemManager, TimerFactory, SystemEvents, EnvironmentInfo);
|
||||
LibraryMonitor = new LibraryMonitor(LoggerFactory, TaskManager, LibraryManager, ServerConfigurationManager, FileSystemManager, TimerFactory, SystemEvents, EnvironmentInfo);
|
||||
RegisterSingleInstance(LibraryMonitor);
|
||||
|
||||
RegisterSingleInstance<ISearchEngine>(() => new SearchEngine(LogManager, LibraryManager, UserManager));
|
||||
RegisterSingleInstance<ISearchEngine>(() => new SearchEngine(LoggerFactory, LibraryManager, UserManager));
|
||||
|
||||
CertificateInfo = GetCertificateInfo(true);
|
||||
Certificate = GetCertificate(CertificateInfo);
|
||||
|
||||
HttpServer = new HttpListenerHost(this,
|
||||
LogManager.GetLogger("HttpServer"),
|
||||
LoggerFactory.CreateLogger("HttpServer"),
|
||||
ServerConfigurationManager,
|
||||
"web/index.html",
|
||||
NetworkManager,
|
||||
|
@ -983,37 +979,37 @@ namespace Emby.Server.Implementations
|
|||
var encryptionManager = new EncryptionManager();
|
||||
RegisterSingleInstance<IEncryptionManager>(encryptionManager);
|
||||
|
||||
DeviceManager = new DeviceManager(AuthenticationRepository, JsonSerializer, LibraryManager, LocalizationManager, UserManager, FileSystemManager, LibraryMonitor, ServerConfigurationManager, LogManager.GetLogger("DeviceManager"), NetworkManager);
|
||||
DeviceManager = new DeviceManager(AuthenticationRepository, JsonSerializer, LibraryManager, LocalizationManager, UserManager, FileSystemManager, LibraryMonitor, ServerConfigurationManager, LoggerFactory.CreateLogger("DeviceManager"), NetworkManager);
|
||||
RegisterSingleInstance(DeviceManager);
|
||||
|
||||
var newsService = new Emby.Server.Implementations.News.NewsService(ApplicationPaths, JsonSerializer);
|
||||
RegisterSingleInstance<INewsService>(newsService);
|
||||
|
||||
MediaSourceManager = new MediaSourceManager(ItemRepository, ApplicationPaths, LocalizationManager, UserManager, LibraryManager, LogManager.GetLogger("MediaSourceManager"), JsonSerializer, FileSystemManager, UserDataManager, TimerFactory, () => MediaEncoder);
|
||||
MediaSourceManager = new MediaSourceManager(ItemRepository, ApplicationPaths, LocalizationManager, UserManager, LibraryManager, LoggerFactory.CreateLogger("MediaSourceManager"), JsonSerializer, FileSystemManager, UserDataManager, TimerFactory, () => MediaEncoder);
|
||||
RegisterSingleInstance(MediaSourceManager);
|
||||
|
||||
SubtitleManager = new SubtitleManager(LogManager.GetLogger("SubtitleManager"), FileSystemManager, LibraryMonitor, MediaSourceManager, ServerConfigurationManager, LocalizationManager);
|
||||
SubtitleManager = new SubtitleManager(LoggerFactory.CreateLogger("SubtitleManager"), FileSystemManager, LibraryMonitor, MediaSourceManager, ServerConfigurationManager, LocalizationManager);
|
||||
RegisterSingleInstance(SubtitleManager);
|
||||
|
||||
ProviderManager = new ProviderManager(HttpClient, SubtitleManager, ServerConfigurationManager, LibraryMonitor, LogManager, FileSystemManager, ApplicationPaths, () => LibraryManager, JsonSerializer);
|
||||
ProviderManager = new ProviderManager(HttpClient, SubtitleManager, ServerConfigurationManager, LibraryMonitor, LoggerFactory, FileSystemManager, ApplicationPaths, () => LibraryManager, JsonSerializer);
|
||||
RegisterSingleInstance(ProviderManager);
|
||||
|
||||
DtoService = new DtoService(LogManager.GetLogger("DtoService"), LibraryManager, UserDataManager, ItemRepository, ImageProcessor, ServerConfigurationManager, FileSystemManager, ProviderManager, () => ChannelManager, this, () => DeviceManager, () => MediaSourceManager, () => LiveTvManager);
|
||||
DtoService = new DtoService(LoggerFactory.CreateLogger("DtoService"), LibraryManager, UserDataManager, ItemRepository, ImageProcessor, ServerConfigurationManager, FileSystemManager, ProviderManager, () => ChannelManager, this, () => DeviceManager, () => MediaSourceManager, () => LiveTvManager);
|
||||
RegisterSingleInstance(DtoService);
|
||||
|
||||
ChannelManager = new ChannelManager(UserManager, DtoService, LibraryManager, LogManager.GetLogger("ChannelManager"), ServerConfigurationManager, FileSystemManager, UserDataManager, JsonSerializer, LocalizationManager, HttpClient, ProviderManager);
|
||||
ChannelManager = new ChannelManager(UserManager, DtoService, LibraryManager, LoggerFactory.CreateLogger("ChannelManager"), ServerConfigurationManager, FileSystemManager, UserDataManager, JsonSerializer, LocalizationManager, HttpClient, ProviderManager);
|
||||
RegisterSingleInstance(ChannelManager);
|
||||
|
||||
SessionManager = new SessionManager(UserDataManager, LogManager.GetLogger("SessionManager"), LibraryManager, UserManager, musicManager, DtoService, ImageProcessor, JsonSerializer, this, HttpClient, AuthenticationRepository, DeviceManager, MediaSourceManager, TimerFactory);
|
||||
SessionManager = new SessionManager(UserDataManager, LoggerFactory.CreateLogger("SessionManager"), LibraryManager, UserManager, musicManager, DtoService, ImageProcessor, JsonSerializer, this, HttpClient, AuthenticationRepository, DeviceManager, MediaSourceManager, TimerFactory);
|
||||
RegisterSingleInstance(SessionManager);
|
||||
|
||||
var dlnaManager = new DlnaManager(XmlSerializer, FileSystemManager, ApplicationPaths, LogManager.GetLogger("Dlna"), JsonSerializer, this, assemblyInfo);
|
||||
var dlnaManager = new DlnaManager(XmlSerializer, FileSystemManager, ApplicationPaths, LoggerFactory.CreateLogger("Dlna"), JsonSerializer, this, assemblyInfo);
|
||||
RegisterSingleInstance<IDlnaManager>(dlnaManager);
|
||||
|
||||
CollectionManager = new CollectionManager(LibraryManager, ApplicationPaths, LocalizationManager, FileSystemManager, LibraryMonitor, LogManager.GetLogger("CollectionManager"), ProviderManager);
|
||||
CollectionManager = new CollectionManager(LibraryManager, ApplicationPaths, LocalizationManager, FileSystemManager, LibraryMonitor, LoggerFactory.CreateLogger("CollectionManager"), ProviderManager);
|
||||
RegisterSingleInstance(CollectionManager);
|
||||
|
||||
PlaylistManager = new PlaylistManager(LibraryManager, FileSystemManager, LibraryMonitor, LogManager.GetLogger("PlaylistManager"), UserManager, ProviderManager);
|
||||
PlaylistManager = new PlaylistManager(LibraryManager, FileSystemManager, LibraryMonitor, LoggerFactory.CreateLogger("PlaylistManager"), UserManager, ProviderManager);
|
||||
RegisterSingleInstance<IPlaylistManager>(PlaylistManager);
|
||||
|
||||
LiveTvManager = new LiveTvManager(this, HttpClient, ServerConfigurationManager, Logger, ItemRepository, ImageProcessor, UserDataManager, DtoService, UserManager, LibraryManager, TaskManager, LocalizationManager, JsonSerializer, ProviderManager, FileSystemManager, SecurityManager, () => ChannelManager);
|
||||
|
@ -1022,12 +1018,12 @@ namespace Emby.Server.Implementations
|
|||
UserViewManager = new UserViewManager(LibraryManager, LocalizationManager, UserManager, ChannelManager, LiveTvManager, ServerConfigurationManager);
|
||||
RegisterSingleInstance(UserViewManager);
|
||||
|
||||
NotificationManager = new NotificationManager(LogManager, UserManager, ServerConfigurationManager);
|
||||
NotificationManager = new NotificationManager(LoggerFactory, UserManager, ServerConfigurationManager);
|
||||
RegisterSingleInstance(NotificationManager);
|
||||
|
||||
RegisterSingleInstance<IDeviceDiscovery>(new DeviceDiscovery(LogManager.GetLogger("IDeviceDiscovery"), ServerConfigurationManager, SocketFactory, TimerFactory));
|
||||
RegisterSingleInstance<IDeviceDiscovery>(new DeviceDiscovery(LoggerFactory.CreateLogger("IDeviceDiscovery"), ServerConfigurationManager, SocketFactory, TimerFactory));
|
||||
|
||||
ChapterManager = new ChapterManager(LibraryManager, LogManager.GetLogger("ChapterManager"), ServerConfigurationManager, ItemRepository);
|
||||
ChapterManager = new ChapterManager(LibraryManager, LoggerFactory.CreateLogger("ChapterManager"), ServerConfigurationManager, ItemRepository);
|
||||
RegisterSingleInstance(ChapterManager);
|
||||
|
||||
RegisterMediaEncoder(assemblyInfo);
|
||||
|
@ -1037,7 +1033,7 @@ namespace Emby.Server.Implementations
|
|||
|
||||
var activityLogRepo = GetActivityLogRepository();
|
||||
RegisterSingleInstance(activityLogRepo);
|
||||
RegisterSingleInstance<IActivityManager>(new ActivityManager(LogManager.GetLogger("ActivityManager"), activityLogRepo, UserManager));
|
||||
RegisterSingleInstance<IActivityManager>(new ActivityManager(LoggerFactory.CreateLogger("ActivityManager"), activityLogRepo, UserManager));
|
||||
|
||||
var authContext = new AuthorizationContext(AuthenticationRepository, UserManager);
|
||||
RegisterSingleInstance<IAuthorizationContext>(authContext);
|
||||
|
@ -1046,14 +1042,14 @@ namespace Emby.Server.Implementations
|
|||
AuthService = new AuthService(UserManager, authContext, ServerConfigurationManager, SessionManager, NetworkManager);
|
||||
RegisterSingleInstance<IAuthService>(AuthService);
|
||||
|
||||
SubtitleEncoder = new MediaBrowser.MediaEncoding.Subtitles.SubtitleEncoder(LibraryManager, LogManager.GetLogger("SubtitleEncoder"), ApplicationPaths, FileSystemManager, MediaEncoder, JsonSerializer, HttpClient, MediaSourceManager, ProcessFactory, TextEncoding);
|
||||
SubtitleEncoder = new MediaBrowser.MediaEncoding.Subtitles.SubtitleEncoder(LibraryManager, LoggerFactory.CreateLogger("SubtitleEncoder"), ApplicationPaths, FileSystemManager, MediaEncoder, JsonSerializer, HttpClient, MediaSourceManager, ProcessFactory, TextEncoding);
|
||||
RegisterSingleInstance(SubtitleEncoder);
|
||||
|
||||
RegisterSingleInstance(CreateResourceFileManager());
|
||||
|
||||
displayPreferencesRepo.Initialize();
|
||||
|
||||
var userDataRepo = new SqliteUserDataRepository(LogManager.GetLogger("SqliteUserDataRepository"), ApplicationPaths, FileSystemManager);
|
||||
var userDataRepo = new SqliteUserDataRepository(LoggerFactory.CreateLogger("SqliteUserDataRepository"), ApplicationPaths, FileSystemManager);
|
||||
|
||||
SetStaticProperties();
|
||||
|
||||
|
@ -1082,9 +1078,9 @@ namespace Emby.Server.Implementations
|
|||
}
|
||||
}
|
||||
|
||||
public static void LogEnvironmentInfo(ILogger logger, IApplicationPaths appPaths, bool isStartup)
|
||||
public static void LogEnvironmentInfo(ILogger Logger, IApplicationPaths appPaths, bool isStartup)
|
||||
{
|
||||
logger.LogMultiline("Emby", LogSeverity.Info, GetBaseExceptionMessage(appPaths));
|
||||
Logger.LogInformation("Jellyfin:\n{ex}", GetBaseExceptionMessage(appPaths).ToString());
|
||||
}
|
||||
|
||||
protected static StringBuilder GetBaseExceptionMessage(IApplicationPaths appPaths)
|
||||
|
@ -1103,17 +1099,6 @@ namespace Emby.Server.Implementations
|
|||
builder.AppendLine(string.Format("64-Bit OS: {0}", Environment.Is64BitOperatingSystem));
|
||||
builder.AppendLine(string.Format("64-Bit Process: {0}", Environment.Is64BitProcess));
|
||||
builder.AppendLine(string.Format("User Interactive: {0}", Environment.UserInteractive));
|
||||
|
||||
Type type = Type.GetType("Mono.Runtime");
|
||||
if (type != null)
|
||||
{
|
||||
MethodInfo displayName = type.GetMethod("GetDisplayName", BindingFlags.NonPublic | BindingFlags.Static);
|
||||
if (displayName != null)
|
||||
{
|
||||
builder.AppendLine("Mono: " + displayName.Invoke(null, null));
|
||||
}
|
||||
}
|
||||
|
||||
builder.AppendLine(string.Format("Processor count: {0}", Environment.ProcessorCount));
|
||||
builder.AppendLine(string.Format("Program data path: {0}", appPaths.ProgramDataPath));
|
||||
builder.AppendLine(string.Format("Application directory: {0}", appPaths.ProgramSystemPath));
|
||||
|
@ -1130,7 +1115,7 @@ namespace Emby.Server.Implementations
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.ErrorException("Error setting http limit", ex);
|
||||
Logger.LogError(ex, "Error setting http limit");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1189,7 +1174,7 @@ namespace Emby.Server.Implementations
|
|||
//localCert.PrivateKey = PrivateKey.CreateFromFile(pvk_file).RSA;
|
||||
if (!localCert.HasPrivateKey)
|
||||
{
|
||||
Logger.Error("No private key included in SSL cert {0}.", certificateLocation);
|
||||
Logger.LogError("No private key included in SSL cert {0}.", certificateLocation);
|
||||
return null;
|
||||
}
|
||||
|
||||
|
@ -1197,14 +1182,14 @@ namespace Emby.Server.Implementations
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.ErrorException("Error loading cert from {0}", ex, certificateLocation);
|
||||
Logger.LogError(ex, "Error loading cert from {certificateLocation}", certificateLocation);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private IImageProcessor GetImageProcessor()
|
||||
{
|
||||
return new ImageProcessor(LogManager.GetLogger("ImageProcessor"), ServerConfigurationManager.ApplicationPaths, FileSystemManager, JsonSerializer, ImageEncoder, () => LibraryManager, TimerFactory, () => MediaEncoder);
|
||||
return new ImageProcessor(LoggerFactory.CreateLogger("ImageProcessor"), ServerConfigurationManager.ApplicationPaths, FileSystemManager, JsonSerializer, ImageEncoder, () => LibraryManager, TimerFactory, () => MediaEncoder);
|
||||
}
|
||||
|
||||
protected virtual FFMpegInstallInfo GetFfmpegInstallInfo()
|
||||
|
@ -1262,7 +1247,8 @@ namespace Emby.Server.Implementations
|
|||
probePath = info.ProbePath;
|
||||
var hasExternalEncoder = string.Equals(info.Version, "external", StringComparison.OrdinalIgnoreCase);
|
||||
|
||||
var mediaEncoder = new MediaBrowser.MediaEncoding.Encoder.MediaEncoder(LogManager.GetLogger("MediaEncoder"),
|
||||
var mediaEncoder = new MediaBrowser.MediaEncoding.Encoder.MediaEncoder(
|
||||
LoggerFactory.CreateLogger("MediaEncoder"),
|
||||
JsonSerializer,
|
||||
encoderPath,
|
||||
probePath,
|
||||
|
@ -1292,7 +1278,7 @@ namespace Emby.Server.Implementations
|
|||
/// <returns>Task{IUserRepository}.</returns>
|
||||
private IUserRepository GetUserRepository()
|
||||
{
|
||||
var repo = new SqliteUserRepository(LogManager.GetLogger("SqliteUserRepository"), ApplicationPaths, JsonSerializer);
|
||||
var repo = new SqliteUserRepository(LoggerFactory.CreateLogger("SqliteUserRepository"), ApplicationPaths, JsonSerializer);
|
||||
|
||||
repo.Initialize();
|
||||
|
||||
|
@ -1301,7 +1287,7 @@ namespace Emby.Server.Implementations
|
|||
|
||||
private IAuthenticationRepository GetAuthenticationRepository()
|
||||
{
|
||||
var repo = new AuthenticationRepository(LogManager.GetLogger("AuthenticationRepository"), ServerConfigurationManager);
|
||||
var repo = new AuthenticationRepository(LoggerFactory.CreateLogger("AuthenticationRepository"), ServerConfigurationManager);
|
||||
|
||||
repo.Initialize();
|
||||
|
||||
|
@ -1310,7 +1296,7 @@ namespace Emby.Server.Implementations
|
|||
|
||||
private IActivityRepository GetActivityLogRepository()
|
||||
{
|
||||
var repo = new ActivityRepository(LogManager.GetLogger("ActivityRepository"), ServerConfigurationManager.ApplicationPaths, FileSystemManager);
|
||||
var repo = new ActivityRepository(LoggerFactory.CreateLogger("ActivityRepository"), ServerConfigurationManager.ApplicationPaths, FileSystemManager);
|
||||
|
||||
repo.Initialize();
|
||||
|
||||
|
@ -1325,7 +1311,7 @@ namespace Emby.Server.Implementations
|
|||
((SqliteItemRepository)ItemRepository).ImageProcessor = ImageProcessor;
|
||||
|
||||
// For now there's no real way to inject these properly
|
||||
BaseItem.Logger = LogManager.GetLogger("BaseItem");
|
||||
BaseItem.Logger = LoggerFactory.CreateLogger("BaseItem");
|
||||
BaseItem.ConfigurationManager = ServerConfigurationManager;
|
||||
BaseItem.LibraryManager = LibraryManager;
|
||||
BaseItem.ProviderManager = ProviderManager;
|
||||
|
@ -1425,7 +1411,7 @@ namespace Emby.Server.Implementations
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.ErrorException("Error getting plugin Id from {0}.", ex, plugin.GetType().FullName);
|
||||
Logger.LogError(ex, "Error getting plugin Id from {pluginName}.", plugin.GetType().FullName);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1437,7 +1423,7 @@ namespace Emby.Server.Implementations
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.ErrorException("Error loading plugin {0}", ex, plugin.GetType().FullName);
|
||||
Logger.LogError(ex, "Error loading plugin {pluginName}", plugin.GetType().FullName);
|
||||
return null;
|
||||
}
|
||||
|
||||
|
@ -1449,7 +1435,7 @@ namespace Emby.Server.Implementations
|
|||
/// </summary>
|
||||
protected void DiscoverTypes()
|
||||
{
|
||||
Logger.Info("Loading assemblies");
|
||||
Logger.LogInformation("Loading assemblies");
|
||||
|
||||
var assemblyInfos = GetComposablePartAssemblies();
|
||||
|
||||
|
@ -1460,11 +1446,11 @@ namespace Emby.Server.Implementations
|
|||
|
||||
if (path == null)
|
||||
{
|
||||
Logger.Info("Loading {0}", assembly.FullName);
|
||||
Logger.LogInformation("Loading {assemblyName}", assembly.FullName);
|
||||
}
|
||||
else
|
||||
{
|
||||
Logger.Info("Loading {0} from {1}", assembly.FullName, path);
|
||||
Logger.LogInformation("Loading {assemblyName} from {path}", assembly.FullName, path);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1506,7 +1492,7 @@ namespace Emby.Server.Implementations
|
|||
{
|
||||
if (loaderException != null)
|
||||
{
|
||||
Logger.Error("LoaderException: " + loaderException.Message);
|
||||
Logger.LogError("LoaderException: " + loaderException.Message);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1517,7 +1503,7 @@ namespace Emby.Server.Implementations
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.ErrorException("Error loading types from assembly", ex);
|
||||
Logger.LogError(ex, "Error loading types from assembly");
|
||||
|
||||
return new List<Tuple<Type, string>>();
|
||||
}
|
||||
|
@ -1564,7 +1550,7 @@ namespace Emby.Server.Implementations
|
|||
? "The http server is unable to start due to a Socket error. This can occasionally happen when the operating system takes longer than usual to release the IP bindings from the previous session. This can take up to five minutes. Please try waiting or rebooting the system."
|
||||
: "Error starting Http Server";
|
||||
|
||||
Logger.ErrorException(msg, ex);
|
||||
Logger.LogError(ex, msg);
|
||||
|
||||
if (HttpPort == ServerConfiguration.DefaultHttpPort)
|
||||
{
|
||||
|
@ -1580,7 +1566,7 @@ namespace Emby.Server.Implementations
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.ErrorException("Error starting http server", ex);
|
||||
Logger.LogError(ex, "Error starting http server");
|
||||
|
||||
throw;
|
||||
}
|
||||
|
@ -1615,7 +1601,7 @@ namespace Emby.Server.Implementations
|
|||
// }
|
||||
// catch (Exception ex)
|
||||
// {
|
||||
// Logger.ErrorException("Error creating ssl cert", ex);
|
||||
// Logger.LogError(ex, "Error creating ssl cert");
|
||||
// return null;
|
||||
// }
|
||||
// }
|
||||
|
@ -1672,7 +1658,7 @@ namespace Emby.Server.Implementations
|
|||
|
||||
if (requiresRestart)
|
||||
{
|
||||
Logger.Info("App needs to be restarted due to configuration change.");
|
||||
Logger.LogInformation("App needs to be restarted due to configuration change.");
|
||||
|
||||
NotifyPendingRestart();
|
||||
}
|
||||
|
@ -1683,7 +1669,7 @@ namespace Emby.Server.Implementations
|
|||
/// </summary>
|
||||
public void NotifyPendingRestart()
|
||||
{
|
||||
Logger.Info("App needs to be restarted.");
|
||||
Logger.LogInformation("App needs to be restarted.");
|
||||
|
||||
var changed = !HasPendingRestart;
|
||||
|
||||
|
@ -1720,10 +1706,10 @@ namespace Emby.Server.Implementations
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.ErrorException("Error sending server restart notification", ex);
|
||||
Logger.LogError(ex, "Error sending server restart notification");
|
||||
}
|
||||
|
||||
Logger.Info("Calling RestartInternal");
|
||||
Logger.LogInformation("Calling RestartInternal");
|
||||
|
||||
RestartInternal();
|
||||
});
|
||||
|
@ -1849,13 +1835,13 @@ namespace Emby.Server.Implementations
|
|||
{
|
||||
var result = Version.Parse(FileVersionInfo.GetVersionInfo(path).FileVersion);
|
||||
|
||||
Logger.Info("File {0} has version {1}", path, result);
|
||||
Logger.LogInformation("File {0} has version {1}", path, result);
|
||||
|
||||
return result;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.ErrorException("Error getting version number from {0}", ex, path);
|
||||
Logger.LogError(ex, "Error getting version number from {path}", path);
|
||||
|
||||
return new Version(1, 0);
|
||||
}
|
||||
|
@ -1940,13 +1926,13 @@ namespace Emby.Server.Implementations
|
|||
|
||||
if (version < minRequiredVersion)
|
||||
{
|
||||
Logger.Info("Not loading {0} {1} because the minimum supported version is {2}. Please update to the newer version", filename, version, minRequiredVersion);
|
||||
Logger.LogInformation("Not loading {filename} {version} because the minimum supported version is {minRequiredVersion}. Please update to the newer version", filename, version, minRequiredVersion);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.ErrorException("Error getting version number from {0}", ex, path);
|
||||
Logger.LogError(ex, "Error getting version number from {path}", path);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
@ -1962,6 +1948,7 @@ namespace Emby.Server.Implementations
|
|||
public async Task<SystemInfo> GetSystemInfo(CancellationToken cancellationToken)
|
||||
{
|
||||
var localAddress = await GetLocalApiUrl(cancellationToken).ConfigureAwait(false);
|
||||
var wanAddress = await GetWanApiUrl(cancellationToken).ConfigureAwait(false);
|
||||
|
||||
return new SystemInfo
|
||||
{
|
||||
|
@ -1984,8 +1971,7 @@ namespace Emby.Server.Implementations
|
|||
CanSelfRestart = CanSelfRestart,
|
||||
CanSelfUpdate = CanSelfUpdate,
|
||||
CanLaunchWebBrowser = CanLaunchWebBrowser,
|
||||
// TODO - remove WanAddress
|
||||
WanAddress = "0.0.0.0",
|
||||
WanAddress = wanAddress,
|
||||
HasUpdateAvailable = HasUpdateAvailable,
|
||||
SupportsAutoRunAtStartup = SupportsAutoRunAtStartup,
|
||||
TranscodingTempPath = ApplicationPaths.TranscodingTempPath,
|
||||
|
@ -2012,14 +1998,13 @@ namespace Emby.Server.Implementations
|
|||
public async Task<PublicSystemInfo> GetPublicSystemInfo(CancellationToken cancellationToken)
|
||||
{
|
||||
var localAddress = await GetLocalApiUrl(cancellationToken).ConfigureAwait(false);
|
||||
|
||||
var wanAddress = await GetWanApiUrl(cancellationToken).ConfigureAwait(false);
|
||||
return new PublicSystemInfo
|
||||
{
|
||||
Version = ApplicationVersion.ToString(),
|
||||
Id = SystemId,
|
||||
OperatingSystem = EnvironmentInfo.OperatingSystem.ToString(),
|
||||
// TODO - remove WanAddress
|
||||
WanAddress = "0.0.0.0",
|
||||
WanAddress = wanAddress,
|
||||
ServerName = FriendlyName,
|
||||
LocalAddress = localAddress
|
||||
};
|
||||
|
@ -2054,12 +2039,38 @@ namespace Emby.Server.Implementations
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.ErrorException("Error getting local Ip address information", ex);
|
||||
Logger.LogError(ex, "Error getting local Ip address information");
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public async Task<string> GetWanApiUrl(CancellationToken cancellationToken)
|
||||
{
|
||||
var url = "http://ipv4.icanhazip.com";
|
||||
try
|
||||
{
|
||||
using (var response = await HttpClient.Get(new HttpRequestOptions
|
||||
{
|
||||
Url = url,
|
||||
LogErrorResponseBody = false,
|
||||
LogErrors = false,
|
||||
LogRequest = false,
|
||||
TimeoutMs = 10000,
|
||||
BufferContent = false,
|
||||
CancellationToken = cancellationToken
|
||||
}))
|
||||
{
|
||||
return GetLocalApiUrl(response.ReadToEnd().Trim());
|
||||
}
|
||||
}
|
||||
catch(Exception ex)
|
||||
{
|
||||
Logger.LogError(ex, "Error getting WAN Ip address information");
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public string GetLocalApiUrl(IpAddressInfo ipAddress)
|
||||
{
|
||||
if (ipAddress.AddressFamily == IpAddressFamily.InterNetworkV6)
|
||||
|
@ -2185,19 +2196,19 @@ namespace Emby.Server.Implementations
|
|||
var valid = string.Equals(Name, result, StringComparison.OrdinalIgnoreCase);
|
||||
|
||||
_validAddressResults.AddOrUpdate(apiUrl, valid, (k, v) => valid);
|
||||
Logger.Debug("Ping test result to {0}. Success: {1}", apiUrl, valid);
|
||||
Logger.LogDebug("Ping test result to {0}. Success: {1}", apiUrl, valid);
|
||||
return valid;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (OperationCanceledException)
|
||||
{
|
||||
Logger.Debug("Ping test result to {0}. Success: {1}", apiUrl, "Cancelled");
|
||||
Logger.LogDebug("Ping test result to {0}. Success: {1}", apiUrl, "Cancelled");
|
||||
throw;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.Debug("Ping test result to {0}. Success: {1} {2}", apiUrl, false, ex.Message);
|
||||
Logger.LogDebug(ex, "Ping test result to {0}. Success: {1}", apiUrl, false);
|
||||
|
||||
_validAddressResults.AddOrUpdate(apiUrl, false, (k, v) => false);
|
||||
return false;
|
||||
|
@ -2236,7 +2247,7 @@ namespace Emby.Server.Implementations
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.ErrorException("Error sending server shutdown notification", ex);
|
||||
Logger.LogError(ex, "Error sending server shutdown notification");
|
||||
}
|
||||
|
||||
ShutdownInternal();
|
||||
|
@ -2249,7 +2260,7 @@ namespace Emby.Server.Implementations
|
|||
/// </summary>
|
||||
private void RegisterServerWithAdministratorAccess()
|
||||
{
|
||||
Logger.Info("Requesting administrative access to authorize http server");
|
||||
Logger.LogInformation("Requesting administrative access to authorize http server");
|
||||
|
||||
try
|
||||
{
|
||||
|
@ -2261,7 +2272,7 @@ namespace Emby.Server.Implementations
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.ErrorException("Error authorizing server", ex);
|
||||
Logger.LogError(ex, "Error authorizing server");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2428,9 +2439,7 @@ namespace Emby.Server.Implementations
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine("Error launching url: {0}", url);
|
||||
Logger.ErrorException("Error launching url: {0}", ex, url);
|
||||
|
||||
Logger.LogError(ex, "Error launching url: {url}", url);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
@ -2450,7 +2459,7 @@ namespace Emby.Server.Implementations
|
|||
/// <param name="package">The package.</param>
|
||||
protected void OnApplicationUpdated(PackageVersionInfo package)
|
||||
{
|
||||
Logger.Info("Application has been updated to version {0}", package.versionStr);
|
||||
Logger.LogInformation("Application has been updated to version {0}", package.versionStr);
|
||||
|
||||
EventHelper.FireEventIfNotNull(ApplicationUpdated, this, new GenericEventArgs<PackageVersionInfo>
|
||||
{
|
||||
|
@ -2485,15 +2494,15 @@ namespace Emby.Server.Implementations
|
|||
{
|
||||
var type = GetType();
|
||||
|
||||
LogManager.AddConsoleOutput();
|
||||
Logger.Info("Disposing " + type.Name);
|
||||
//LoggerFactory.AddConsoleOutput();
|
||||
Logger.LogInformation("Disposing " + type.Name);
|
||||
|
||||
var parts = DisposableParts.Distinct().Where(i => i.GetType() != type).ToList();
|
||||
DisposableParts.Clear();
|
||||
|
||||
foreach (var part in parts)
|
||||
{
|
||||
Logger.Info("Disposing " + part.GetType().Name);
|
||||
Logger.LogInformation("Disposing " + part.GetType().Name);
|
||||
|
||||
try
|
||||
{
|
||||
|
@ -2501,7 +2510,7 @@ namespace Emby.Server.Implementations
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.ErrorException("Error disposing {0}", ex, part.GetType().Name);
|
||||
Logger.LogError(ex, "Error disposing {0}", part.GetType().Name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,7 +10,7 @@ using MediaBrowser.Model.Channels;
|
|||
using MediaBrowser.Model.Dto;
|
||||
using MediaBrowser.Model.Entities;
|
||||
using MediaBrowser.Model.Extensions;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using MediaBrowser.Model.MediaInfo;
|
||||
using MediaBrowser.Model.Net;
|
||||
using MediaBrowser.Model.Querying;
|
||||
|
@ -239,7 +239,7 @@ namespace Emby.Server.Implementations.Channels
|
|||
all = all.Take(query.Limit.Value).ToList();
|
||||
}
|
||||
|
||||
var returnItems = all.ToArray(all.Count);
|
||||
var returnItems = all.ToArray();
|
||||
|
||||
if (query.RefreshLatestChannelItems)
|
||||
{
|
||||
|
@ -300,7 +300,7 @@ namespace Emby.Server.Implementations.Channels
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.ErrorException("Error getting channel information for {0}", ex, channelInfo.Name);
|
||||
_logger.LogError(ex, "Error getting channel information for {0}", channelInfo.Name);
|
||||
}
|
||||
|
||||
numComplete++;
|
||||
|
@ -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;
|
||||
|
@ -709,7 +708,7 @@ namespace Emby.Server.Implementations.Channels
|
|||
// Not yet sure why this is causing a problem
|
||||
query.GroupByPresentationUniqueKey = false;
|
||||
|
||||
//_logger.Debug("GetChannelItemsInternal");
|
||||
//_logger.LogDebug("GetChannelItemsInternal");
|
||||
|
||||
// null if came from cache
|
||||
if (itemsResult != null)
|
||||
|
@ -849,7 +848,7 @@ namespace Emby.Server.Implementations.Channels
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.ErrorException("Error writing to channel cache file: {0}", ex, path);
|
||||
_logger.LogError(ex, "Error writing to channel cache file: {path}", path);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -912,7 +911,7 @@ namespace Emby.Server.Implementations.Channels
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.ErrorException("Error retrieving channel item from database", ex);
|
||||
_logger.LogError(ex, "Error retrieving channel item from database");
|
||||
}
|
||||
|
||||
if (item == null)
|
||||
|
@ -1011,7 +1010,7 @@ namespace Emby.Server.Implementations.Channels
|
|||
{
|
||||
item.Name = info.Name;
|
||||
item.Genres = info.Genres.ToArray();
|
||||
item.Studios = info.Studios.ToArray(info.Studios.Count);
|
||||
item.Studios = info.Studios.ToArray();
|
||||
item.CommunityRating = info.CommunityRating;
|
||||
item.Overview = info.Overview;
|
||||
item.IndexNumber = info.IndexNumber;
|
||||
|
@ -1021,7 +1020,7 @@ namespace Emby.Server.Implementations.Channels
|
|||
item.ProviderIds = info.ProviderIds;
|
||||
item.OfficialRating = info.OfficialRating;
|
||||
item.DateCreated = info.DateCreated ?? DateTime.UtcNow;
|
||||
item.Tags = info.Tags.ToArray(info.Tags.Count);
|
||||
item.Tags = info.Tags.ToArray();
|
||||
item.OriginalTitle = info.OriginalTitle;
|
||||
}
|
||||
else if (info.Type == ChannelItemType.Folder && info.FolderType == ChannelFolderType.Container)
|
||||
|
@ -1043,7 +1042,7 @@ namespace Emby.Server.Implementations.Channels
|
|||
var hasAlbumArtists = item as IHasAlbumArtist;
|
||||
if (hasAlbumArtists != null)
|
||||
{
|
||||
hasAlbumArtists.AlbumArtists = info.AlbumArtists.ToArray(info.AlbumArtists.Count);
|
||||
hasAlbumArtists.AlbumArtists = info.AlbumArtists.ToArray();
|
||||
}
|
||||
|
||||
var trailer = item as Trailer;
|
||||
|
@ -1051,7 +1050,7 @@ namespace Emby.Server.Implementations.Channels
|
|||
{
|
||||
if (!info.TrailerTypes.SequenceEqual(trailer.TrailerTypes))
|
||||
{
|
||||
_logger.Debug("Forcing update due to TrailerTypes {0}", item.Name);
|
||||
_logger.LogDebug("Forcing update due to TrailerTypes {0}", item.Name);
|
||||
forceUpdate = true;
|
||||
}
|
||||
trailer.TrailerTypes = info.TrailerTypes.ToArray();
|
||||
|
@ -1060,7 +1059,7 @@ namespace Emby.Server.Implementations.Channels
|
|||
if (info.DateModified > item.DateModified)
|
||||
{
|
||||
item.DateModified = info.DateModified;
|
||||
_logger.Debug("Forcing update due to DateModified {0}", item.Name);
|
||||
_logger.LogDebug("Forcing update due to DateModified {0}", item.Name);
|
||||
forceUpdate = true;
|
||||
}
|
||||
|
||||
|
@ -1069,20 +1068,20 @@ namespace Emby.Server.Implementations.Channels
|
|||
//{
|
||||
// item.ExternalEtag = info.Etag;
|
||||
// forceUpdate = true;
|
||||
// _logger.Debug("Forcing update due to ExternalEtag {0}", item.Name);
|
||||
// _logger.LogDebug("Forcing update due to ExternalEtag {0}", item.Name);
|
||||
//}
|
||||
|
||||
if (!internalChannelId.Equals(item.ChannelId))
|
||||
{
|
||||
forceUpdate = true;
|
||||
_logger.Debug("Forcing update due to ChannelId {0}", item.Name);
|
||||
_logger.LogDebug("Forcing update due to ChannelId {0}", item.Name);
|
||||
}
|
||||
item.ChannelId = internalChannelId;
|
||||
|
||||
if (!item.ParentId.Equals(parentFolderId))
|
||||
{
|
||||
forceUpdate = true;
|
||||
_logger.Debug("Forcing update due to parent folder Id {0}", item.Name);
|
||||
_logger.LogDebug("Forcing update due to parent folder Id {0}", item.Name);
|
||||
}
|
||||
item.ParentId = parentFolderId;
|
||||
|
||||
|
@ -1092,7 +1091,7 @@ namespace Emby.Server.Implementations.Channels
|
|||
if (!string.Equals(hasSeries.SeriesName, info.SeriesName, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
forceUpdate = true;
|
||||
_logger.Debug("Forcing update due to SeriesName {0}", item.Name);
|
||||
_logger.LogDebug("Forcing update due to SeriesName {0}", item.Name);
|
||||
}
|
||||
hasSeries.SeriesName = info.SeriesName;
|
||||
}
|
||||
|
@ -1100,7 +1099,7 @@ namespace Emby.Server.Implementations.Channels
|
|||
if (!string.Equals(item.ExternalId, info.Id, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
forceUpdate = true;
|
||||
_logger.Debug("Forcing update due to ExternalId {0}", item.Name);
|
||||
_logger.LogDebug("Forcing update due to ExternalId {0}", item.Name);
|
||||
}
|
||||
item.ExternalId = info.Id;
|
||||
|
||||
|
@ -1125,7 +1124,7 @@ namespace Emby.Server.Implementations.Channels
|
|||
if (!string.IsNullOrEmpty(info.ImageUrl) && !item.HasImage(ImageType.Primary))
|
||||
{
|
||||
item.SetImagePath(ImageType.Primary, info.ImageUrl);
|
||||
_logger.Debug("Forcing update due to ImageUrl {0}", item.Name);
|
||||
_logger.LogDebug("Forcing update due to ImageUrl {0}", item.Name);
|
||||
forceUpdate = true;
|
||||
}
|
||||
|
||||
|
@ -1134,7 +1133,7 @@ namespace Emby.Server.Implementations.Channels
|
|||
if (item.Tags.Contains("livestream", StringComparer.OrdinalIgnoreCase))
|
||||
{
|
||||
item.Tags = item.Tags.Except(new[] { "livestream" }, StringComparer.OrdinalIgnoreCase).ToArray();
|
||||
_logger.Debug("Forcing update due to Tags {0}", item.Name);
|
||||
_logger.LogDebug("Forcing update due to Tags {0}", item.Name);
|
||||
forceUpdate = true;
|
||||
}
|
||||
}
|
||||
|
@ -1143,7 +1142,7 @@ namespace Emby.Server.Implementations.Channels
|
|||
if (!item.Tags.Contains("livestream", StringComparer.OrdinalIgnoreCase))
|
||||
{
|
||||
item.Tags = item.Tags.Concat(new[] { "livestream" }).ToArray();
|
||||
_logger.Debug("Forcing update due to Tags {0}", item.Name);
|
||||
_logger.LogDebug("Forcing update due to Tags {0}", item.Name);
|
||||
forceUpdate = true;
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
using MediaBrowser.Controller.Channels;
|
||||
using MediaBrowser.Controller.Entities;
|
||||
using MediaBrowser.Controller.Library;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
|
@ -64,7 +64,7 @@ namespace Emby.Server.Implementations.Channels
|
|||
|
||||
private void CleanChannel(Guid id, CancellationToken cancellationToken)
|
||||
{
|
||||
_logger.Info("Cleaning channel {0} from database", id);
|
||||
_logger.LogInformation("Cleaning channel {0} from database", id);
|
||||
|
||||
// Delete all channel items
|
||||
var allIds = _libraryManager.GetItemIds(new InternalItemsQuery
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
using MediaBrowser.Controller.Channels;
|
||||
using MediaBrowser.Controller.Library;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using MediaBrowser.Common.Progress;
|
||||
using MediaBrowser.Model.Tasks;
|
||||
|
@ -54,7 +55,7 @@ namespace Emby.Server.Implementations.Channels
|
|||
get { return true; }
|
||||
}
|
||||
|
||||
public async Task Execute(System.Threading.CancellationToken cancellationToken, IProgress<double> progress)
|
||||
public async Task Execute(CancellationToken cancellationToken, IProgress<double> progress)
|
||||
{
|
||||
var manager = (ChannelManager)_channelManager;
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ using MediaBrowser.Controller.Entities;
|
|||
using MediaBrowser.Controller.Entities.Movies;
|
||||
using MediaBrowser.Controller.Library;
|
||||
using MediaBrowser.Controller.Providers;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
@ -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)
|
||||
|
@ -219,7 +219,7 @@ namespace Emby.Server.Implementations.Collections
|
|||
{
|
||||
var newList = collection.LinkedChildren.ToList();
|
||||
newList.AddRange(list);
|
||||
collection.LinkedChildren = newList.ToArray(newList.Count);
|
||||
collection.LinkedChildren = newList.ToArray();
|
||||
|
||||
collection.UpdateRatingToItems(linkedChildrenList);
|
||||
|
||||
|
@ -265,7 +265,7 @@ namespace Emby.Server.Implementations.Collections
|
|||
|
||||
if (child == null)
|
||||
{
|
||||
_logger.Warn("No collection title exists with the supplied Id");
|
||||
_logger.LogWarning("No collection title exists with the supplied Id");
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
|
@ -365,7 +365,7 @@ namespace Emby.Server.Implementations.Collections
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.ErrorException("Error creating camera uploads library", ex);
|
||||
_logger.LogError(ex, "Error creating camera uploads library");
|
||||
}
|
||||
|
||||
_config.Configuration.CollectionsUpgraded = true;
|
||||
|
|
|
@ -14,7 +14,7 @@ using MediaBrowser.Controller.Entities.TV;
|
|||
using MediaBrowser.Model.Configuration;
|
||||
using MediaBrowser.Model.Events;
|
||||
using MediaBrowser.Model.IO;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using MediaBrowser.Model.Serialization;
|
||||
using MediaBrowser.Model.Extensions;
|
||||
|
||||
|
@ -30,11 +30,11 @@ namespace Emby.Server.Implementations.Configuration
|
|||
/// Initializes a new instance of the <see cref="ServerConfigurationManager" /> class.
|
||||
/// </summary>
|
||||
/// <param name="applicationPaths">The application paths.</param>
|
||||
/// <param name="logManager">The log manager.</param>
|
||||
/// <param name="loggerFactory">The paramref name="loggerFactory" factory.</param>
|
||||
/// <param name="xmlSerializer">The XML serializer.</param>
|
||||
/// <param name="fileSystem">The file system.</param>
|
||||
public ServerConfigurationManager(IApplicationPaths applicationPaths, ILogManager logManager, IXmlSerializer xmlSerializer, IFileSystem fileSystem)
|
||||
: base(applicationPaths, logManager, xmlSerializer, fileSystem)
|
||||
public ServerConfigurationManager(IApplicationPaths applicationPaths, ILoggerFactory loggerFactory, IXmlSerializer xmlSerializer, IFileSystem fileSystem)
|
||||
: base(applicationPaths, loggerFactory, xmlSerializer, fileSystem)
|
||||
{
|
||||
UpdateMetadataPath();
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@ using System.Collections.Generic;
|
|||
using System.Globalization;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using SQLitePCL.pretty;
|
||||
using System.Linq;
|
||||
using SQLitePCL;
|
||||
|
@ -75,22 +75,22 @@ namespace Emby.Server.Implementations.Data
|
|||
if (!_versionLogged)
|
||||
{
|
||||
_versionLogged = true;
|
||||
Logger.Info("Sqlite version: " + SQLite3.Version);
|
||||
Logger.Info("Sqlite compiler options: " + string.Join(",", SQLite3.CompilerOptions.ToArray()));
|
||||
Logger.LogInformation("Sqlite version: " + SQLite3.Version);
|
||||
Logger.LogInformation("Sqlite compiler options: " + string.Join(",", SQLite3.CompilerOptions.ToArray()));
|
||||
}
|
||||
|
||||
ConnectionFlags connectionFlags;
|
||||
|
||||
if (isReadOnly)
|
||||
{
|
||||
//Logger.Info("Opening read connection");
|
||||
//Logger.LogInformation("Opening read connection");
|
||||
//connectionFlags = ConnectionFlags.ReadOnly;
|
||||
connectionFlags = ConnectionFlags.Create;
|
||||
connectionFlags |= ConnectionFlags.ReadWrite;
|
||||
}
|
||||
else
|
||||
{
|
||||
//Logger.Info("Opening write connection");
|
||||
//Logger.LogInformation("Opening write connection");
|
||||
connectionFlags = ConnectionFlags.Create;
|
||||
connectionFlags |= ConnectionFlags.ReadWrite;
|
||||
}
|
||||
|
@ -114,7 +114,7 @@ namespace Emby.Server.Implementations.Data
|
|||
{
|
||||
_defaultWal = db.Query("PRAGMA journal_mode").SelectScalarString().First();
|
||||
|
||||
Logger.Info("Default journal_mode for {0} is {1}", DbFilePath, _defaultWal);
|
||||
Logger.LogInformation("Default journal_mode for {0} is {1}", DbFilePath, _defaultWal);
|
||||
}
|
||||
|
||||
var queries = new List<string>
|
||||
|
@ -235,7 +235,7 @@ namespace Emby.Server.Implementations.Data
|
|||
}
|
||||
|
||||
db.ExecuteAll(string.Join(";", queries.ToArray()));
|
||||
Logger.Info("PRAGMA synchronous=" + db.Query("PRAGMA synchronous").SelectScalarString().First());
|
||||
Logger.LogInformation("PRAGMA synchronous=" + db.Query("PRAGMA synchronous").SelectScalarString().First());
|
||||
}
|
||||
|
||||
protected virtual bool EnableTempStoreMemory
|
||||
|
@ -323,7 +323,7 @@ namespace Emby.Server.Implementations.Data
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.ErrorException("Error disposing database", ex);
|
||||
Logger.LogError(ex, "Error disposing database");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@ using MediaBrowser.Controller.Entities;
|
|||
using MediaBrowser.Controller.Library;
|
||||
using MediaBrowser.Controller.Persistence;
|
||||
using MediaBrowser.Model.Entities;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
@ -47,7 +47,7 @@ namespace Emby.Server.Implementations.Data
|
|||
var numComplete = 0;
|
||||
var numItems = itemIds.Count;
|
||||
|
||||
_logger.Debug("Cleaning {0} items with dead parent links", numItems);
|
||||
_logger.LogDebug("Cleaning {0} items with dead parent links", numItems);
|
||||
|
||||
foreach (var itemId in itemIds)
|
||||
{
|
||||
|
@ -57,7 +57,7 @@ namespace Emby.Server.Implementations.Data
|
|||
|
||||
if (item != null)
|
||||
{
|
||||
_logger.Info("Cleaning item {0} type: {1} path: {2}", item.Name, item.GetType().Name, item.Path ?? string.Empty);
|
||||
_logger.LogInformation("Cleaning item {0} type: {1} path: {2}", item.Name, item.GetType().Name, item.Path ?? string.Empty);
|
||||
|
||||
_libraryManager.DeleteItem(item, new DeleteOptions
|
||||
{
|
||||
|
@ -75,4 +75,4 @@ namespace Emby.Server.Implementations.Data
|
|||
progress.Report(100);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,7 +7,7 @@ using MediaBrowser.Common.Extensions;
|
|||
using MediaBrowser.Controller.Persistence;
|
||||
using MediaBrowser.Model.Entities;
|
||||
using MediaBrowser.Model.IO;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using MediaBrowser.Model.Serialization;
|
||||
using SQLitePCL.pretty;
|
||||
|
||||
|
@ -53,7 +53,7 @@ namespace Emby.Server.Implementations.Data
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.ErrorException("Error loading database file. Will reset and retry.", ex);
|
||||
Logger.LogError(ex, "Error loading database file. Will reset and retry.");
|
||||
|
||||
FileSystem.DeleteFile(DbFilePath);
|
||||
|
||||
|
@ -251,4 +251,4 @@ namespace Emby.Server.Implementations.Data
|
|||
return GetDisplayPreferences(displayPreferencesId, new Guid(userId), client);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@ using MediaBrowser.Model.Dto;
|
|||
using MediaBrowser.Model.Entities;
|
||||
using MediaBrowser.Model.IO;
|
||||
using MediaBrowser.Model.LiveTv;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using MediaBrowser.Model.Querying;
|
||||
using MediaBrowser.Model.Serialization;
|
||||
using MediaBrowser.Model.Reflection;
|
||||
|
@ -667,7 +667,7 @@ namespace Emby.Server.Implementations.Data
|
|||
var userDataKey = tuple.Item4;
|
||||
|
||||
SaveItem(item, topParent, userDataKey, saveItemStatement);
|
||||
//Logger.Debug(_saveItemCommand.CommandText);
|
||||
//logger.LogDebug(_saveItemCommand.CommandText);
|
||||
|
||||
var inheritedTags = tuple.Item5;
|
||||
|
||||
|
@ -886,12 +886,12 @@ namespace Emby.Server.Implementations.Data
|
|||
|
||||
if (topParent != null)
|
||||
{
|
||||
//Logger.Debug("Item {0} has top parent {1}", item.Id, topParent.Id);
|
||||
//logger.LogDebug("Item {0} has top parent {1}", item.Id, topParent.Id);
|
||||
saveItemStatement.TryBind("@TopParentId", topParent.Id.ToString("N"));
|
||||
}
|
||||
else
|
||||
{
|
||||
//Logger.Debug("Item {0} has null top parent", item.Id);
|
||||
//logger.LogDebug("Item {0} has null top parent", item.Id);
|
||||
saveItemStatement.TryBindNull("@TopParentId");
|
||||
}
|
||||
|
||||
|
@ -1148,7 +1148,7 @@ namespace Emby.Server.Implementations.Data
|
|||
}
|
||||
}
|
||||
|
||||
item.ImageInfos = list.ToArray(list.Count);
|
||||
item.ImageInfos = list.ToArray();
|
||||
}
|
||||
|
||||
public string ToValueString(ItemImageInfo image)
|
||||
|
@ -1230,7 +1230,7 @@ namespace Emby.Server.Implementations.Data
|
|||
}
|
||||
|
||||
CheckDisposed();
|
||||
//Logger.Info("Retrieving item {0}", id.ToString("N"));
|
||||
//logger.LogInformation("Retrieving item {0}", id.ToString("N"));
|
||||
using (WriteLock.Read())
|
||||
{
|
||||
using (var connection = CreateConnection(true))
|
||||
|
@ -1345,7 +1345,7 @@ namespace Emby.Server.Implementations.Data
|
|||
|
||||
if (type == null)
|
||||
{
|
||||
//Logger.Debug("Unknown type {0}", typeString);
|
||||
//logger.LogDebug("Unknown type {0}", typeString);
|
||||
|
||||
return null;
|
||||
}
|
||||
|
@ -1364,7 +1364,7 @@ namespace Emby.Server.Implementations.Data
|
|||
}
|
||||
catch (SerializationException ex)
|
||||
{
|
||||
Logger.ErrorException("Error deserializing item", ex);
|
||||
Logger.LogError(ex, "Error deserializing item");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2566,7 +2566,7 @@ namespace Emby.Server.Implementations.Data
|
|||
excludeIds.Add(item.Id);
|
||||
excludeIds.AddRange(item.ExtraIds);
|
||||
|
||||
query.ExcludeItemIds = excludeIds.ToArray(excludeIds.Count);
|
||||
query.ExcludeItemIds = excludeIds.ToArray();
|
||||
query.ExcludeProviderIds = item.ProviderIds;
|
||||
}
|
||||
|
||||
|
@ -2587,7 +2587,7 @@ namespace Emby.Server.Implementations.Data
|
|||
list.Add(builder.ToString());
|
||||
}
|
||||
|
||||
return list.ToArray(list.Count);
|
||||
return list.ToArray();
|
||||
}
|
||||
|
||||
private void BindSearchParams(InternalItemsQuery query, IStatement statement)
|
||||
|
@ -2666,7 +2666,7 @@ namespace Emby.Server.Implementations.Data
|
|||
|
||||
if (groups.Count > 0)
|
||||
{
|
||||
return " Group by " + string.Join(",", groups.ToArray(groups.Count));
|
||||
return " Group by " + string.Join(",", groups.ToArray());
|
||||
}
|
||||
|
||||
return string.Empty;
|
||||
|
@ -2686,7 +2686,7 @@ namespace Emby.Server.Implementations.Data
|
|||
|
||||
CheckDisposed();
|
||||
|
||||
//Logger.Info("GetItemList: " + _environmentInfo.StackTrace);
|
||||
//logger.LogInformation("GetItemList: " + _environmentInfo.StackTrace);
|
||||
|
||||
var now = DateTime.UtcNow;
|
||||
|
||||
|
@ -2703,7 +2703,7 @@ namespace Emby.Server.Implementations.Data
|
|||
|
||||
var whereText = whereClauses.Count == 0 ?
|
||||
string.Empty :
|
||||
" where " + string.Join(" AND ", whereClauses.ToArray(whereClauses.Count));
|
||||
" where " + string.Join(" AND ", whereClauses.ToArray());
|
||||
|
||||
commandText += whereText;
|
||||
|
||||
|
@ -2744,7 +2744,7 @@ namespace Emby.Server.Implementations.Data
|
|||
|
||||
CheckDisposed();
|
||||
|
||||
//Logger.Info("GetItemList: " + _environmentInfo.StackTrace);
|
||||
//logger.LogInformation("GetItemList: " + _environmentInfo.StackTrace);
|
||||
|
||||
var now = DateTime.UtcNow;
|
||||
|
||||
|
@ -2761,7 +2761,7 @@ namespace Emby.Server.Implementations.Data
|
|||
|
||||
var whereText = whereClauses.Count == 0 ?
|
||||
string.Empty :
|
||||
" where " + string.Join(" AND ", whereClauses.ToArray(whereClauses.Count));
|
||||
" where " + string.Join(" AND ", whereClauses.ToArray());
|
||||
|
||||
commandText += whereText;
|
||||
|
||||
|
@ -2910,14 +2910,14 @@ namespace Emby.Server.Implementations.Data
|
|||
|
||||
if (elapsed >= slowThreshold)
|
||||
{
|
||||
Logger.Debug("{2} query time (slow): {0}ms. Query: {1}",
|
||||
Logger.LogDebug("{2} query time (slow): {0}ms. Query: {1}",
|
||||
Convert.ToInt32(elapsed),
|
||||
commandText,
|
||||
methodName);
|
||||
}
|
||||
else
|
||||
{
|
||||
//Logger.Debug("{2} query time: {0}ms. Query: {1}",
|
||||
//logger.LogDebug("{2} query time: {0}ms. Query: {1}",
|
||||
// Convert.ToInt32(elapsed),
|
||||
// commandText,
|
||||
// methodName);
|
||||
|
@ -2938,11 +2938,11 @@ namespace Emby.Server.Implementations.Data
|
|||
var returnList = GetItemList(query);
|
||||
return new QueryResult<BaseItem>
|
||||
{
|
||||
Items = returnList.ToArray(returnList.Count),
|
||||
Items = returnList.ToArray(),
|
||||
TotalRecordCount = returnList.Count
|
||||
};
|
||||
}
|
||||
//Logger.Info("GetItems: " + _environmentInfo.StackTrace);
|
||||
//logger.LogInformation("GetItems: " + _environmentInfo.StackTrace);
|
||||
|
||||
var now = DateTime.UtcNow;
|
||||
|
||||
|
@ -2961,7 +2961,7 @@ namespace Emby.Server.Implementations.Data
|
|||
|
||||
var whereText = whereClauses.Count == 0 ?
|
||||
string.Empty :
|
||||
" where " + string.Join(" AND ", whereClauses.ToArray(whereClauses.Count));
|
||||
" where " + string.Join(" AND ", whereClauses.ToArray());
|
||||
|
||||
var whereTextWithoutPaging = whereText;
|
||||
|
||||
|
@ -3079,7 +3079,7 @@ namespace Emby.Server.Implementations.Data
|
|||
|
||||
LogQueryTime("GetItems", commandText, now);
|
||||
|
||||
result.Items = list.ToArray(list.Count);
|
||||
result.Items = list.ToArray();
|
||||
return result;
|
||||
|
||||
}, ReadTransactionMode);
|
||||
|
@ -3216,7 +3216,7 @@ namespace Emby.Server.Implementations.Data
|
|||
}
|
||||
|
||||
CheckDisposed();
|
||||
//Logger.Info("GetItemIdsList: " + _environmentInfo.StackTrace);
|
||||
//logger.LogInformation("GetItemIdsList: " + _environmentInfo.StackTrace);
|
||||
|
||||
var now = DateTime.UtcNow;
|
||||
|
||||
|
@ -3227,7 +3227,7 @@ namespace Emby.Server.Implementations.Data
|
|||
|
||||
var whereText = whereClauses.Count == 0 ?
|
||||
string.Empty :
|
||||
" where " + string.Join(" AND ", whereClauses.ToArray(whereClauses.Count));
|
||||
" where " + string.Join(" AND ", whereClauses.ToArray());
|
||||
|
||||
commandText += whereText;
|
||||
|
||||
|
@ -3299,7 +3299,7 @@ namespace Emby.Server.Implementations.Data
|
|||
|
||||
var whereText = whereClauses.Count == 0 ?
|
||||
string.Empty :
|
||||
" where " + string.Join(" AND ", whereClauses.ToArray(whereClauses.Count));
|
||||
" where " + string.Join(" AND ", whereClauses.ToArray());
|
||||
|
||||
commandText += whereText;
|
||||
|
||||
|
@ -3372,11 +3372,11 @@ namespace Emby.Server.Implementations.Data
|
|||
var returnList = GetItemIdsList(query);
|
||||
return new QueryResult<Guid>
|
||||
{
|
||||
Items = returnList.ToArray(returnList.Count),
|
||||
Items = returnList.ToArray(),
|
||||
TotalRecordCount = returnList.Count
|
||||
};
|
||||
}
|
||||
//Logger.Info("GetItemIds: " + _environmentInfo.StackTrace);
|
||||
//logger.LogInformation("GetItemIds: " + _environmentInfo.StackTrace);
|
||||
|
||||
var now = DateTime.UtcNow;
|
||||
|
||||
|
@ -3387,7 +3387,7 @@ namespace Emby.Server.Implementations.Data
|
|||
|
||||
var whereText = whereClauses.Count == 0 ?
|
||||
string.Empty :
|
||||
" where " + string.Join(" AND ", whereClauses.ToArray(whereClauses.Count));
|
||||
" where " + string.Join(" AND ", whereClauses.ToArray());
|
||||
|
||||
var whereTextWithoutPaging = whereText;
|
||||
|
||||
|
@ -3495,7 +3495,7 @@ namespace Emby.Server.Implementations.Data
|
|||
|
||||
LogQueryTime("GetItemIds", commandText, now);
|
||||
|
||||
result.Items = list.ToArray(list.Count);
|
||||
result.Items = list.ToArray();
|
||||
return result;
|
||||
|
||||
}, ReadTransactionMode);
|
||||
|
@ -3690,7 +3690,7 @@ namespace Emby.Server.Implementations.Data
|
|||
statement.TryBind("@IsMovie", true);
|
||||
}
|
||||
|
||||
whereClauses.Add("(" + string.Join(" OR ", programAttribtues.ToArray(programAttribtues.Count)) + ")");
|
||||
whereClauses.Add("(" + string.Join(" OR ", programAttribtues.ToArray()) + ")");
|
||||
}
|
||||
else if (query.IsMovie.HasValue)
|
||||
{
|
||||
|
@ -5565,7 +5565,7 @@ where AncestorIdText not null and ItemValues.Value not null and ItemValues.Type
|
|||
}
|
||||
|
||||
CheckDisposed();
|
||||
//Logger.Info("GetItemValues: " + _environmentInfo.StackTrace);
|
||||
//logger.LogInformation("GetItemValues: " + _environmentInfo.StackTrace);
|
||||
|
||||
var now = DateTime.UtcNow;
|
||||
|
||||
|
@ -5734,7 +5734,7 @@ where AncestorIdText not null and ItemValues.Value not null and ItemValues.Type
|
|||
var list = new List<Tuple<BaseItem, ItemCounts>>();
|
||||
var result = new QueryResult<Tuple<BaseItem, ItemCounts>>();
|
||||
|
||||
//Logger.Info("GetItemValues {0}", string.Join(";", statementTexts.ToArray()));
|
||||
//logger.LogInformation("GetItemValues {0}", string.Join(";", statementTexts.ToArray()));
|
||||
var statements = PrepareAllSafe(db, statementTexts);
|
||||
|
||||
if (!isReturningZeroItems)
|
||||
|
@ -5813,7 +5813,7 @@ where AncestorIdText not null and ItemValues.Value not null and ItemValues.Type
|
|||
{
|
||||
result.TotalRecordCount = list.Count;
|
||||
}
|
||||
result.Items = list.ToArray(list.Count);
|
||||
result.Items = list.ToArray();
|
||||
|
||||
return result;
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ using MediaBrowser.Common.Configuration;
|
|||
using MediaBrowser.Controller.Entities;
|
||||
using MediaBrowser.Controller.Persistence;
|
||||
using MediaBrowser.Model.IO;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using SQLitePCL.pretty;
|
||||
using MediaBrowser.Controller.Library;
|
||||
|
||||
|
@ -416,4 +416,4 @@ namespace Emby.Server.Implementations.Data
|
|||
// handled by library database
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,7 +6,7 @@ using MediaBrowser.Controller;
|
|||
using MediaBrowser.Controller.Entities;
|
||||
using MediaBrowser.Controller.Persistence;
|
||||
using MediaBrowser.Model.IO;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using MediaBrowser.Model.Serialization;
|
||||
using SQLitePCL.pretty;
|
||||
|
||||
|
@ -74,7 +74,7 @@ namespace Emby.Server.Implementations.Data
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.ErrorException("Error migrating users database", ex);
|
||||
Logger.LogError(ex, "Error migrating users database");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -233,4 +233,4 @@ namespace Emby.Server.Implementations.Data
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@ using System.IO;
|
|||
using System.Text;
|
||||
using MediaBrowser.Common.Configuration;
|
||||
using MediaBrowser.Model.IO;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace Emby.Server.Implementations.Devices
|
||||
{
|
||||
|
@ -34,7 +34,7 @@ namespace Emby.Server.Implementations.Devices
|
|||
return value;
|
||||
}
|
||||
|
||||
_logger.Error("Invalid value found in device id file");
|
||||
_logger.LogError("Invalid value found in device id file");
|
||||
}
|
||||
}
|
||||
catch (DirectoryNotFoundException)
|
||||
|
@ -45,7 +45,7 @@ namespace Emby.Server.Implementations.Devices
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.ErrorException("Error reading file", ex);
|
||||
_logger.LogError(ex, "Error reading file");
|
||||
}
|
||||
|
||||
return null;
|
||||
|
@ -66,7 +66,7 @@ namespace Emby.Server.Implementations.Devices
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.ErrorException("Error writing to file", ex);
|
||||
_logger.LogError(ex, "Error writing to file");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ using MediaBrowser.Controller.Library;
|
|||
using MediaBrowser.Model.Devices;
|
||||
using MediaBrowser.Model.Events;
|
||||
using MediaBrowser.Model.Extensions;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using MediaBrowser.Model.Net;
|
||||
using MediaBrowser.Model.Querying;
|
||||
using MediaBrowser.Model.Session;
|
||||
|
@ -289,7 +289,7 @@ namespace Emby.Server.Implementations.Devices
|
|||
|
||||
var list = history.FilesUploaded.ToList();
|
||||
list.Add(file);
|
||||
history.FilesUploaded = list.ToArray(list.Count);
|
||||
history.FilesUploaded = list.ToArray();
|
||||
|
||||
_json.SerializeToFile(history, path);
|
||||
}
|
||||
|
@ -434,7 +434,7 @@ namespace Emby.Server.Implementations.Devices
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.ErrorException("Error creating camera uploads library", ex);
|
||||
_logger.LogError(ex, "Error creating camera uploads library");
|
||||
}
|
||||
|
||||
_config.Configuration.CameraUploadUpgraded = true;
|
||||
|
@ -501,4 +501,4 @@ namespace Emby.Server.Implementations.Devices
|
|||
return config.GetConfiguration<DevicesOptions>("devices");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@ using MediaBrowser.Controller.Sync;
|
|||
using MediaBrowser.Model.Drawing;
|
||||
using MediaBrowser.Model.Dto;
|
||||
using MediaBrowser.Model.Entities;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using MediaBrowser.Model.Querying;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
@ -225,7 +225,7 @@ namespace Emby.Server.Implementations.Dto
|
|||
catch (Exception ex)
|
||||
{
|
||||
// Have to use a catch-all unfortunately because some .net image methods throw plain Exceptions
|
||||
_logger.ErrorException("Error generating PrimaryImageAspectRatio for {0}", ex, item.Name);
|
||||
_logger.LogError(ex, "Error generating PrimaryImageAspectRatio for {itemName}", item.Name);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -547,7 +547,7 @@ namespace Emby.Server.Implementations.Dto
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.ErrorException("Error getting {0} image info", ex, type);
|
||||
_logger.LogError(ex, "Error getting {type} image info", type);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
@ -560,7 +560,7 @@ namespace Emby.Server.Implementations.Dto
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.ErrorException("Error getting {0} image info for {1}", ex, image.Type, image.Path);
|
||||
_logger.LogError(ex, "Error getting {imageType} image info for {path}", image.Type, image.Path);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
@ -619,7 +619,7 @@ namespace Emby.Server.Implementations.Dto
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.ErrorException("Error getting person {0}", ex, c);
|
||||
_logger.LogError(ex, "Error getting person {Name}", c);
|
||||
return null;
|
||||
}
|
||||
|
||||
|
@ -648,7 +648,7 @@ namespace Emby.Server.Implementations.Dto
|
|||
}
|
||||
}
|
||||
|
||||
dto.People = list.ToArray(list.Count);
|
||||
dto.People = list.ToArray();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -1451,7 +1451,7 @@ namespace Emby.Server.Implementations.Dto
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
//_logger.ErrorException("Failed to determine primary image aspect ratio for {0}", ex, imageInfo.Path);
|
||||
_logger.LogError(ex, "Failed to determine primary image aspect ratio for {0}", imageInfo.Path);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
@ -1464,7 +1464,7 @@ namespace Emby.Server.Implementations.Dto
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.ErrorException("Error in image enhancer: {0}", ex, enhancer.GetType().Name);
|
||||
_logger.LogError(ex, "Error in image enhancer: {0}", enhancer.GetType().Name);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="Localization\iso6392.txt" />
|
||||
<EmbeddedResource Include="Localization\countries.json" />
|
||||
<EmbeddedResource Include="Localization\Core\*.json" />
|
||||
|
@ -46,6 +46,6 @@
|
|||
<EmbeddedResource Include="TextEncoding\NLangDetect\Utils\messages.properties" />
|
||||
<EmbeddedResource Include="Localization\Ratings\*.txt" />
|
||||
<EmbeddedResource Include="values.txt" />
|
||||
</ItemGroup>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
using MediaBrowser.Controller.Configuration;
|
||||
using MediaBrowser.Controller.Plugins;
|
||||
using MediaBrowser.Controller.Session;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using MediaBrowser.Model.Tasks;
|
||||
using System;
|
||||
using System.Linq;
|
||||
|
@ -65,7 +65,7 @@ namespace Emby.Server.Implementations.EntryPoints
|
|||
{
|
||||
DisposeTimer();
|
||||
|
||||
_logger.Info("Automatically restarting the system because it is idle and a restart is required.");
|
||||
_logger.LogInformation("Automatically restarting the system because it is idle and a restart is required.");
|
||||
|
||||
try
|
||||
{
|
||||
|
@ -73,7 +73,7 @@ namespace Emby.Server.Implementations.EntryPoints
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.ErrorException("Error restarting server", ex);
|
||||
_logger.LogError(ex, "Error restarting server");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -98,7 +98,7 @@ namespace Emby.Server.Implementations.EntryPoints
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.ErrorException("Error getting timers", ex);
|
||||
_logger.LogError(ex, "Error getting timers");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -9,10 +9,9 @@ using MediaBrowser.Controller.Configuration;
|
|||
using MediaBrowser.Controller.Plugins;
|
||||
using MediaBrowser.Model.Dlna;
|
||||
using MediaBrowser.Model.Events;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using MediaBrowser.Model.Threading;
|
||||
using Mono.Nat;
|
||||
using MediaBrowser.Model.Extensions;
|
||||
using System.Threading;
|
||||
|
||||
namespace Emby.Server.Implementations.EntryPoints
|
||||
|
@ -30,9 +29,9 @@ namespace Emby.Server.Implementations.EntryPoints
|
|||
|
||||
private NatManager _natManager;
|
||||
|
||||
public ExternalPortForwarding(ILogManager logmanager, IServerApplicationHost appHost, IServerConfigurationManager config, IDeviceDiscovery deviceDiscovery, IHttpClient httpClient, ITimerFactory timerFactory)
|
||||
public ExternalPortForwarding(ILoggerFactory loggerFactory, IServerApplicationHost appHost, IServerConfigurationManager config, IDeviceDiscovery deviceDiscovery, IHttpClient httpClient, ITimerFactory timerFactory)
|
||||
{
|
||||
_logger = logmanager.GetLogger("PortMapper");
|
||||
_logger = loggerFactory.CreateLogger("PortMapper");
|
||||
_appHost = appHost;
|
||||
_config = config;
|
||||
_deviceDiscovery = deviceDiscovery;
|
||||
|
@ -59,7 +58,7 @@ namespace Emby.Server.Implementations.EntryPoints
|
|||
values.Add(_appHost.EnableHttps.ToString());
|
||||
values.Add((config.EnableRemoteAccess).ToString());
|
||||
|
||||
return string.Join("|", values.ToArray(values.Count));
|
||||
return string.Join("|", values.ToArray());
|
||||
}
|
||||
|
||||
void _config_ConfigurationUpdated(object sender, EventArgs e)
|
||||
|
@ -85,7 +84,7 @@ namespace Emby.Server.Implementations.EntryPoints
|
|||
|
||||
private void Start()
|
||||
{
|
||||
_logger.Debug("Starting NAT discovery");
|
||||
_logger.LogDebug("Starting NAT discovery");
|
||||
if (_natManager == null)
|
||||
{
|
||||
_natManager = new NatManager(_logger, _httpClient);
|
||||
|
@ -140,7 +139,7 @@ namespace Emby.Server.Implementations.EntryPoints
|
|||
_usnsHandled.Add(identifier);
|
||||
}
|
||||
|
||||
_logger.Debug("Found NAT device: " + identifier);
|
||||
_logger.LogDebug("Found NAT device: " + identifier);
|
||||
|
||||
IPAddress address;
|
||||
if (IPAddress.TryParse(info.Location.Host, out address))
|
||||
|
@ -167,6 +166,7 @@ namespace Emby.Server.Implementations.EntryPoints
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, "Error");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -217,7 +217,7 @@ namespace Emby.Server.Implementations.EntryPoints
|
|||
catch
|
||||
{
|
||||
// Commenting out because users are reporting problems out of our control
|
||||
//_logger.ErrorException("Error creating port forwarding rules", ex);
|
||||
//_logger.LogError(ex, "Error creating port forwarding rules");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -254,6 +254,7 @@ namespace Emby.Server.Implementations.EntryPoints
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, "Error creating http port map");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -263,12 +264,13 @@ namespace Emby.Server.Implementations.EntryPoints
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, "Error creating https port map");
|
||||
}
|
||||
}
|
||||
|
||||
private Task CreatePortMap(INatDevice device, int privatePort, int publicPort)
|
||||
{
|
||||
_logger.Debug("Creating port map on local port {0} to public port {1} with device {2}", privatePort, publicPort, device.LocalAddress.ToString());
|
||||
_logger.LogDebug("Creating port map on local port {0} to public port {1} with device {2}", privatePort, publicPort, device.LocalAddress.ToString());
|
||||
|
||||
return device.CreatePortMap(new Mapping(Protocol.Tcp, privatePort, publicPort)
|
||||
{
|
||||
|
@ -285,7 +287,7 @@ namespace Emby.Server.Implementations.EntryPoints
|
|||
|
||||
private void DisposeNat()
|
||||
{
|
||||
_logger.Debug("Stopping NAT discovery");
|
||||
_logger.LogDebug("Stopping NAT discovery");
|
||||
|
||||
if (_timer != null)
|
||||
{
|
||||
|
@ -310,10 +312,10 @@ namespace Emby.Server.Implementations.EntryPoints
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.ErrorException("Error stopping NAT Discovery", ex);
|
||||
_logger.LogError(ex, "Error stopping NAT Discovery");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
using MediaBrowser.Controller;
|
||||
using MediaBrowser.Controller.Plugins;
|
||||
using MediaBrowser.Controller.Session;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using MediaBrowser.Model.System;
|
||||
|
@ -49,7 +49,7 @@ namespace Emby.Server.Implementations.EntryPoints
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.ErrorException("Error resetting system standby timer", ex);
|
||||
_logger.LogError(ex, "Error resetting system standby timer");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@ using MediaBrowser.Controller.Library;
|
|||
using MediaBrowser.Controller.Plugins;
|
||||
using MediaBrowser.Controller.Session;
|
||||
using MediaBrowser.Model.Entities;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
|
@ -331,7 +331,7 @@ namespace Emby.Server.Implementations.EntryPoints
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.ErrorException("Error in GetLibraryUpdateInfo", ex);
|
||||
_logger.LogError(ex, "Error in GetLibraryUpdateInfo");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -346,7 +346,7 @@ namespace Emby.Server.Implementations.EntryPoints
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.ErrorException("Error sending LibraryChanged message", ex);
|
||||
_logger.LogError(ex, "Error sending LibraryChanged message");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@ using MediaBrowser.Controller.Library;
|
|||
using MediaBrowser.Controller.LiveTv;
|
||||
using MediaBrowser.Controller.Plugins;
|
||||
using MediaBrowser.Controller.Session;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace Emby.Server.Implementations.EntryPoints
|
||||
{
|
||||
|
@ -66,7 +66,7 @@ namespace Emby.Server.Implementations.EntryPoints
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.ErrorException("Error sending message", ex);
|
||||
_logger.LogError(ex, "Error sending message");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -156,14 +156,10 @@ namespace Emby.Server.Implementations.EntryPoints
|
|||
try
|
||||
{
|
||||
await _sessionManager.SendMessageToAdminSessions(name, data, CancellationToken.None);
|
||||
}
|
||||
catch (ObjectDisposedException)
|
||||
{
|
||||
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
//Logger.ErrorException("Error sending message", ex);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -172,14 +168,10 @@ namespace Emby.Server.Implementations.EntryPoints
|
|||
try
|
||||
{
|
||||
await _sessionManager.SendMessageToUserSessions(new List<Guid> { user.Id }, name, data, CancellationToken.None);
|
||||
}
|
||||
catch (ObjectDisposedException)
|
||||
{
|
||||
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
//Logger.ErrorException("Error sending message", ex);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
using Emby.Server.Implementations.Browser;
|
||||
using MediaBrowser.Controller;
|
||||
using MediaBrowser.Controller.Plugins;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using MediaBrowser.Controller.Configuration;
|
||||
|
||||
namespace Emby.Server.Implementations.EntryPoints
|
||||
|
@ -61,4 +61,4 @@ namespace Emby.Server.Implementations.EntryPoints
|
|||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
using System;
|
||||
using MediaBrowser.Controller;
|
||||
using MediaBrowser.Controller.Plugins;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using MediaBrowser.Model.Serialization;
|
||||
using Emby.Server.Implementations.Udp;
|
||||
using MediaBrowser.Model.Net;
|
||||
|
@ -45,9 +45,6 @@ namespace Emby.Server.Implementations.EntryPoints
|
|||
/// </summary>
|
||||
public void Run()
|
||||
{
|
||||
// ToDo: Fix This
|
||||
return;
|
||||
|
||||
var udpServer = new UdpServer(_logger, _appHost, _json, _socketFactory);
|
||||
|
||||
try
|
||||
|
@ -58,7 +55,7 @@ namespace Emby.Server.Implementations.EntryPoints
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.ErrorException("Failed to start UDP Server", ex);
|
||||
_logger.LogError(ex, "Failed to start UDP Server");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@ using MediaBrowser.Common.Net;
|
|||
using MediaBrowser.Controller.Library;
|
||||
using MediaBrowser.Controller.Plugins;
|
||||
using MediaBrowser.Controller.Session;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System;
|
||||
using System.Collections.Concurrent;
|
||||
using System.Collections.Generic;
|
||||
|
@ -58,7 +58,7 @@ namespace Emby.Server.Implementations.EntryPoints
|
|||
session.ApplicationVersion
|
||||
};
|
||||
|
||||
var key = string.Join("_", keys.ToArray(keys.Count)).GetMD5();
|
||||
var key = string.Join("_", keys.ToArray()).GetMD5();
|
||||
|
||||
ClientInfo info;
|
||||
if (!_apps.TryGetValue(key, out info))
|
||||
|
@ -91,7 +91,7 @@ namespace Emby.Server.Implementations.EntryPoints
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
//_logger.ErrorException("Error sending anonymous usage statistics.", ex);
|
||||
_logger.LogError(ex, "Error sending anonymous usage statistics.");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -119,7 +119,7 @@ namespace Emby.Server.Implementations.EntryPoints
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
//_logger.ErrorException("Error sending anonymous usage statistics.", ex);
|
||||
_logger.LogError(ex, "Error sending anonymous usage statistics.");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ using System.Linq;
|
|||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using MediaBrowser.Controller;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace Emby.Server.Implementations.EntryPoints
|
||||
{
|
||||
|
@ -75,7 +75,7 @@ namespace Emby.Server.Implementations.EntryPoints
|
|||
throw new ArgumentException("Client info must have a device Id");
|
||||
}
|
||||
|
||||
_logger.Info("App Activity: app: {0}, version: {1}, deviceId: {2}, deviceName: {3}",
|
||||
_logger.LogInformation("App Activity: app: {0}, version: {1}, deviceId: {2}, deviceName: {3}",
|
||||
app.AppName ?? "Unknown App",
|
||||
app.AppVersion ?? "Unknown",
|
||||
app.DeviceId,
|
||||
|
|
|
@ -3,7 +3,7 @@ using MediaBrowser.Controller.Library;
|
|||
using MediaBrowser.Controller.Plugins;
|
||||
using MediaBrowser.Controller.Session;
|
||||
using MediaBrowser.Model.Entities;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using MediaBrowser.Model.Session;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
|
|
@ -92,4 +92,4 @@ namespace Emby.Server.Implementations.EnvironmentInfo
|
|||
Environment.SetEnvironmentVariable(name, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
using MediaBrowser.Common.Configuration;
|
||||
using MediaBrowser.Common.Net;
|
||||
using MediaBrowser.Model.IO;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
|
|
@ -14,7 +14,7 @@ using MediaBrowser.Common.Configuration;
|
|||
using MediaBrowser.Common.Extensions;
|
||||
using MediaBrowser.Common.Net;
|
||||
using MediaBrowser.Model.IO;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using MediaBrowser.Model.Net;
|
||||
using MediaBrowser.Controller.IO;
|
||||
|
||||
|
@ -131,7 +131,7 @@ namespace Emby.Server.Implementations.HttpClientManager
|
|||
var userInfo = uriAddress.UserInfo;
|
||||
if (!string.IsNullOrWhiteSpace(userInfo))
|
||||
{
|
||||
_logger.Info("Found userInfo in url: {0} ... url: {1}", userInfo, url);
|
||||
_logger.LogInformation("Found userInfo in url: {0} ... url: {1}", userInfo, url);
|
||||
url = url.Replace(userInfo + "@", string.Empty);
|
||||
}
|
||||
|
||||
|
@ -421,11 +421,11 @@ namespace Emby.Server.Implementations.HttpClientManager
|
|||
{
|
||||
if (options.LogRequestAsDebug)
|
||||
{
|
||||
_logger.Debug("HttpClientManager {0}: {1}", httpMethod.ToUpper(), options.Url);
|
||||
_logger.LogDebug("HttpClientManager {0}: {1}", httpMethod.ToUpper(), options.Url);
|
||||
}
|
||||
else
|
||||
{
|
||||
_logger.Info("HttpClientManager {0}: {1}", httpMethod.ToUpper(), options.Url);
|
||||
_logger.LogInformation("HttpClientManager {0}: {1}", httpMethod.ToUpper(), options.Url);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -595,11 +595,11 @@ namespace Emby.Server.Implementations.HttpClientManager
|
|||
{
|
||||
if (options.LogRequestAsDebug)
|
||||
{
|
||||
_logger.Debug("HttpClientManager.GetTempFileResponse url: {0}", options.Url);
|
||||
_logger.LogDebug("HttpClientManager.GetTempFileResponse url: {0}", options.Url);
|
||||
}
|
||||
else
|
||||
{
|
||||
_logger.Info("HttpClientManager.GetTempFileResponse url: {0}", options.Url);
|
||||
_logger.LogInformation("HttpClientManager.GetTempFileResponse url: {0}", options.Url);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -685,7 +685,7 @@ namespace Emby.Server.Implementations.HttpClientManager
|
|||
{
|
||||
if (options.LogErrors)
|
||||
{
|
||||
_logger.ErrorException("Error " + webException.Status + " getting response from " + options.Url, webException);
|
||||
_logger.LogError(webException, "Error {status} getting response from {url}", webException.Status, options.Url);
|
||||
}
|
||||
|
||||
var exception = new HttpException(webException.Message, webException);
|
||||
|
@ -723,7 +723,7 @@ namespace Emby.Server.Implementations.HttpClientManager
|
|||
|
||||
if (options.LogErrors)
|
||||
{
|
||||
_logger.ErrorException("Error getting response from " + options.Url, ex);
|
||||
_logger.LogError(ex, "Error getting response from {url}", options.Url);
|
||||
}
|
||||
|
||||
return ex;
|
||||
|
@ -789,7 +789,7 @@ namespace Emby.Server.Implementations.HttpClientManager
|
|||
|
||||
if (options.LogErrors)
|
||||
{
|
||||
_logger.Error(msg);
|
||||
_logger.LogError(msg);
|
||||
}
|
||||
|
||||
client.LastTimeout = DateTime.UtcNow;
|
||||
|
@ -824,7 +824,7 @@ namespace Emby.Server.Implementations.HttpClientManager
|
|||
{
|
||||
var msg = reader.ReadToEnd();
|
||||
|
||||
_logger.Error(msg);
|
||||
_logger.LogError(msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@ using System.Net;
|
|||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using MediaBrowser.Model.IO;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using MediaBrowser.Model.Services;
|
||||
using System.Linq;
|
||||
|
||||
|
@ -102,7 +102,7 @@ namespace Emby.Server.Implementations.HttpServer
|
|||
var rangeString = string.Format("bytes {0}-{1}/{2}", RangeStart, RangeEnd, TotalContentLength);
|
||||
Headers["Content-Range"] = rangeString;
|
||||
|
||||
Logger.Info("Setting range response values for {0}. RangeRequest: {1} Content-Length: {2}, Content-Range: {3}", Path, RangeHeader, lengthString, rangeString);
|
||||
Logger.LogInformation("Setting range response values for {0}. RangeRequest: {1} Content-Length: {2}, Content-Range: {3}", Path, RangeHeader, lengthString, rangeString);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -173,7 +173,7 @@ namespace Emby.Server.Implementations.HttpServer
|
|||
|
||||
if (extension == null || !SkipLogExtensions.Contains(extension, StringComparer.OrdinalIgnoreCase))
|
||||
{
|
||||
Logger.Debug("Transmit file {0}", path);
|
||||
Logger.LogDebug("Transmit file {0}", path);
|
||||
}
|
||||
|
||||
//var count = FileShare == FileShareMode.ReadWrite ? TotalContentLength : 0;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
using MediaBrowser.Common.Extensions;
|
||||
using MediaBrowser.Controller.Configuration;
|
||||
using MediaBrowser.Controller.Net;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
|
@ -252,11 +252,11 @@ namespace Emby.Server.Implementations.HttpServer
|
|||
|
||||
if (logExceptionStackTrace)
|
||||
{
|
||||
_logger.ErrorException("Error processing request", ex);
|
||||
_logger.LogError(ex, "Error processing request");
|
||||
}
|
||||
else if (logExceptionMessage)
|
||||
{
|
||||
_logger.Error(ex.Message);
|
||||
_logger.LogError(ex.Message);
|
||||
}
|
||||
|
||||
var httpRes = httpReq.Response;
|
||||
|
@ -272,9 +272,9 @@ namespace Emby.Server.Implementations.HttpServer
|
|||
httpRes.ContentType = "text/html";
|
||||
await Write(httpRes, NormalizeExceptionMessage(ex.Message)).ConfigureAwait(false);
|
||||
}
|
||||
catch
|
||||
catch (Exception errorEx)
|
||||
{
|
||||
//_logger.ErrorException("Error this.ProcessRequest(context)(Exception while writing error to the response)", errorEx);
|
||||
_logger.LogError(errorEx, "Error this.ProcessRequest(context)(Exception while writing error to the response)");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -320,10 +320,10 @@ namespace Emby.Server.Implementations.HttpServer
|
|||
|
||||
if (_listener != null)
|
||||
{
|
||||
_logger.Info("Stopping HttpListener...");
|
||||
_logger.LogInformation("Stopping HttpListener...");
|
||||
var task = _listener.Stop();
|
||||
Task.WaitAll(task);
|
||||
_logger.Info("HttpListener stopped");
|
||||
_logger.LogInformation("HttpListener stopped");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -713,12 +713,12 @@ namespace Emby.Server.Implementations.HttpServer
|
|||
var pathParts = pathInfo.TrimStart('/').Split('/');
|
||||
if (pathParts.Length == 0)
|
||||
{
|
||||
_logger.Error("Path parts empty for PathInfo: {0}, Url: {1}", pathInfo, httpReq.RawUrl);
|
||||
_logger.LogError("Path parts empty for PathInfo: {pathInfo}, Url: {RawUrl}", pathInfo, httpReq.RawUrl);
|
||||
return null;
|
||||
}
|
||||
|
||||
string contentType;
|
||||
var restPath = ServiceHandler.FindMatchingRestPath(httpReq.HttpMethod, pathInfo, _logger, out contentType);
|
||||
var restPath = ServiceHandler.FindMatchingRestPath(httpReq.HttpMethod, pathInfo, out contentType);
|
||||
|
||||
if (restPath != null)
|
||||
{
|
||||
|
@ -729,7 +729,7 @@ namespace Emby.Server.Implementations.HttpServer
|
|||
};
|
||||
}
|
||||
|
||||
_logger.Error("Could not find handler for {0}", pathInfo);
|
||||
_logger.LogError("Could not find handler for {pathInfo}", pathInfo);
|
||||
return null;
|
||||
}
|
||||
|
||||
|
@ -783,7 +783,7 @@ namespace Emby.Server.Implementations.HttpServer
|
|||
|
||||
ServiceController = new ServiceController();
|
||||
|
||||
_logger.Info("Calling ServiceStack AppHost.Init");
|
||||
_logger.LogInformation("Calling ServiceStack AppHost.Init");
|
||||
|
||||
var types = services.Select(r => r.GetType()).ToArray();
|
||||
|
||||
|
@ -825,7 +825,7 @@ namespace Emby.Server.Implementations.HttpServer
|
|||
});
|
||||
}
|
||||
|
||||
return routes.ToArray(routes.Count);
|
||||
return routes.ToArray();
|
||||
}
|
||||
|
||||
public Func<string, object> GetParseFn(Type propertyType)
|
||||
|
@ -853,7 +853,7 @@ namespace Emby.Server.Implementations.HttpServer
|
|||
//using (var reader = new StreamReader(stream))
|
||||
//{
|
||||
// var json = reader.ReadToEnd();
|
||||
// Logger.Info(json);
|
||||
// logger.LogInformation(json);
|
||||
// return _jsonSerializer.DeserializeFromString(json, type);
|
||||
//}
|
||||
return _jsonSerializer.DeserializeFromStreamAsync(stream, type);
|
||||
|
@ -919,7 +919,7 @@ namespace Emby.Server.Implementations.HttpServer
|
|||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
//_logger.Debug("Websocket message received: {0}", result.MessageType);
|
||||
_logger.LogDebug("Websocket message received: {0}", result.MessageType);
|
||||
|
||||
var tasks = _webSocketListeners.Select(i => Task.Run(async () =>
|
||||
{
|
||||
|
@ -929,7 +929,7 @@ namespace Emby.Server.Implementations.HttpServer
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.ErrorException("{0} failed processing WebSocket message {1}", ex, i.GetType().Name, result.MessageType ?? string.Empty);
|
||||
_logger.LogError(ex, "{0} failed processing WebSocket message {1}", i.GetType().Name, result.MessageType ?? string.Empty);
|
||||
}
|
||||
}));
|
||||
|
||||
|
@ -954,4 +954,4 @@ namespace Emby.Server.Implementations.HttpServer
|
|||
_listener.Start(UrlPrefixes);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
using MediaBrowser.Common.Extensions;
|
||||
using MediaBrowser.Controller.Net;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using MediaBrowser.Model.Serialization;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
@ -37,12 +37,12 @@ namespace Emby.Server.Implementations.HttpServer
|
|||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="HttpResultFactory" /> class.
|
||||
/// </summary>
|
||||
public HttpResultFactory(ILogManager logManager, IFileSystem fileSystem, IJsonSerializer jsonSerializer, IBrotliCompressor brotliCompressor)
|
||||
public HttpResultFactory(ILoggerFactory loggerfactory, IFileSystem fileSystem, IJsonSerializer jsonSerializer, IBrotliCompressor brotliCompressor)
|
||||
{
|
||||
_fileSystem = fileSystem;
|
||||
_jsonSerializer = jsonSerializer;
|
||||
_brotliCompressor = brotliCompressor;
|
||||
_logger = logManager.GetLogger("HttpResultFactory");
|
||||
_logger = loggerfactory.CreateLogger("HttpResultFactory");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -112,12 +112,15 @@ namespace Emby.Server.Implementations.HttpServer
|
|||
/// </summary>
|
||||
private IHasHeaders GetHttpResult(IRequest requestContext, byte[] content, string contentType, bool addCachePrevention, IDictionary<string, string> responseHeaders = null)
|
||||
{
|
||||
string compressionType = null;
|
||||
bool isHeadRequest = false;
|
||||
|
||||
if (requestContext != null) {
|
||||
compressionType = GetCompressionType(requestContext, content, contentType);
|
||||
isHeadRequest = string.Equals(requestContext.Verb, "head", StringComparison.OrdinalIgnoreCase);
|
||||
}
|
||||
|
||||
IHasHeaders result;
|
||||
|
||||
var compressionType = requestContext == null ? null : GetCompressionType(requestContext, content, contentType);
|
||||
|
||||
var isHeadRequest = string.Equals(requestContext.Verb, "head", StringComparison.OrdinalIgnoreCase);
|
||||
|
||||
if (string.IsNullOrEmpty(compressionType))
|
||||
{
|
||||
var contentLength = content.Length;
|
||||
|
@ -791,4 +794,4 @@ namespace Emby.Server.Implementations.HttpServer
|
|||
{
|
||||
byte[] Compress(byte[] content);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
using MediaBrowser.Model.Logging;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using MediaBrowser.Model.Services;
|
||||
|
@ -11,7 +11,7 @@ namespace Emby.Server.Implementations.HttpServer
|
|||
{
|
||||
if (headers == null)
|
||||
{
|
||||
logger.Info("{0} {1}. UserAgent: {2}", "HTTP " + method, url, userAgent ?? string.Empty);
|
||||
logger.LogInformation("{0} {1}. UserAgent: {2}", "HTTP " + method, url, userAgent ?? string.Empty);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -30,7 +30,7 @@ namespace Emby.Server.Implementations.HttpServer
|
|||
index++;
|
||||
}
|
||||
|
||||
logger.Info("HTTP {0} {1}. {2}", method, url, headerText);
|
||||
logger.LogInformation("HTTP {0} {1}. {2}", method, url, headerText);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -49,7 +49,7 @@ namespace Emby.Server.Implementations.HttpServer
|
|||
|
||||
//var headerText = headers == null ? string.Empty : "Headers: " + string.Join(", ", headers.Where(i => i.Name.IndexOf("Access-", StringComparison.OrdinalIgnoreCase) == -1).Select(i => i.Name + "=" + i.Value).ToArray());
|
||||
var headerText = string.Empty;
|
||||
logger.Info("HTTP Response {0} to {1}. Time: {2}{3}. {4} {5}", statusCode, endPoint, Convert.ToInt32(durationMs).ToString(CultureInfo.InvariantCulture), logSuffix, url, headerText);
|
||||
logger.LogInformation("HTTP Response {0} to {1}. Time: {2}{3}. {4} {5}", statusCode, endPoint, Convert.ToInt32(durationMs).ToString(CultureInfo.InvariantCulture), logSuffix, url, headerText);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
using MediaBrowser.Model.Logging;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
|
@ -226,4 +226,4 @@ namespace Emby.Server.Implementations.HttpServer
|
|||
|
||||
public string StatusDescription { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
using MediaBrowser.Model.Logging;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using System.Text;
|
||||
|
@ -34,7 +34,7 @@ namespace Emby.Server.Implementations.HttpServer
|
|||
|
||||
if (exception != null)
|
||||
{
|
||||
_logger.ErrorException("Error processing request for {0}", exception, req.RawUrl);
|
||||
_logger.LogError(exception, "Error processing request for {RawUrl}", req.RawUrl);
|
||||
|
||||
if (!string.IsNullOrEmpty(exception.Message))
|
||||
{
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
using MediaBrowser.Model.Logging;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
using System.Text;
|
||||
using MediaBrowser.Common.Events;
|
||||
using MediaBrowser.Controller.Net;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using MediaBrowser.Model.Net;
|
||||
using MediaBrowser.Model.Serialization;
|
||||
using System;
|
||||
|
@ -180,7 +180,7 @@ namespace Emby.Server.Implementations.HttpServer
|
|||
if (!message.StartsWith("{", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
// This info is useful sometimes but also clogs up the log
|
||||
//_logger.Error("Received web socket message that is not a json structure: " + message);
|
||||
_logger.LogDebug("Received web socket message that is not a json structure: {message}", message);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -204,7 +204,7 @@ namespace Emby.Server.Implementations.HttpServer
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.ErrorException("Error processing web socket message", ex);
|
||||
_logger.LogError(ex, "Error processing web socket message");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ using MediaBrowser.Controller.Entities;
|
|||
using MediaBrowser.Controller.IO;
|
||||
using MediaBrowser.Controller.Library;
|
||||
using MediaBrowser.Model.Extensions;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using MediaBrowser.Model.System;
|
||||
using MediaBrowser.Model.Tasks;
|
||||
using MediaBrowser.Model.Threading;
|
||||
|
@ -38,7 +38,7 @@ namespace Emby.Server.Implementations.IO
|
|||
|
||||
public FileRefresher(string path, IFileSystem fileSystem, IServerConfigurationManager configurationManager, ILibraryManager libraryManager, ITaskManager taskManager, ILogger logger, ITimerFactory timerFactory, IEnvironmentInfo environmentInfo, ILibraryManager libraryManager1)
|
||||
{
|
||||
logger.Debug("New file refresher created for {0}", path);
|
||||
logger.LogDebug("New file refresher created for {0}", path);
|
||||
Path = path;
|
||||
|
||||
_fileSystem = fileSystem;
|
||||
|
@ -108,7 +108,7 @@ namespace Emby.Server.Implementations.IO
|
|||
{
|
||||
lock (_timerLock)
|
||||
{
|
||||
Logger.Debug("Resetting file refresher from {0} to {1}", Path, path);
|
||||
Logger.LogDebug("Resetting file refresher from {0} to {1}", Path, path);
|
||||
|
||||
Path = path;
|
||||
AddAffectedPath(path);
|
||||
|
@ -130,7 +130,7 @@ namespace Emby.Server.Implementations.IO
|
|||
paths = _affectedPaths.ToList();
|
||||
}
|
||||
|
||||
Logger.Debug("Timer stopped.");
|
||||
Logger.LogDebug("Timer stopped.");
|
||||
|
||||
DisposeTimer();
|
||||
EventHelper.FireEventIfNotNull(Completed, this, EventArgs.Empty, Logger);
|
||||
|
@ -141,7 +141,7 @@ namespace Emby.Server.Implementations.IO
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.ErrorException("Error processing directory changes", ex);
|
||||
Logger.LogError(ex, "Error processing directory changes");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -161,7 +161,7 @@ namespace Emby.Server.Implementations.IO
|
|||
continue;
|
||||
}
|
||||
|
||||
Logger.Info(item.Name + " (" + item.Path + ") will be refreshed.");
|
||||
Logger.LogInformation("{name} ({path}}) will be refreshed.", item.Name, item.Path);
|
||||
|
||||
try
|
||||
{
|
||||
|
@ -172,11 +172,11 @@ namespace Emby.Server.Implementations.IO
|
|||
// For now swallow and log.
|
||||
// Research item: If an IOException occurs, the item may be in a disconnected state (media unavailable)
|
||||
// Should we remove it from it's parent?
|
||||
Logger.ErrorException("Error refreshing {0}", ex, item.Name);
|
||||
Logger.LogError(ex, "Error refreshing {name}", item.Name);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.ErrorException("Error refreshing {0}", ex, item.Name);
|
||||
Logger.LogError(ex, "Error refreshing {name}", item.Name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@ using MediaBrowser.Controller.Entities;
|
|||
using MediaBrowser.Controller.Library;
|
||||
using MediaBrowser.Controller.Plugins;
|
||||
using MediaBrowser.Model.IO;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using MediaBrowser.Model.System;
|
||||
using MediaBrowser.Model.Tasks;
|
||||
using MediaBrowser.Model.Threading;
|
||||
|
@ -114,7 +114,7 @@ namespace Emby.Server.Implementations.IO
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.ErrorException("Error in ReportFileSystemChanged for {0}", ex, path);
|
||||
Logger.LogError(ex, "Error in ReportFileSystemChanged for {path}", path);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -141,7 +141,7 @@ namespace Emby.Server.Implementations.IO
|
|||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="LibraryMonitor" /> class.
|
||||
/// </summary>
|
||||
public LibraryMonitor(ILogManager logManager, ITaskManager taskManager, ILibraryManager libraryManager, IServerConfigurationManager configurationManager, IFileSystem fileSystem, ITimerFactory timerFactory, ISystemEvents systemEvents, IEnvironmentInfo environmentInfo)
|
||||
public LibraryMonitor(ILoggerFactory loggerFactory, ITaskManager taskManager, ILibraryManager libraryManager, IServerConfigurationManager configurationManager, IFileSystem fileSystem, ITimerFactory timerFactory, ISystemEvents systemEvents, IEnvironmentInfo environmentInfo)
|
||||
{
|
||||
if (taskManager == null)
|
||||
{
|
||||
|
@ -150,7 +150,7 @@ namespace Emby.Server.Implementations.IO
|
|||
|
||||
LibraryManager = libraryManager;
|
||||
TaskManager = taskManager;
|
||||
Logger = logManager.GetLogger(GetType().Name);
|
||||
Logger = loggerFactory.CreateLogger(GetType().Name);
|
||||
ConfigurationManager = configurationManager;
|
||||
_fileSystem = fileSystem;
|
||||
_timerFactory = timerFactory;
|
||||
|
@ -291,7 +291,7 @@ namespace Emby.Server.Implementations.IO
|
|||
if (!_fileSystem.DirectoryExists(path))
|
||||
{
|
||||
// Seeing a crash in the mono runtime due to an exception being thrown on a different thread
|
||||
Logger.Info("Skipping realtime monitor for {0} because the path does not exist", path);
|
||||
Logger.LogInformation("Skipping realtime monitor for {0} because the path does not exist", path);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -344,7 +344,7 @@ namespace Emby.Server.Implementations.IO
|
|||
if (_fileSystemWatchers.TryAdd(path, newWatcher))
|
||||
{
|
||||
newWatcher.EnableRaisingEvents = true;
|
||||
Logger.Info("Watching directory " + path);
|
||||
Logger.LogInformation("Watching directory " + path);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -354,7 +354,7 @@ namespace Emby.Server.Implementations.IO
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.ErrorException("Error watching path: {0}", ex, path);
|
||||
Logger.LogError(ex, "Error watching path: {path}", path);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -382,7 +382,7 @@ namespace Emby.Server.Implementations.IO
|
|||
{
|
||||
using (watcher)
|
||||
{
|
||||
Logger.Info("Stopping directory watching for path {0}", watcher.Path);
|
||||
Logger.LogInformation("Stopping directory watching for path {path}", watcher.Path);
|
||||
|
||||
watcher.Created -= watcher_Changed;
|
||||
watcher.Deleted -= watcher_Changed;
|
||||
|
@ -439,7 +439,7 @@ namespace Emby.Server.Implementations.IO
|
|||
var ex = e.GetException();
|
||||
var dw = (FileSystemWatcher)sender;
|
||||
|
||||
Logger.ErrorException("Error in Directory watcher for: " + dw.Path, ex);
|
||||
Logger.LogError(ex, "Error in Directory watcher for: {path}", dw.Path);
|
||||
|
||||
DisposeWatcher(dw, true);
|
||||
}
|
||||
|
@ -453,7 +453,7 @@ namespace Emby.Server.Implementations.IO
|
|||
{
|
||||
try
|
||||
{
|
||||
//Logger.Debug("Changed detected of type " + e.ChangeType + " to " + e.FullPath);
|
||||
//logger.LogDebug("Changed detected of type " + e.ChangeType + " to " + e.FullPath);
|
||||
|
||||
var path = e.FullPath;
|
||||
|
||||
|
@ -461,7 +461,7 @@ namespace Emby.Server.Implementations.IO
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.ErrorException("Exception in ReportFileSystemChanged. Path: {0}", ex, e.FullPath);
|
||||
Logger.LogError(ex, "Exception in ReportFileSystemChanged. Path: {FullPath}", e.FullPath);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -487,13 +487,13 @@ namespace Emby.Server.Implementations.IO
|
|||
{
|
||||
if (_fileSystem.AreEqual(i, path))
|
||||
{
|
||||
//Logger.Debug("Ignoring change to {0}", path);
|
||||
Logger.LogDebug("Ignoring change to {path}", path);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (_fileSystem.ContainsSubPath(i, path))
|
||||
{
|
||||
//Logger.Debug("Ignoring change to {0}", path);
|
||||
Logger.LogDebug("Ignoring change to {path}", path);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -503,7 +503,7 @@ namespace Emby.Server.Implementations.IO
|
|||
{
|
||||
if (_fileSystem.AreEqual(parent, path))
|
||||
{
|
||||
//Logger.Debug("Ignoring change to {0}", path);
|
||||
Logger.LogDebug("Ignoring change to {path}", path);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@ using System.IO;
|
|||
using System.Linq;
|
||||
using System.Text;
|
||||
using MediaBrowser.Model.IO;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using MediaBrowser.Model.System;
|
||||
|
||||
namespace Emby.Server.Implementations.IO
|
||||
|
@ -175,7 +175,7 @@ namespace Emby.Server.Implementations.IO
|
|||
path = System.IO.Path.GetFullPath(path);
|
||||
return path;
|
||||
}
|
||||
catch (ArgumentException ex)
|
||||
catch (ArgumentException)
|
||||
{
|
||||
return filePath;
|
||||
}
|
||||
|
@ -395,7 +395,7 @@ namespace Emby.Server.Implementations.IO
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.ErrorException("Error determining CreationTimeUtc for {0}", ex, info.FullName);
|
||||
Logger.LogError(ex, "Error determining CreationTimeUtc for {FullName}", info.FullName);
|
||||
return DateTime.MinValue;
|
||||
}
|
||||
}
|
||||
|
@ -434,7 +434,7 @@ namespace Emby.Server.Implementations.IO
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.ErrorException("Error determining LastAccessTimeUtc for {0}", ex, info.FullName);
|
||||
Logger.LogError(ex, "Error determining LastAccessTimeUtc for {FullName}", info.FullName);
|
||||
return DateTime.MinValue;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -89,7 +89,7 @@ namespace SharpCifs
|
|||
{
|
||||
Runtime.GetBytesForString(string.Empty, DefaultOemEncoding);
|
||||
}
|
||||
catch (Exception ex)
|
||||
catch (Exception)
|
||||
{
|
||||
if (_log.Level >= 2)
|
||||
{
|
||||
|
|
|
@ -153,7 +153,7 @@ namespace SharpCifs.Dcerpc
|
|||
DcerpcMessage bind = new DcerpcBind(Binding, this);
|
||||
Sendrecv(bind);
|
||||
}
|
||||
catch (IOException ioe)
|
||||
catch (IOException)
|
||||
{
|
||||
State = 0;
|
||||
throw;
|
||||
|
|
|
@ -130,7 +130,7 @@ namespace SharpCifs.Netbios
|
|||
{
|
||||
name = Runtime.GetStringForBytes(tmp, 0, length).Trim();
|
||||
}
|
||||
catch (Exception ex)
|
||||
catch (Exception)
|
||||
{
|
||||
|
||||
}
|
||||
|
|
|
@ -117,8 +117,9 @@ namespace SharpCifs.Netbios
|
|||
{
|
||||
Baddr = Config.GetInetAddress("jcifs.netbios.baddr", Extensions.GetAddressByName("255.255.255.255"));
|
||||
}
|
||||
catch (Exception ex)
|
||||
catch (Exception)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
_sndBuf = new byte[SndBufSize];
|
||||
|
@ -302,7 +303,10 @@ namespace SharpCifs.Netbios
|
|||
}
|
||||
|
||||
}
|
||||
catch (TimeoutException) { }
|
||||
catch (TimeoutException)
|
||||
{
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
if (_log.Level > 2)
|
||||
|
|
|
@ -192,7 +192,7 @@ namespace SharpCifs.Smb
|
|||
catch (Exception e)
|
||||
{
|
||||
throw new SmbException(e.Message, e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
default:
|
||||
|
|
|
@ -2,6 +2,7 @@ using System.Collections;
|
|||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
|
||||
// TODO: @bond Remove
|
||||
namespace SharpCifs.Util.Sharpen
|
||||
{
|
||||
internal static class Collections<T>
|
||||
|
|
|
@ -163,7 +163,7 @@ namespace Emby.Server.Implementations.IO
|
|||
var bytesRead = await CopyToAsyncInternal(source, target, buffer, cancellationToken).ConfigureAwait(false);
|
||||
|
||||
//var position = fs.Position;
|
||||
//_logger.Debug("Streamed {0} bytes to position {1} from file {2}", bytesRead, position, path);
|
||||
//_logger.LogDebug("Streamed {0} bytes to position {1} from file {2}", bytesRead, position, path);
|
||||
|
||||
if (bytesRead == 0)
|
||||
{
|
||||
|
|
|
@ -9,7 +9,7 @@ using System.Linq;
|
|||
|
||||
using MediaBrowser.Controller.IO;
|
||||
using MediaBrowser.Model.IO;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace Emby.Server.Implementations.Library
|
||||
{
|
||||
|
|
|
@ -12,7 +12,7 @@ using MediaBrowser.Controller.Resolvers;
|
|||
using MediaBrowser.Controller.Sorting;
|
||||
using MediaBrowser.Model.Configuration;
|
||||
using MediaBrowser.Model.Entities;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using MediaBrowser.Model.Querying;
|
||||
using Emby.Naming.Audio;
|
||||
using Emby.Naming.Common;
|
||||
|
@ -351,7 +351,7 @@ namespace Emby.Server.Implementations.Library
|
|||
|
||||
if (item is LiveTvProgram)
|
||||
{
|
||||
_logger.Debug("Deleting item, Type: {0}, Name: {1}, Path: {2}, Id: {3}",
|
||||
_logger.LogDebug("Deleting item, Type: {0}, Name: {1}, Path: {2}, Id: {3}",
|
||||
item.GetType().Name,
|
||||
item.Name ?? "Unknown name",
|
||||
item.Path ?? string.Empty,
|
||||
|
@ -359,7 +359,7 @@ namespace Emby.Server.Implementations.Library
|
|||
}
|
||||
else
|
||||
{
|
||||
_logger.Info("Deleting item, Type: {0}, Name: {1}, Path: {2}, Id: {3}",
|
||||
_logger.LogInformation("Deleting item, Type: {0}, Name: {1}, Path: {2}, Id: {3}",
|
||||
item.GetType().Name,
|
||||
item.Name ?? "Unknown name",
|
||||
item.Path ?? string.Empty,
|
||||
|
@ -372,7 +372,7 @@ namespace Emby.Server.Implementations.Library
|
|||
|
||||
foreach (var metadataPath in GetMetadataPaths(item, children))
|
||||
{
|
||||
_logger.Debug("Deleting path {0}", metadataPath);
|
||||
_logger.LogDebug("Deleting path {0}", metadataPath);
|
||||
|
||||
try
|
||||
{
|
||||
|
@ -384,7 +384,7 @@ namespace Emby.Server.Implementations.Library
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.ErrorException("Error deleting {0}", ex, metadataPath);
|
||||
_logger.LogError(ex, "Error deleting {metadataPath}", metadataPath);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -398,14 +398,13 @@ namespace Emby.Server.Implementations.Library
|
|||
{
|
||||
try
|
||||
{
|
||||
_logger.LogDebug("Deleting path {path}", fileSystemInfo.FullName);
|
||||
if (fileSystemInfo.IsDirectory)
|
||||
{
|
||||
_logger.Debug("Deleting path {0}", fileSystemInfo.FullName);
|
||||
_fileSystem.DeleteDirectory(fileSystemInfo.FullName, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
_logger.Debug("Deleting path {0}", fileSystemInfo.FullName);
|
||||
_fileSystem.DeleteFile(fileSystemInfo.FullName);
|
||||
}
|
||||
}
|
||||
|
@ -489,7 +488,7 @@ namespace Emby.Server.Implementations.Library
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.ErrorException("Error in {0} resolving {1}", ex, resolver.GetType().Name, args.Path);
|
||||
_logger.LogError(ex, "Error in {resolver} resolving {path}", resolver.GetType().Name, args.Path);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
@ -587,7 +586,7 @@ namespace Emby.Server.Implementations.Library
|
|||
{
|
||||
if (parent != null && parent.IsPhysicalRoot)
|
||||
{
|
||||
_logger.ErrorException("Error in GetFilteredFileSystemEntries isPhysicalRoot: {0} IsVf: {1}", ex, isPhysicalRoot, isVf);
|
||||
_logger.LogError(ex, "Error in GetFilteredFileSystemEntries isPhysicalRoot: {0} IsVf: {1}", isPhysicalRoot, isVf);
|
||||
|
||||
files = new FileSystemMetadata[] { };
|
||||
}
|
||||
|
@ -639,7 +638,7 @@ namespace Emby.Server.Implementations.Library
|
|||
|
||||
foreach (var dupe in dupes)
|
||||
{
|
||||
_logger.Info("Found duplicate path: {0}", dupe);
|
||||
_logger.LogInformation("Found duplicate path: {0}", dupe);
|
||||
}
|
||||
|
||||
var newList = list.Except(dupes, StringComparer.OrdinalIgnoreCase).Select(_fileSystem.GetDirectoryInfo).ToList();
|
||||
|
@ -713,7 +712,7 @@ namespace Emby.Server.Implementations.Library
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.ErrorException("Error resolving path {0}", ex, f.FullName);
|
||||
_logger.LogError(ex, "Error resolving path {path}", f.FullName);
|
||||
return null;
|
||||
}
|
||||
}).Where(i => i != null);
|
||||
|
@ -730,12 +729,12 @@ namespace Emby.Server.Implementations.Library
|
|||
|
||||
_fileSystem.CreateDirectory(rootFolderPath);
|
||||
|
||||
var rootFolder = GetItemById(GetNewItemId(rootFolderPath, typeof(AggregateFolder))) as AggregateFolder ?? (AggregateFolder)ResolvePath(_fileSystem.GetDirectoryInfo(rootFolderPath));
|
||||
var rootFolder = GetItemById(GetNewItemId(rootFolderPath, typeof(AggregateFolder))) as AggregateFolder ?? ((Folder)ResolvePath(_fileSystem.GetDirectoryInfo(rootFolderPath))).DeepCopy<Folder,AggregateFolder>();
|
||||
|
||||
// In case program data folder was moved
|
||||
if (!string.Equals(rootFolder.Path, rootFolderPath, StringComparison.Ordinal))
|
||||
{
|
||||
_logger.Info("Resetting root folder path to {0}", rootFolderPath);
|
||||
_logger.LogInformation("Resetting root folder path to {0}", rootFolderPath);
|
||||
rootFolder.Path = rootFolderPath;
|
||||
}
|
||||
|
||||
|
@ -799,13 +798,13 @@ namespace Emby.Server.Implementations.Library
|
|||
|
||||
if (tmpItem == null)
|
||||
{
|
||||
tmpItem = (UserRootFolder)ResolvePath(_fileSystem.GetDirectoryInfo(userRootPath));
|
||||
tmpItem = ((Folder)ResolvePath(_fileSystem.GetDirectoryInfo(userRootPath))).DeepCopy<Folder,UserRootFolder>();
|
||||
}
|
||||
|
||||
// In case program data folder was moved
|
||||
if (!string.Equals(tmpItem.Path, userRootPath, StringComparison.Ordinal))
|
||||
{
|
||||
_logger.Info("Resetting user root folder path to {0}", userRootPath);
|
||||
_logger.LogInformation("Resetting user root folder path to {0}", userRootPath);
|
||||
tmpItem.Path = userRootPath;
|
||||
}
|
||||
|
||||
|
@ -827,7 +826,7 @@ namespace Emby.Server.Implementations.Library
|
|||
throw new ArgumentNullException("path");
|
||||
}
|
||||
|
||||
//_logger.Info("FindByPath {0}", path);
|
||||
//_logger.LogInformation("FindByPath {0}", path);
|
||||
|
||||
var query = new InternalItemsQuery
|
||||
{
|
||||
|
@ -1065,11 +1064,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())
|
||||
|
@ -1080,7 +1079,7 @@ namespace Emby.Server.Implementations.Library
|
|||
|
||||
private async Task PerformLibraryValidation(IProgress<double> progress, CancellationToken cancellationToken)
|
||||
{
|
||||
_logger.Info("Validating media library");
|
||||
_logger.LogInformation("Validating media library");
|
||||
|
||||
await ValidateTopLibraryFolders(cancellationToken).ConfigureAwait(false);
|
||||
|
||||
|
@ -1089,7 +1088,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);
|
||||
|
||||
|
@ -1135,7 +1134,7 @@ namespace Emby.Server.Implementations.Library
|
|||
progress.Report(innerPercent);
|
||||
});
|
||||
|
||||
_logger.Debug("Running post-scan task {0}", task.GetType().Name);
|
||||
_logger.LogDebug("Running post-scan task {0}", task.GetType().Name);
|
||||
|
||||
try
|
||||
{
|
||||
|
@ -1143,12 +1142,12 @@ namespace Emby.Server.Implementations.Library
|
|||
}
|
||||
catch (OperationCanceledException)
|
||||
{
|
||||
_logger.Info("Post-scan task cancelled: {0}", task.GetType().Name);
|
||||
_logger.LogInformation("Post-scan task cancelled: {0}", task.GetType().Name);
|
||||
throw;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.ErrorException("Error running postscan task", ex);
|
||||
_logger.LogError(ex, "Error running postscan task");
|
||||
}
|
||||
|
||||
numComplete++;
|
||||
|
@ -1199,7 +1198,7 @@ namespace Emby.Server.Implementations.Library
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.ErrorException("Error resolving shortcut file {0}", ex, i);
|
||||
_logger.LogError(ex, "Error resolving shortcut file {file}", i);
|
||||
return null;
|
||||
}
|
||||
})
|
||||
|
@ -1262,7 +1261,7 @@ namespace Emby.Server.Implementations.Library
|
|||
|
||||
item = RetrieveItem(id);
|
||||
|
||||
//_logger.Debug("GetitemById {0}", id);
|
||||
//_logger.LogDebug("GetitemById {0}", id);
|
||||
|
||||
if (item != null)
|
||||
{
|
||||
|
@ -1440,7 +1439,7 @@ namespace Emby.Server.Implementations.Library
|
|||
return true;
|
||||
}
|
||||
|
||||
//_logger.Debug("Query requires ancestor query due to type: " + i.GetType().Name);
|
||||
//_logger.LogDebug("Query requires ancestor query due to type: " + i.GetType().Name);
|
||||
return false;
|
||||
|
||||
}))
|
||||
|
@ -1493,7 +1492,7 @@ namespace Emby.Server.Implementations.Library
|
|||
|
||||
return new QueryResult<BaseItem>
|
||||
{
|
||||
Items = list.ToArray(list.Count)
|
||||
Items = list.ToArray()
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -1506,7 +1505,7 @@ namespace Emby.Server.Implementations.Library
|
|||
return true;
|
||||
}
|
||||
|
||||
//_logger.Debug("Query requires ancestor query due to type: " + i.GetType().Name);
|
||||
//_logger.LogDebug("Query requires ancestor query due to type: " + i.GetType().Name);
|
||||
return false;
|
||||
|
||||
}))
|
||||
|
@ -1650,7 +1649,7 @@ namespace Emby.Server.Implementations.Library
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.ErrorException("Error getting intros", ex);
|
||||
_logger.LogError(ex, "Error getting intros");
|
||||
|
||||
return new List<IntroInfo>();
|
||||
}
|
||||
|
@ -1670,7 +1669,7 @@ namespace Emby.Server.Implementations.Library
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.ErrorException("Error getting intro files", ex);
|
||||
_logger.LogError(ex, "Error getting intro files");
|
||||
|
||||
return new List<string>();
|
||||
}
|
||||
|
@ -1693,7 +1692,7 @@ namespace Emby.Server.Implementations.Library
|
|||
|
||||
if (video == null)
|
||||
{
|
||||
_logger.Error("Unable to locate item with Id {0}.", info.ItemId.Value);
|
||||
_logger.LogError("Unable to locate item with Id {ID}.", info.ItemId.Value);
|
||||
}
|
||||
}
|
||||
else if (!string.IsNullOrEmpty(info.Path))
|
||||
|
@ -1705,7 +1704,7 @@ namespace Emby.Server.Implementations.Library
|
|||
|
||||
if (video == null)
|
||||
{
|
||||
_logger.Error("Intro resolver returned null for {0}.", info.Path);
|
||||
_logger.LogError("Intro resolver returned null for {path}.", info.Path);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1724,12 +1723,12 @@ namespace Emby.Server.Implementations.Library
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.ErrorException("Error resolving path {0}.", ex, info.Path);
|
||||
_logger.LogError(ex, "Error resolving path {path}.", info.Path);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_logger.Error("IntroProvider returned an IntroInfo with null Path and ItemId.");
|
||||
_logger.LogError("IntroProvider returned an IntroInfo with null Path and ItemId.");
|
||||
}
|
||||
|
||||
return video;
|
||||
|
@ -1873,7 +1872,7 @@ namespace Emby.Server.Implementations.Library
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.ErrorException("Error in ItemAdded event handler", ex);
|
||||
_logger.LogError(ex, "Error in ItemAdded event handler");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1904,7 +1903,7 @@ namespace Emby.Server.Implementations.Library
|
|||
}
|
||||
|
||||
//var logName = item.LocationType == LocationType.Remote ? item.Name ?? item.Path : item.Path ?? item.Name;
|
||||
//_logger.Debug("Saving {0} to database.", logName);
|
||||
//_logger.LogDebug("Saving {0} to database.", logName);
|
||||
|
||||
ItemRepository.SaveItems(items, cancellationToken);
|
||||
|
||||
|
@ -1929,7 +1928,7 @@ namespace Emby.Server.Implementations.Library
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.ErrorException("Error in ItemUpdated event handler", ex);
|
||||
_logger.LogError(ex, "Error in ItemUpdated event handler");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1965,7 +1964,7 @@ namespace Emby.Server.Implementations.Library
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.ErrorException("Error in ItemRemoved event handler", ex);
|
||||
_logger.LogError(ex, "Error in ItemRemoved event handler");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2176,7 +2175,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 +2230,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 +2294,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 +2368,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
|
||||
|
@ -2808,7 +2807,7 @@ namespace Emby.Server.Implementations.Library
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.ErrorException("Error getting person", ex);
|
||||
_logger.LogError(ex, "Error getting person");
|
||||
return null;
|
||||
}
|
||||
|
||||
|
@ -2836,7 +2835,7 @@ namespace Emby.Server.Implementations.Library
|
|||
{
|
||||
try
|
||||
{
|
||||
_logger.Debug("ConvertImageToLocal item {0} - image url: {1}", item.Id, url);
|
||||
_logger.LogDebug("ConvertImageToLocal item {0} - image url: {1}", item.Id, url);
|
||||
|
||||
await _providerManagerFactory().SaveImage(item, url, image.Type, imageIndex, CancellationToken.None).ConfigureAwait(false);
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ using MediaBrowser.Controller.MediaEncoding;
|
|||
using MediaBrowser.Model.Dlna;
|
||||
using MediaBrowser.Model.Dto;
|
||||
using MediaBrowser.Model.Entities;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using MediaBrowser.Model.MediaInfo;
|
||||
using System.Collections.Generic;
|
||||
using MediaBrowser.Model.Serialization;
|
||||
|
@ -48,7 +48,7 @@ namespace Emby.Server.Implementations.Library
|
|||
{
|
||||
mediaInfo = _json.DeserializeFromFile<MediaInfo>(cacheFilePath);
|
||||
|
||||
//_logger.Debug("Found cached media info");
|
||||
//_logger.LogDebug("Found cached media info");
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
@ -63,7 +63,7 @@ namespace Emby.Server.Implementations.Library
|
|||
delayMs = Math.Max(3000, delayMs);
|
||||
if (delayMs > 0)
|
||||
{
|
||||
_logger.Info("Waiting {0}ms before probing the live stream", delayMs);
|
||||
_logger.LogInformation("Waiting {0}ms before probing the live stream", delayMs);
|
||||
await Task.Delay(delayMs, cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
}
|
||||
|
@ -83,7 +83,7 @@ namespace Emby.Server.Implementations.Library
|
|||
Directory.CreateDirectory(Path.GetDirectoryName(cacheFilePath));
|
||||
_json.SerializeToFile(mediaInfo, cacheFilePath);
|
||||
|
||||
//_logger.Debug("Saved media info to {0}", cacheFilePath);
|
||||
//_logger.LogDebug("Saved media info to {0}", cacheFilePath);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -104,7 +104,7 @@ namespace Emby.Server.Implementations.Library
|
|||
mediaStreams = newList;
|
||||
}
|
||||
|
||||
_logger.Info("Live tv media info probe took {0} seconds", (DateTime.UtcNow - now).TotalSeconds.ToString(CultureInfo.InvariantCulture));
|
||||
_logger.LogInformation("Live tv media info probe took {0} seconds", (DateTime.UtcNow - now).TotalSeconds.ToString(CultureInfo.InvariantCulture));
|
||||
|
||||
mediaSource.Bitrate = mediaInfo.Bitrate;
|
||||
mediaSource.Container = mediaInfo.Container;
|
||||
|
|
|
@ -4,9 +4,10 @@ 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 MediaBrowser.Model.Logging;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using MediaBrowser.Model.MediaInfo;
|
||||
using MediaBrowser.Model.Serialization;
|
||||
using System;
|
||||
|
@ -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
|
||||
|
@ -255,7 +256,7 @@ namespace Emby.Server.Implementations.Library
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.ErrorException("Error getting media sources", ex);
|
||||
_logger.LogError(ex, "Error getting media sources");
|
||||
return new List<MediaSourceInfo>();
|
||||
}
|
||||
}
|
||||
|
@ -476,12 +477,12 @@ namespace Emby.Server.Implementations.Library
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.ErrorException("Error probing live tv stream", ex);
|
||||
_logger.LogError(ex, "Error probing live tv stream");
|
||||
AddMediaInfo(mediaSource, isAudio);
|
||||
}
|
||||
|
||||
var json = _jsonSerializer.SerializeToString(mediaSource);
|
||||
_logger.Info("Live stream opened: " + json);
|
||||
_logger.LogInformation("Live stream opened: " + json);
|
||||
var clone = _jsonSerializer.DeserializeFromString<MediaSourceInfo>(json);
|
||||
|
||||
if (!request.UserId.Equals(Guid.Empty))
|
||||
|
@ -624,7 +625,7 @@ namespace Emby.Server.Implementations.Library
|
|||
{
|
||||
mediaInfo = _jsonSerializer.DeserializeFromFile<MediaInfo>(cacheFilePath);
|
||||
|
||||
//_logger.Debug("Found cached media info");
|
||||
//_logger.LogDebug("Found cached media info");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
@ -658,7 +659,7 @@ namespace Emby.Server.Implementations.Library
|
|||
_fileSystem.CreateDirectory(_fileSystem.GetDirectoryName(cacheFilePath));
|
||||
_jsonSerializer.SerializeToFile(mediaInfo, cacheFilePath);
|
||||
|
||||
//_logger.Debug("Saved media info to {0}", cacheFilePath);
|
||||
//_logger.LogDebug("Saved media info to {0}", cacheFilePath);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -679,7 +680,7 @@ namespace Emby.Server.Implementations.Library
|
|||
mediaStreams = newList;
|
||||
}
|
||||
|
||||
_logger.Info("Live tv media info probe took {0} seconds", (DateTime.UtcNow - now).TotalSeconds.ToString(CultureInfo.InvariantCulture));
|
||||
_logger.LogInformation("Live tv media info probe took {0} seconds", (DateTime.UtcNow - now).TotalSeconds.ToString(CultureInfo.InvariantCulture));
|
||||
|
||||
mediaSource.Bitrate = mediaInfo.Bitrate;
|
||||
mediaSource.Container = mediaInfo.Container;
|
||||
|
@ -815,16 +816,16 @@ namespace Emby.Server.Implementations.Library
|
|||
{
|
||||
liveStream.ConsumerCount--;
|
||||
|
||||
_logger.Info("Live stream {0} consumer count is now {1}", liveStream.OriginalStreamId, liveStream.ConsumerCount);
|
||||
_logger.LogInformation("Live stream {0} consumer count is now {1}", liveStream.OriginalStreamId, liveStream.ConsumerCount);
|
||||
|
||||
if (liveStream.ConsumerCount <= 0)
|
||||
{
|
||||
_openStreams.Remove(id);
|
||||
|
||||
_logger.Info("Closing live stream {0}", id);
|
||||
_logger.LogInformation("Closing live stream {0}", id);
|
||||
|
||||
await liveStream.Close().ConfigureAwait(false);
|
||||
_logger.Info("Live stream {0} closed successfully", id);
|
||||
_logger.LogInformation("Live stream {0} closed successfully", id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -883,4 +884,4 @@ namespace Emby.Server.Implementations.Library
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@ using MediaBrowser.Controller.Library;
|
|||
using MediaBrowser.Controller.Providers;
|
||||
using MediaBrowser.Controller.Resolvers;
|
||||
using MediaBrowser.Model.Entities;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Emby.Naming.Audio;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
@ -128,7 +128,7 @@ namespace Emby.Server.Implementations.Library.Resolvers.Audio
|
|||
{
|
||||
if (IsMultiDiscFolder(path, libraryOptions))
|
||||
{
|
||||
logger.Debug("Found multi-disc folder: " + path);
|
||||
logger.LogDebug("Found multi-disc folder: " + path);
|
||||
discSubfolderCount++;
|
||||
}
|
||||
else
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
using MediaBrowser.Controller.Library;
|
||||
using MediaBrowser.Controller.Resolvers;
|
||||
using MediaBrowser.Model.Entities;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
|
|
|
@ -7,7 +7,7 @@ using System.IO;
|
|||
using System.Linq;
|
||||
using MediaBrowser.Controller.Providers;
|
||||
using MediaBrowser.Model.IO;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace Emby.Server.Implementations.Library.Resolvers
|
||||
{
|
||||
|
|
|
@ -14,7 +14,7 @@ using System.Linq;
|
|||
using MediaBrowser.Controller.Drawing;
|
||||
using MediaBrowser.Controller.IO;
|
||||
using MediaBrowser.Model.IO;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace Emby.Server.Implementations.Library.Resolvers.Movies
|
||||
{
|
||||
|
|
|
@ -5,7 +5,7 @@ using MediaBrowser.Controller.Library;
|
|||
using MediaBrowser.Model.Globalization;
|
||||
using Emby.Naming.Common;
|
||||
using Emby.Naming.TV;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace Emby.Server.Implementations.Library.Resolvers.TV
|
||||
{
|
||||
|
@ -72,7 +72,7 @@ namespace Emby.Server.Implementations.Library.Resolvers.TV
|
|||
{
|
||||
if (episodeInfo.EpisodeNumber.HasValue && episodeInfo.SeasonNumber.HasValue)
|
||||
{
|
||||
_logger.Debug("Found folder underneath series with episode number: {0}. Season {1}. Episode {2}",
|
||||
_logger.LogDebug("Found folder underneath series with episode number: {0}. Season {1}. Episode {2}",
|
||||
path,
|
||||
episodeInfo.SeasonNumber.Value,
|
||||
episodeInfo.EpisodeNumber.Value);
|
||||
|
|
|
@ -3,7 +3,7 @@ using MediaBrowser.Controller.Library;
|
|||
using MediaBrowser.Controller.Providers;
|
||||
using MediaBrowser.Controller.Resolvers;
|
||||
using MediaBrowser.Model.Entities;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Emby.Naming.Common;
|
||||
using Emby.Naming.TV;
|
||||
using System;
|
||||
|
@ -131,14 +131,14 @@ namespace Emby.Server.Implementations.Library.Resolvers.TV
|
|||
{
|
||||
//if ((attributes & FileAttributes.Hidden) == FileAttributes.Hidden)
|
||||
//{
|
||||
// //logger.Debug("Igoring series file or folder marked hidden: {0}", child.FullName);
|
||||
// //logger.LogDebug("Igoring series file or folder marked hidden: {0}", child.FullName);
|
||||
// continue;
|
||||
//}
|
||||
|
||||
// Can't enforce this because files saved by Bitcasa are always marked System
|
||||
//if ((attributes & FileAttributes.System) == FileAttributes.System)
|
||||
//{
|
||||
// logger.Debug("Igoring series subfolder marked system: {0}", child.FullName);
|
||||
// logger.LogDebug("Igoring series subfolder marked system: {0}", child.FullName);
|
||||
// continue;
|
||||
//}
|
||||
|
||||
|
@ -146,7 +146,7 @@ namespace Emby.Server.Implementations.Library.Resolvers.TV
|
|||
{
|
||||
if (IsSeasonFolder(child.FullName, isTvContentType, libraryManager))
|
||||
{
|
||||
//logger.Debug("{0} is a series because of season folder {1}.", path, child.FullName);
|
||||
//logger.LogDebug("{0} is a series because of season folder {1}.", path, child.FullName);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -181,7 +181,7 @@ namespace Emby.Server.Implementations.Library.Resolvers.TV
|
|||
}
|
||||
}
|
||||
|
||||
//logger.Debug("{0} is not a series folder.", path);
|
||||
//logger.LogDebug("{0} is not a series folder.", path);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
using MediaBrowser.Controller.Entities;
|
||||
using MediaBrowser.Controller.Entities.Audio;
|
||||
using MediaBrowser.Controller.Library;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using MediaBrowser.Model.Querying;
|
||||
using MediaBrowser.Model.Search;
|
||||
using System;
|
||||
|
@ -23,12 +23,12 @@ namespace Emby.Server.Implementations.Library
|
|||
private readonly IUserManager _userManager;
|
||||
private readonly ILogger _logger;
|
||||
|
||||
public SearchEngine(ILogManager logManager, ILibraryManager libraryManager, IUserManager userManager)
|
||||
public SearchEngine(ILoggerFactory loggerFactory, ILibraryManager libraryManager, IUserManager userManager)
|
||||
{
|
||||
_libraryManager = libraryManager;
|
||||
_userManager = userManager;
|
||||
|
||||
_logger = logManager.GetLogger("SearchEngine");
|
||||
_logger = loggerFactory.CreateLogger("SearchEngine");
|
||||
}
|
||||
|
||||
public QueryResult<SearchHintInfo> GetSearchHints(SearchQuery query)
|
||||
|
@ -161,8 +161,8 @@ namespace Emby.Server.Implementations.Library
|
|||
var searchQuery = new InternalItemsQuery(user)
|
||||
{
|
||||
SearchTerm = searchTerm,
|
||||
ExcludeItemTypes = excludeItemTypes.ToArray(excludeItemTypes.Count),
|
||||
IncludeItemTypes = includeItemTypes.ToArray(includeItemTypes.Count),
|
||||
ExcludeItemTypes = excludeItemTypes.ToArray(),
|
||||
IncludeItemTypes = includeItemTypes.ToArray(),
|
||||
Limit = query.Limit,
|
||||
IncludeItemsByName = string.IsNullOrEmpty(query.ParentId),
|
||||
ParentId = string.IsNullOrEmpty(query.ParentId) ? Guid.Empty : new Guid(query.ParentId),
|
||||
|
|
|
@ -6,7 +6,7 @@ using MediaBrowser.Controller.Library;
|
|||
using MediaBrowser.Controller.Persistence;
|
||||
using MediaBrowser.Model.Dto;
|
||||
using MediaBrowser.Model.Entities;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System;
|
||||
using System.Collections.Concurrent;
|
||||
using System.Collections.Generic;
|
||||
|
@ -32,10 +32,10 @@ namespace Emby.Server.Implementations.Library
|
|||
|
||||
private Func<IUserManager> _userManager;
|
||||
|
||||
public UserDataManager(ILogManager logManager, IServerConfigurationManager config, Func<IUserManager> userManager)
|
||||
public UserDataManager(ILoggerFactory loggerFactory, IServerConfigurationManager config, Func<IUserManager> userManager)
|
||||
{
|
||||
_config = config;
|
||||
_logger = logManager.GetLogger(GetType().Name);
|
||||
_logger = loggerFactory.CreateLogger(GetType().Name);
|
||||
_userManager = userManager;
|
||||
}
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ using MediaBrowser.Model.Connect;
|
|||
using MediaBrowser.Model.Dto;
|
||||
using MediaBrowser.Model.Entities;
|
||||
using MediaBrowser.Model.Events;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using MediaBrowser.Model.Serialization;
|
||||
using MediaBrowser.Model.Users;
|
||||
using System;
|
||||
|
@ -340,7 +340,7 @@ namespace Emby.Server.Implementations.Library
|
|||
UpdateInvalidLoginAttemptCount(user, user.Policy.InvalidLoginAttemptCount + 1);
|
||||
}
|
||||
|
||||
_logger.Info("Authentication request for {0} {1}.", user.Name, success ? "has succeeded" : "has been denied");
|
||||
_logger.LogInformation("Authentication request for {0} {1}.", user.Name, success ? "has succeeded" : "has been denied");
|
||||
|
||||
return success ? user : null;
|
||||
}
|
||||
|
@ -392,7 +392,7 @@ namespace Emby.Server.Implementations.Library
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.ErrorException("Error authenticating with provider {0}", ex, provider.Name);
|
||||
_logger.LogError(ex, "Error authenticating with provider {provider}", provider.Name);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
@ -461,7 +461,7 @@ namespace Emby.Server.Implementations.Library
|
|||
|
||||
if (newValue >= maxCount)
|
||||
{
|
||||
//_logger.Debug("Disabling user {0} due to {1} unsuccessful login attempts.", user.Name, newValue.ToString(CultureInfo.InvariantCulture));
|
||||
//_logger.LogDebug("Disabling user {0} due to {1} unsuccessful login attempts.", user.Name, newValue.ToString(CultureInfo.InvariantCulture));
|
||||
//user.Policy.IsDisabled = true;
|
||||
|
||||
//fireLockout = true;
|
||||
|
@ -575,7 +575,7 @@ namespace Emby.Server.Implementations.Library
|
|||
catch (Exception ex)
|
||||
{
|
||||
// Have to use a catch-all unfortunately because some .net image methods throw plain Exceptions
|
||||
_logger.ErrorException("Error generating PrimaryImageAspectRatio for {0}", ex, user.Name);
|
||||
_logger.LogError(ex, "Error generating PrimaryImageAspectRatio for {user}", user.Name);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -599,7 +599,7 @@ namespace Emby.Server.Implementations.Library
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.ErrorException("Error getting {0} image info for {1}", ex, image.Type, image.Path);
|
||||
_logger.LogError(ex, "Error getting {imageType} image info for {imagePath}", image.Type, image.Path);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -775,7 +775,7 @@ namespace Emby.Server.Implementations.Library
|
|||
}
|
||||
catch (IOException ex)
|
||||
{
|
||||
_logger.ErrorException("Error deleting file {0}", ex, configPath);
|
||||
_logger.LogError(ex, "Error deleting file {path}", configPath);
|
||||
}
|
||||
|
||||
DeleteUserPolicy(user);
|
||||
|
@ -1045,7 +1045,7 @@ namespace Emby.Server.Implementations.Library
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.ErrorException("Error reading policy file: {0}", ex, path);
|
||||
_logger.LogError(ex, "Error reading policy file: {path}", path);
|
||||
|
||||
return GetDefaultPolicy(user);
|
||||
}
|
||||
|
@ -1109,7 +1109,7 @@ namespace Emby.Server.Implementations.Library
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.ErrorException("Error deleting policy file", ex);
|
||||
_logger.LogError(ex, "Error deleting policy file");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1144,7 +1144,7 @@ namespace Emby.Server.Implementations.Library
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.ErrorException("Error reading policy file: {0}", ex, path);
|
||||
_logger.LogError(ex, "Error reading policy file: {path}", path);
|
||||
|
||||
return new UserConfiguration();
|
||||
}
|
||||
|
|
|
@ -354,7 +354,7 @@ namespace Emby.Server.Implementations.Library
|
|||
Limit = limit * 5,
|
||||
IsPlayed = isPlayed,
|
||||
DtoOptions = options,
|
||||
MediaTypes = mediaTypes.ToArray(mediaTypes.Count)
|
||||
MediaTypes = mediaTypes.ToArray()
|
||||
};
|
||||
|
||||
if (parents.Count == 0)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
using MediaBrowser.Controller.Library;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
using MediaBrowser.Controller.Entities.Audio;
|
||||
using MediaBrowser.Controller.Library;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
@ -70,7 +70,7 @@ namespace Emby.Server.Implementations.Library.Validators
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.ErrorException("Error refreshing {0}", ex, name);
|
||||
_logger.LogError(ex, "Error refreshing {ArtistName}", name);
|
||||
}
|
||||
|
||||
numComplete++;
|
||||
|
@ -95,7 +95,7 @@ namespace Emby.Server.Implementations.Library.Validators
|
|||
continue;
|
||||
}
|
||||
|
||||
_logger.Info("Deleting dead {2} {0} {1}.", item.Id.ToString("N"), item.Name, item.GetType().Name);
|
||||
_logger.LogInformation("Deleting dead {2} {0} {1}.", item.Id.ToString("N"), item.Name, item.GetType().Name);
|
||||
|
||||
_libraryManager.DeleteItem(item, new DeleteOptions
|
||||
{
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
using MediaBrowser.Controller.Library;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user