diff options
| author | LogicalPhallacy <44458166+LogicalPhallacy@users.noreply.github.com> | 2019-01-01 11:47:57 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-01-01 11:47:57 -0800 |
| commit | 443218e3f109cdfbffa8c8c5d30e09e3ba5c2285 (patch) | |
| tree | 6de8dee799eebba514bac0b6eac457b4c0137978 /Emby.Server.Implementations/Library/MediaSourceManager.cs | |
| parent | 0c52f448a0c6d5cd3c5cce597fcf3ad9582c90f1 (diff) | |
| parent | cff0ece07329bbfa05fd22fbde444d09aaeb9a5c (diff) | |
Merge pull request #4 from jellyfin/dev
Dev
Diffstat (limited to 'Emby.Server.Implementations/Library/MediaSourceManager.cs')
| -rw-r--r-- | Emby.Server.Implementations/Library/MediaSourceManager.cs | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/Emby.Server.Implementations/Library/MediaSourceManager.cs b/Emby.Server.Implementations/Library/MediaSourceManager.cs index 0dc436800..e5fd28997 100644 --- a/Emby.Server.Implementations/Library/MediaSourceManager.cs +++ b/Emby.Server.Implementations/Library/MediaSourceManager.cs @@ -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 } } } -}
\ No newline at end of file +} |
