From 8cf45a3e4a5345f704f8acef098b173ec1808251 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sun, 13 Sep 2015 19:07:54 -0400 Subject: add more methods to IFileSystem --- .../HttpServer/HttpListenerHost.cs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'MediaBrowser.Server.Implementations/HttpServer') diff --git a/MediaBrowser.Server.Implementations/HttpServer/HttpListenerHost.cs b/MediaBrowser.Server.Implementations/HttpServer/HttpListenerHost.cs index 3795f4b15..1885afc61 100644 --- a/MediaBrowser.Server.Implementations/HttpServer/HttpListenerHost.cs +++ b/MediaBrowser.Server.Implementations/HttpServer/HttpListenerHost.cs @@ -79,6 +79,8 @@ namespace MediaBrowser.Server.Implementations.HttpServer _containerAdapter = new ContainerAdapter(applicationHost); } + public string GlobalResponse { get; set; } + public override void Configure(Container container) { HostConfig.Instance.DefaultRedirectPath = DefaultRedirectPath; @@ -336,6 +338,13 @@ namespace MediaBrowser.Server.Implementations.HttpServer return Task.FromResult(true); } + if (!string.IsNullOrWhiteSpace(GlobalResponse)) + { + httpRes.Write(GlobalResponse); + httpRes.ContentType = "text/plain"; + return Task.FromResult(true); + } + var handler = HttpHandlerFactory.GetHandler(httpReq); var remoteIp = httpReq.RemoteIp; -- cgit v1.2.3 From a2c371ec60f8da649887f72d9ee38a8f3a85365a Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Tue, 15 Sep 2015 23:55:26 -0400 Subject: rework collection editor --- MediaBrowser.Api/Dlna/DlnaServerService.cs | 1 - .../Serialization/JsonSerializer.cs | 4 +- .../Channels/IChannelFactory.cs | 14 - .../Channels/IChannelManager.cs | 2 +- .../MediaBrowser.Controller.csproj | 1 - MediaBrowser.Dlna/Channels/DlnaChannelFactory.cs | 642 ++++++++++----------- MediaBrowser.Dlna/Main/DlnaEntryPoint.cs | 2 - MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs | 3 - .../Configuration/ServerConfiguration.cs | 4 - MediaBrowser.Model/Dlna/ConditionProcessor.cs | 1 - MediaBrowser.Providers/Omdb/OmdbImageProvider.cs | 3 +- .../Channels/ChannelManager.cs | 21 +- .../HttpServer/Security/AuthorizationContext.cs | 41 -- .../Sync/SyncManager.cs | 2 - .../ApplicationHost.cs | 2 +- .../MediaBrowser.WebDashboard.csproj | 3 - 16 files changed, 329 insertions(+), 417 deletions(-) delete mode 100644 MediaBrowser.Controller/Channels/IChannelFactory.cs (limited to 'MediaBrowser.Server.Implementations/HttpServer') diff --git a/MediaBrowser.Api/Dlna/DlnaServerService.cs b/MediaBrowser.Api/Dlna/DlnaServerService.cs index 4f5e2ab25..4e7b1a7d5 100644 --- a/MediaBrowser.Api/Dlna/DlnaServerService.cs +++ b/MediaBrowser.Api/Dlna/DlnaServerService.cs @@ -108,7 +108,6 @@ namespace MediaBrowser.Api.Dlna private readonly IConnectionManager _connectionManager; private readonly IMediaReceiverRegistrar _mediaReceiverRegistrar; - // TODO: Add utf-8 private const string XMLContentType = "text/xml; charset=UTF-8"; public DlnaServerService(IDlnaManager dlnaManager, IContentDirectory contentDirectory, IConnectionManager connectionManager, IMediaReceiverRegistrar mediaReceiverRegistrar) diff --git a/MediaBrowser.Common.Implementations/Serialization/JsonSerializer.cs b/MediaBrowser.Common.Implementations/Serialization/JsonSerializer.cs index 2c93f0549..a758a0c1e 100644 --- a/MediaBrowser.Common.Implementations/Serialization/JsonSerializer.cs +++ b/MediaBrowser.Common.Implementations/Serialization/JsonSerializer.cs @@ -1,7 +1,7 @@ -using MediaBrowser.Model.Serialization; +using MediaBrowser.Common.IO; +using MediaBrowser.Model.Serialization; using System; using System.IO; -using MediaBrowser.Common.IO; namespace MediaBrowser.Common.Implementations.Serialization { diff --git a/MediaBrowser.Controller/Channels/IChannelFactory.cs b/MediaBrowser.Controller/Channels/IChannelFactory.cs deleted file mode 100644 index c7ed92586..000000000 --- a/MediaBrowser.Controller/Channels/IChannelFactory.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System.Collections.Generic; - -namespace MediaBrowser.Controller.Channels -{ - public interface IChannelFactory - { - IEnumerable GetChannels(); - } - - public interface IFactoryChannel - { - - } -} \ No newline at end of file diff --git a/MediaBrowser.Controller/Channels/IChannelManager.cs b/MediaBrowser.Controller/Channels/IChannelManager.cs index 8d3e0f596..fec550df8 100644 --- a/MediaBrowser.Controller/Channels/IChannelManager.cs +++ b/MediaBrowser.Controller/Channels/IChannelManager.cs @@ -16,7 +16,7 @@ namespace MediaBrowser.Controller.Channels /// /// The channels. /// The factories. - void AddParts(IEnumerable channels, IEnumerable factories); + void AddParts(IEnumerable channels); /// /// Gets the channel download path. diff --git a/MediaBrowser.Controller/MediaBrowser.Controller.csproj b/MediaBrowser.Controller/MediaBrowser.Controller.csproj index dffb29f93..ea6e98ea6 100644 --- a/MediaBrowser.Controller/MediaBrowser.Controller.csproj +++ b/MediaBrowser.Controller/MediaBrowser.Controller.csproj @@ -77,7 +77,6 @@ - diff --git a/MediaBrowser.Dlna/Channels/DlnaChannelFactory.cs b/MediaBrowser.Dlna/Channels/DlnaChannelFactory.cs index f26ceff90..315313c04 100644 --- a/MediaBrowser.Dlna/Channels/DlnaChannelFactory.cs +++ b/MediaBrowser.Dlna/Channels/DlnaChannelFactory.cs @@ -18,325 +18,325 @@ using System.Threading.Tasks; namespace MediaBrowser.Dlna.Channels { - public class DlnaChannelFactory : IChannelFactory, IDisposable - { - private readonly IServerConfigurationManager _config; - private readonly ILogger _logger; - private readonly IHttpClient _httpClient; - - private readonly IDeviceDiscovery _deviceDiscovery; - - private readonly SemaphoreSlim _syncLock = new SemaphoreSlim(1, 1); - private List _servers = new List(); - - public static DlnaChannelFactory Instance; - - private Func> _localServersLookup; - - public DlnaChannelFactory(IServerConfigurationManager config, IHttpClient httpClient, ILogger logger, IDeviceDiscovery deviceDiscovery) - { - _config = config; - _httpClient = httpClient; - _logger = logger; - _deviceDiscovery = deviceDiscovery; - Instance = this; - } - - internal void Start(Func> localServersLookup) - { - _localServersLookup = localServersLookup; - - //deviceDiscovery.DeviceDiscovered += deviceDiscovery_DeviceDiscovered; - _deviceDiscovery.DeviceLeft += deviceDiscovery_DeviceLeft; - } - - async void deviceDiscovery_DeviceDiscovered(object sender, SsdpMessageEventArgs e) - { - string usn; - if (!e.Headers.TryGetValue("USN", out usn)) usn = string.Empty; - - string nt; - if (!e.Headers.TryGetValue("NT", out nt)) nt = string.Empty; - - string location; - if (!e.Headers.TryGetValue("Location", out location)) location = string.Empty; - - if (!IsValid(nt, usn)) - { - return; - } - - if (_localServersLookup != null) - { - if (_localServersLookup().Any(i => usn.IndexOf(i, StringComparison.OrdinalIgnoreCase) != -1)) - { - // Don't add the local Dlna server to this - return; - } - } - - if (GetExistingServers(usn).Any()) - { - return; - } - - await _syncLock.WaitAsync().ConfigureAwait(false); - - try - { - if (GetExistingServers(usn).Any()) - { - return; - } - - var device = await Device.CreateuPnpDeviceAsync(new Uri(location), _httpClient, _config, _logger) - .ConfigureAwait(false); - - if (!_servers.Any(i => string.Equals(i.Properties.UUID, device.Properties.UUID, StringComparison.OrdinalIgnoreCase))) - { - _servers.Add(device); - } - } - catch (Exception ex) - { - - } - finally - { - _syncLock.Release(); - } - } - - async void deviceDiscovery_DeviceLeft(object sender, SsdpMessageEventArgs e) - { - string usn; - if (!e.Headers.TryGetValue("USN", out usn)) usn = String.Empty; - - string nt; - if (!e.Headers.TryGetValue("NT", out nt)) nt = String.Empty; - - if (!IsValid(nt, usn)) - { - return; - } - - if (!GetExistingServers(usn).Any()) - { - return; - } - - await _syncLock.WaitAsync().ConfigureAwait(false); - - try - { - var list = _servers.ToList(); - - foreach (var device in GetExistingServers(usn).ToList()) - { - list.Remove(device); - } - - _servers = list; - } - finally - { - _syncLock.Release(); - } - } - - private bool IsValid(string nt, string usn) - { - // It has to report that it's a media renderer - if (usn.IndexOf("ContentDirectory:", StringComparison.OrdinalIgnoreCase) == -1 && - nt.IndexOf("ContentDirectory:", StringComparison.OrdinalIgnoreCase) == -1 && - usn.IndexOf("MediaServer:", StringComparison.OrdinalIgnoreCase) == -1 && - nt.IndexOf("MediaServer:", StringComparison.OrdinalIgnoreCase) == -1) - { - return false; - } - - return true; - } - - private IEnumerable GetExistingServers(string usn) - { - return _servers - .Where(i => usn.IndexOf(i.Properties.UUID, StringComparison.OrdinalIgnoreCase) != -1); - } - - public IEnumerable GetChannels() - { - //if (_servers.Count > 0) - //{ - // var service = _servers[0].Properties.Services - // .FirstOrDefault(i => string.Equals(i.ServiceType, "urn:schemas-upnp-org:service:ContentDirectory:1", StringComparison.OrdinalIgnoreCase)); - - // var controlUrl = service == null ? null : (_servers[0].Properties.BaseUrl.TrimEnd('/') + "/" + service.ControlUrl.TrimStart('/')); - - // if (!string.IsNullOrEmpty(controlUrl)) - // { - // return new List - // { - // new ServerChannel(_servers.ToList(), _httpClient, _logger, controlUrl) - // }; - // } - //} - - return new List(); - } - - public void Dispose() - { - if (_deviceDiscovery != null) - { - _deviceDiscovery.DeviceDiscovered -= deviceDiscovery_DeviceDiscovered; - _deviceDiscovery.DeviceLeft -= deviceDiscovery_DeviceLeft; - } - } - } - - public class ServerChannel : IChannel, IFactoryChannel - { - private readonly IHttpClient _httpClient; - private readonly ILogger _logger; - public string ControlUrl { get; set; } - public List Servers { get; set; } - - public ServerChannel(IHttpClient httpClient, ILogger logger) - { - _httpClient = httpClient; - _logger = logger; - Servers = new List(); - } - - public string Name - { - get { return "Devices"; } - } - - public string Description - { - get { return string.Empty; } - } - - public string DataVersion - { - get { return DateTime.UtcNow.Ticks.ToString(); } - } - - public string HomePageUrl - { - get { return string.Empty; } - } - - public ChannelParentalRating ParentalRating - { - get { return ChannelParentalRating.GeneralAudience; } - } - - public InternalChannelFeatures GetChannelFeatures() - { - return new InternalChannelFeatures - { - ContentTypes = new List - { - ChannelMediaContentType.Song, - ChannelMediaContentType.Clip - }, - - MediaTypes = new List - { - ChannelMediaType.Audio, - ChannelMediaType.Video, - ChannelMediaType.Photo - } - }; - } - - public bool IsEnabledFor(string userId) - { - return true; - } - - public async Task GetChannelItems(InternalChannelItemQuery query, CancellationToken cancellationToken) - { - IEnumerable items; - - if (string.IsNullOrWhiteSpace(query.FolderId)) - { - items = Servers.Select(i => new ChannelItemInfo - { - FolderType = ChannelFolderType.Container, - Id = GetServerId(i), - Name = i.Properties.Name, - Overview = i.Properties.ModelDescription, - Type = ChannelItemType.Folder - }); - } - else - { - var idParts = query.FolderId.Split('|'); - var folderId = idParts.Length == 2 ? idParts[1] : null; - - var result = await new ContentDirectoryBrowser(_httpClient, _logger).Browse(new ContentDirectoryBrowseRequest - { - Limit = query.Limit, - StartIndex = query.StartIndex, - ParentId = folderId, - ContentDirectoryUrl = ControlUrl - - }, cancellationToken).ConfigureAwait(false); - - items = result.Items.ToList(); - } - - var list = items.ToList(); - var count = list.Count; - - list = ApplyPaging(list, query).ToList(); - - return new ChannelItemResult - { - Items = list, - TotalRecordCount = count - }; - } - - private string GetServerId(Device device) - { - return device.Properties.UUID.GetMD5().ToString("N"); - } - - private IEnumerable ApplyPaging(IEnumerable items, InternalChannelItemQuery query) - { - if (query.StartIndex.HasValue) - { - items = items.Skip(query.StartIndex.Value); - } - - if (query.Limit.HasValue) - { - items = items.Take(query.Limit.Value); - } - - return items; - } - - public Task GetChannelImage(ImageType type, CancellationToken cancellationToken) - { - // TODO: Implement - return Task.FromResult(new DynamicImageResponse - { - HasImage = false - }); - } - - public IEnumerable GetSupportedChannelImages() - { - return new List - { - ImageType.Primary - }; - } - } + //public class DlnaChannelFactory : IChannelFactory, IDisposable + //{ + // private readonly IServerConfigurationManager _config; + // private readonly ILogger _logger; + // private readonly IHttpClient _httpClient; + + // private readonly IDeviceDiscovery _deviceDiscovery; + + // private readonly SemaphoreSlim _syncLock = new SemaphoreSlim(1, 1); + // private List _servers = new List(); + + // public static DlnaChannelFactory Instance; + + // private Func> _localServersLookup; + + // public DlnaChannelFactory(IServerConfigurationManager config, IHttpClient httpClient, ILogger logger, IDeviceDiscovery deviceDiscovery) + // { + // _config = config; + // _httpClient = httpClient; + // _logger = logger; + // _deviceDiscovery = deviceDiscovery; + // Instance = this; + // } + + // internal void Start(Func> localServersLookup) + // { + // _localServersLookup = localServersLookup; + + // //deviceDiscovery.DeviceDiscovered += deviceDiscovery_DeviceDiscovered; + // _deviceDiscovery.DeviceLeft += deviceDiscovery_DeviceLeft; + // } + + // async void deviceDiscovery_DeviceDiscovered(object sender, SsdpMessageEventArgs e) + // { + // string usn; + // if (!e.Headers.TryGetValue("USN", out usn)) usn = string.Empty; + + // string nt; + // if (!e.Headers.TryGetValue("NT", out nt)) nt = string.Empty; + + // string location; + // if (!e.Headers.TryGetValue("Location", out location)) location = string.Empty; + + // if (!IsValid(nt, usn)) + // { + // return; + // } + + // if (_localServersLookup != null) + // { + // if (_localServersLookup().Any(i => usn.IndexOf(i, StringComparison.OrdinalIgnoreCase) != -1)) + // { + // // Don't add the local Dlna server to this + // return; + // } + // } + + // if (GetExistingServers(usn).Any()) + // { + // return; + // } + + // await _syncLock.WaitAsync().ConfigureAwait(false); + + // try + // { + // if (GetExistingServers(usn).Any()) + // { + // return; + // } + + // var device = await Device.CreateuPnpDeviceAsync(new Uri(location), _httpClient, _config, _logger) + // .ConfigureAwait(false); + + // if (!_servers.Any(i => string.Equals(i.Properties.UUID, device.Properties.UUID, StringComparison.OrdinalIgnoreCase))) + // { + // _servers.Add(device); + // } + // } + // catch (Exception ex) + // { + + // } + // finally + // { + // _syncLock.Release(); + // } + // } + + // async void deviceDiscovery_DeviceLeft(object sender, SsdpMessageEventArgs e) + // { + // string usn; + // if (!e.Headers.TryGetValue("USN", out usn)) usn = String.Empty; + + // string nt; + // if (!e.Headers.TryGetValue("NT", out nt)) nt = String.Empty; + + // if (!IsValid(nt, usn)) + // { + // return; + // } + + // if (!GetExistingServers(usn).Any()) + // { + // return; + // } + + // await _syncLock.WaitAsync().ConfigureAwait(false); + + // try + // { + // var list = _servers.ToList(); + + // foreach (var device in GetExistingServers(usn).ToList()) + // { + // list.Remove(device); + // } + + // _servers = list; + // } + // finally + // { + // _syncLock.Release(); + // } + // } + + // private bool IsValid(string nt, string usn) + // { + // // It has to report that it's a media renderer + // if (usn.IndexOf("ContentDirectory:", StringComparison.OrdinalIgnoreCase) == -1 && + // nt.IndexOf("ContentDirectory:", StringComparison.OrdinalIgnoreCase) == -1 && + // usn.IndexOf("MediaServer:", StringComparison.OrdinalIgnoreCase) == -1 && + // nt.IndexOf("MediaServer:", StringComparison.OrdinalIgnoreCase) == -1) + // { + // return false; + // } + + // return true; + // } + + // private IEnumerable GetExistingServers(string usn) + // { + // return _servers + // .Where(i => usn.IndexOf(i.Properties.UUID, StringComparison.OrdinalIgnoreCase) != -1); + // } + + // public IEnumerable GetChannels() + // { + // //if (_servers.Count > 0) + // //{ + // // var service = _servers[0].Properties.Services + // // .FirstOrDefault(i => string.Equals(i.ServiceType, "urn:schemas-upnp-org:service:ContentDirectory:1", StringComparison.OrdinalIgnoreCase)); + + // // var controlUrl = service == null ? null : (_servers[0].Properties.BaseUrl.TrimEnd('/') + "/" + service.ControlUrl.TrimStart('/')); + + // // if (!string.IsNullOrEmpty(controlUrl)) + // // { + // // return new List + // // { + // // new ServerChannel(_servers.ToList(), _httpClient, _logger, controlUrl) + // // }; + // // } + // //} + + // return new List(); + // } + + // public void Dispose() + // { + // if (_deviceDiscovery != null) + // { + // _deviceDiscovery.DeviceDiscovered -= deviceDiscovery_DeviceDiscovered; + // _deviceDiscovery.DeviceLeft -= deviceDiscovery_DeviceLeft; + // } + // } + //} + + //public class ServerChannel : IChannel, IFactoryChannel + //{ + // private readonly IHttpClient _httpClient; + // private readonly ILogger _logger; + // public string ControlUrl { get; set; } + // public List Servers { get; set; } + + // public ServerChannel(IHttpClient httpClient, ILogger logger) + // { + // _httpClient = httpClient; + // _logger = logger; + // Servers = new List(); + // } + + // public string Name + // { + // get { return "Devices"; } + // } + + // public string Description + // { + // get { return string.Empty; } + // } + + // public string DataVersion + // { + // get { return DateTime.UtcNow.Ticks.ToString(); } + // } + + // public string HomePageUrl + // { + // get { return string.Empty; } + // } + + // public ChannelParentalRating ParentalRating + // { + // get { return ChannelParentalRating.GeneralAudience; } + // } + + // public InternalChannelFeatures GetChannelFeatures() + // { + // return new InternalChannelFeatures + // { + // ContentTypes = new List + // { + // ChannelMediaContentType.Song, + // ChannelMediaContentType.Clip + // }, + + // MediaTypes = new List + // { + // ChannelMediaType.Audio, + // ChannelMediaType.Video, + // ChannelMediaType.Photo + // } + // }; + // } + + // public bool IsEnabledFor(string userId) + // { + // return true; + // } + + // public async Task GetChannelItems(InternalChannelItemQuery query, CancellationToken cancellationToken) + // { + // IEnumerable items; + + // if (string.IsNullOrWhiteSpace(query.FolderId)) + // { + // items = Servers.Select(i => new ChannelItemInfo + // { + // FolderType = ChannelFolderType.Container, + // Id = GetServerId(i), + // Name = i.Properties.Name, + // Overview = i.Properties.ModelDescription, + // Type = ChannelItemType.Folder + // }); + // } + // else + // { + // var idParts = query.FolderId.Split('|'); + // var folderId = idParts.Length == 2 ? idParts[1] : null; + + // var result = await new ContentDirectoryBrowser(_httpClient, _logger).Browse(new ContentDirectoryBrowseRequest + // { + // Limit = query.Limit, + // StartIndex = query.StartIndex, + // ParentId = folderId, + // ContentDirectoryUrl = ControlUrl + + // }, cancellationToken).ConfigureAwait(false); + + // items = result.Items.ToList(); + // } + + // var list = items.ToList(); + // var count = list.Count; + + // list = ApplyPaging(list, query).ToList(); + + // return new ChannelItemResult + // { + // Items = list, + // TotalRecordCount = count + // }; + // } + + // private string GetServerId(Device device) + // { + // return device.Properties.UUID.GetMD5().ToString("N"); + // } + + // private IEnumerable ApplyPaging(IEnumerable items, InternalChannelItemQuery query) + // { + // if (query.StartIndex.HasValue) + // { + // items = items.Skip(query.StartIndex.Value); + // } + + // if (query.Limit.HasValue) + // { + // items = items.Take(query.Limit.Value); + // } + + // return items; + // } + + // public Task GetChannelImage(ImageType type, CancellationToken cancellationToken) + // { + // // TODO: Implement + // return Task.FromResult(new DynamicImageResponse + // { + // HasImage = false + // }); + // } + + // public IEnumerable GetSupportedChannelImages() + // { + // return new List + // { + // ImageType.Primary + // }; + // } + //} } diff --git a/MediaBrowser.Dlna/Main/DlnaEntryPoint.cs b/MediaBrowser.Dlna/Main/DlnaEntryPoint.cs index bdb778cab..8c45757e7 100644 --- a/MediaBrowser.Dlna/Main/DlnaEntryPoint.cs +++ b/MediaBrowser.Dlna/Main/DlnaEntryPoint.cs @@ -81,8 +81,6 @@ namespace MediaBrowser.Dlna.Main ReloadComponents(); _config.NamedConfigurationUpdated += _config_NamedConfigurationUpdated; - - DlnaChannelFactory.Instance.Start(() => _registeredServerIds); } void _config_NamedConfigurationUpdated(object sender, ConfigurationUpdateEventArgs e) diff --git a/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs b/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs index e2543c841..01be4924a 100644 --- a/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs +++ b/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs @@ -483,9 +483,6 @@ namespace MediaBrowser.MediaEncoding.Encoder } } - // TODO: Output in webp for smaller sizes - // -f image2 -f webp - // Use ffmpeg to sample 100 (we can drop this if required using thumbnail=50 for 50 frames) frames and pick the best thumbnail. Have a fall back just in case. var args = useIFrame ? string.Format("-i {0} -threads 1 -v quiet -vframes 1 -vf \"{2},thumbnail=30\" -f image2 \"{1}\"", inputPath, "-", vf) : string.Format("-i {0} -threads 1 -v quiet -vframes 1 -vf \"{2}\" -f image2 \"{1}\"", inputPath, "-", vf); diff --git a/MediaBrowser.Model/Configuration/ServerConfiguration.cs b/MediaBrowser.Model/Configuration/ServerConfiguration.cs index 1fcad8c95..b137a8502 100644 --- a/MediaBrowser.Model/Configuration/ServerConfiguration.cs +++ b/MediaBrowser.Model/Configuration/ServerConfiguration.cs @@ -276,11 +276,7 @@ namespace MediaBrowser.Model.Configuration InsecureApps9 = new[] { - "Chromecast", - "iOS", "Unknown app", - "iPad", - "iPhone", "Windows Phone" }; diff --git a/MediaBrowser.Model/Dlna/ConditionProcessor.cs b/MediaBrowser.Model/Dlna/ConditionProcessor.cs index 793036f40..fd3df9c76 100644 --- a/MediaBrowser.Model/Dlna/ConditionProcessor.cs +++ b/MediaBrowser.Model/Dlna/ConditionProcessor.cs @@ -28,7 +28,6 @@ namespace MediaBrowser.Model.Dlna // TODO: Implement return true; case ProfileConditionValue.Has64BitOffsets: - // TODO: Implement return true; case ProfileConditionValue.IsAnamorphic: return IsConditionSatisfied(condition, isAnamorphic); diff --git a/MediaBrowser.Providers/Omdb/OmdbImageProvider.cs b/MediaBrowser.Providers/Omdb/OmdbImageProvider.cs index 7f804f9df..3f25f0f93 100644 --- a/MediaBrowser.Providers/Omdb/OmdbImageProvider.cs +++ b/MediaBrowser.Providers/Omdb/OmdbImageProvider.cs @@ -79,8 +79,7 @@ namespace MediaBrowser.Providers.Omdb public bool Supports(IHasImages item) { - // Save the http requests since we know it's not currently supported - // TODO: Check again periodically + // We'll hammer Omdb if we enable this if (item is Person) { return false; diff --git a/MediaBrowser.Server.Implementations/Channels/ChannelManager.cs b/MediaBrowser.Server.Implementations/Channels/ChannelManager.cs index 9edfc0c35..d7209fbdf 100644 --- a/MediaBrowser.Server.Implementations/Channels/ChannelManager.cs +++ b/MediaBrowser.Server.Implementations/Channels/ChannelManager.cs @@ -31,7 +31,6 @@ namespace MediaBrowser.Server.Implementations.Channels public class ChannelManager : IChannelManager, IDisposable { private IChannel[] _channels; - private IChannelFactory[] _factories; private readonly IUserManager _userManager; private readonly IUserDataManager _userDataManager; @@ -76,10 +75,9 @@ namespace MediaBrowser.Server.Implementations.Channels } } - public void AddParts(IEnumerable channels, IEnumerable factories) + public void AddParts(IEnumerable channels) { - _channels = channels.Where(i => !(i is IFactoryChannel)).ToArray(); - _factories = factories.ToArray(); + _channels = channels.ToArray(); } public string ChannelDownloadPath @@ -99,20 +97,7 @@ namespace MediaBrowser.Server.Implementations.Channels private IEnumerable GetAllChannels() { - return _factories - .SelectMany(i => - { - try - { - return i.GetChannels().ToList(); - } - catch (Exception ex) - { - _logger.ErrorException("Error getting channel list", ex); - return new List(); - } - }) - .Concat(_channels) + return _channels .OrderBy(i => i.Name); } diff --git a/MediaBrowser.Server.Implementations/HttpServer/Security/AuthorizationContext.cs b/MediaBrowser.Server.Implementations/HttpServer/Security/AuthorizationContext.cs index 80892b96c..ae5ce796e 100644 --- a/MediaBrowser.Server.Implementations/HttpServer/Security/AuthorizationContext.cs +++ b/MediaBrowser.Server.Implementations/HttpServer/Security/AuthorizationContext.cs @@ -69,47 +69,6 @@ namespace MediaBrowser.Server.Implementations.HttpServer.Security token = httpReq.QueryString["api_key"]; } - // Hack until iOS is updated - // TODO: Remove - if (string.IsNullOrWhiteSpace(client)) - { - var userAgent = httpReq.Headers["User-Agent"] ?? string.Empty; - - if (userAgent.IndexOf("mediabrowserios", StringComparison.OrdinalIgnoreCase) != -1 || - userAgent.IndexOf("iphone", StringComparison.OrdinalIgnoreCase) != -1 || - userAgent.IndexOf("ipad", StringComparison.OrdinalIgnoreCase) != -1) - { - client = "iOS"; - } - - else if (userAgent.IndexOf("crKey", StringComparison.OrdinalIgnoreCase) != -1) - { - client = "Chromecast"; - } - } - - // Hack until iOS is updated - // TODO: Remove - if (string.IsNullOrWhiteSpace(device)) - { - var userAgent = httpReq.Headers["User-Agent"] ?? string.Empty; - - if (userAgent.IndexOf("iPhone", StringComparison.OrdinalIgnoreCase) != -1) - { - device = "iPhone"; - } - - else if (userAgent.IndexOf("iPad", StringComparison.OrdinalIgnoreCase) != -1) - { - device = "iPad"; - } - - else if (userAgent.IndexOf("crKey", StringComparison.OrdinalIgnoreCase) != -1) - { - device = "Chromecast"; - } - } - var info = new AuthorizationInfo { Client = client, diff --git a/MediaBrowser.Server.Implementations/Sync/SyncManager.cs b/MediaBrowser.Server.Implementations/Sync/SyncManager.cs index 428ba5e20..15d196877 100644 --- a/MediaBrowser.Server.Implementations/Sync/SyncManager.cs +++ b/MediaBrowser.Server.Implementations/Sync/SyncManager.cs @@ -962,8 +962,6 @@ namespace MediaBrowser.Server.Implementations.Sync return false; } - // TODO: Make sure it hasn't been deleted - return true; } diff --git a/MediaBrowser.Server.Startup.Common/ApplicationHost.cs b/MediaBrowser.Server.Startup.Common/ApplicationHost.cs index ad2cd96b6..b55e727d6 100644 --- a/MediaBrowser.Server.Startup.Common/ApplicationHost.cs +++ b/MediaBrowser.Server.Startup.Common/ApplicationHost.cs @@ -790,7 +790,7 @@ namespace MediaBrowser.Server.Startup.Common SessionManager.AddParts(GetExports()); - ChannelManager.AddParts(GetExports(), GetExports()); + ChannelManager.AddParts(GetExports()); MediaSourceManager.AddParts(GetExports()); diff --git a/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj b/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj index ccac9d8d8..36c21efde 100644 --- a/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj +++ b/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj @@ -1005,9 +1005,6 @@ PreserveNewest - - PreserveNewest - PreserveNewest -- cgit v1.2.3 From ebc95ffb9af1d8fabe94c2686af8e816018e34ef Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Fri, 25 Sep 2015 22:31:13 -0400 Subject: update access denied exceptions --- MediaBrowser.Api/EnvironmentService.cs | 12 +----- MediaBrowser.Api/Library/LibraryService.cs | 2 +- MediaBrowser.Api/LiveTv/LiveTvService.cs | 4 +- .../Configuration/ServerConfiguration.cs | 1 - MediaBrowser.Providers/Manager/ImageSaver.cs | 5 --- MediaBrowser.Providers/Manager/ProviderManager.cs | 6 +++ .../Subtitles/OpenSubtitleDownloader.cs | 2 +- .../HttpServer/HttpListenerHost.cs | 2 +- .../LiveTv/EmbyTV/EmbyTV.cs | 47 ++++++++++++++-------- .../Session/SessionManager.cs | 5 ++- MediaBrowser.WebDashboard/Api/PackageCreator.cs | 3 +- 11 files changed, 47 insertions(+), 42 deletions(-) (limited to 'MediaBrowser.Server.Implementations/HttpServer') diff --git a/MediaBrowser.Api/EnvironmentService.cs b/MediaBrowser.Api/EnvironmentService.cs index 11a0eec23..81b326da8 100644 --- a/MediaBrowser.Api/EnvironmentService.cs +++ b/MediaBrowser.Api/EnvironmentService.cs @@ -120,8 +120,6 @@ namespace MediaBrowser.Api /// /// The request. /// System.Object. - /// Path - /// public object Get(GetDirectoryContents request) { var path = request.Path; @@ -138,15 +136,7 @@ namespace MediaBrowser.Api return ToOptimizedSerializedResultUsingCache(GetNetworkShares(path).OrderBy(i => i.Path).ToList()); } - try - { - return ToOptimizedSerializedResultUsingCache(GetFileSystemEntries(request).OrderBy(i => i.Path).ToList()); - } - catch (UnauthorizedAccessException) - { - // Don't throw the original UnauthorizedAccessException because it will cause a 401 response - throw new ApplicationException("Access to the path " + request.Path + " is denied."); - } + return ToOptimizedSerializedResultUsingCache(GetFileSystemEntries(request).OrderBy(i => i.Path).ToList()); } public object Get(GetNetworkShares request) diff --git a/MediaBrowser.Api/Library/LibraryService.cs b/MediaBrowser.Api/Library/LibraryService.cs index eb1cd6084..20fd1ef40 100644 --- a/MediaBrowser.Api/Library/LibraryService.cs +++ b/MediaBrowser.Api/Library/LibraryService.cs @@ -722,7 +722,7 @@ namespace MediaBrowser.Api.Library if (!item.CanDelete(user)) { - throw new UnauthorizedAccessException(); + throw new SecurityException("Unauthorized access"); } if (item is ILiveTvRecording) diff --git a/MediaBrowser.Api/LiveTv/LiveTvService.cs b/MediaBrowser.Api/LiveTv/LiveTvService.cs index 07e64c98d..344d6ab3d 100644 --- a/MediaBrowser.Api/LiveTv/LiveTvService.cs +++ b/MediaBrowser.Api/LiveTv/LiveTvService.cs @@ -521,12 +521,12 @@ namespace MediaBrowser.Api.LiveTv if (user == null) { - throw new UnauthorizedAccessException("Anonymous live tv management is not allowed."); + throw new SecurityException("Anonymous live tv management is not allowed."); } if (!user.Policy.EnableLiveTvManagement) { - throw new UnauthorizedAccessException("The current user does not have permission to manage live tv."); + throw new SecurityException("The current user does not have permission to manage live tv."); } } diff --git a/MediaBrowser.Model/Configuration/ServerConfiguration.cs b/MediaBrowser.Model/Configuration/ServerConfiguration.cs index 4ec688611..5121fcd6f 100644 --- a/MediaBrowser.Model/Configuration/ServerConfiguration.cs +++ b/MediaBrowser.Model/Configuration/ServerConfiguration.cs @@ -274,7 +274,6 @@ namespace MediaBrowser.Model.Configuration InsecureApps9 = new[] { - "Unknown app", "Windows Phone" }; diff --git a/MediaBrowser.Providers/Manager/ImageSaver.cs b/MediaBrowser.Providers/Manager/ImageSaver.cs index 624736779..dec688635 100644 --- a/MediaBrowser.Providers/Manager/ImageSaver.cs +++ b/MediaBrowser.Providers/Manager/ImageSaver.cs @@ -236,11 +236,6 @@ namespace MediaBrowser.Providers.Manager file.Attributes |= FileAttributes.Hidden; } } - catch (UnauthorizedAccessException ex) - { - _logger.Error("Error saving image to {0}", ex, path); - throw new Exception(string.Format("Error saving image to {0}", path), ex); - } finally { _libraryMonitor.ReportFileSystemChangeComplete(path, false); diff --git a/MediaBrowser.Providers/Manager/ProviderManager.cs b/MediaBrowser.Providers/Manager/ProviderManager.cs index 596a76327..b2a51377c 100644 --- a/MediaBrowser.Providers/Manager/ProviderManager.cs +++ b/MediaBrowser.Providers/Manager/ProviderManager.cs @@ -879,6 +879,11 @@ namespace MediaBrowser.Providers.Manager private void StartRefreshTimer() { + if (_disposed) + { + return; + } + lock (_refreshTimerLock) { if (_refreshTimer == null) @@ -1013,6 +1018,7 @@ namespace MediaBrowser.Providers.Manager public void Dispose() { _disposed = true; + StopRefreshTimer(); } } } \ No newline at end of file diff --git a/MediaBrowser.Providers/Subtitles/OpenSubtitleDownloader.cs b/MediaBrowser.Providers/Subtitles/OpenSubtitleDownloader.cs index 54db0d5fa..5e48b79e3 100644 --- a/MediaBrowser.Providers/Subtitles/OpenSubtitleDownloader.cs +++ b/MediaBrowser.Providers/Subtitles/OpenSubtitleDownloader.cs @@ -196,7 +196,7 @@ namespace MediaBrowser.Providers.Subtitles if (!(loginResponse is MethodResponseLogIn)) { - throw new UnauthorizedAccessException("Authentication to OpenSubtitles failed."); + throw new Exception("Authentication to OpenSubtitles failed."); } _lastLogin = DateTime.UtcNow; diff --git a/MediaBrowser.Server.Implementations/HttpServer/HttpListenerHost.cs b/MediaBrowser.Server.Implementations/HttpServer/HttpListenerHost.cs index 1885afc61..e8bb40ba1 100644 --- a/MediaBrowser.Server.Implementations/HttpServer/HttpListenerHost.cs +++ b/MediaBrowser.Server.Implementations/HttpServer/HttpListenerHost.cs @@ -92,7 +92,7 @@ namespace MediaBrowser.Server.Implementations.HttpServer {typeof (FileNotFoundException), 404}, {typeof (DirectoryNotFoundException), 404}, {typeof (SecurityException), 401}, - {typeof (UnauthorizedAccessException), 401} + {typeof (UnauthorizedAccessException), 500} }; HostConfig.Instance.DebugMode = true; diff --git a/MediaBrowser.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs b/MediaBrowser.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs index 2b55945e6..ca3da4aa2 100644 --- a/MediaBrowser.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs +++ b/MediaBrowser.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs @@ -611,11 +611,19 @@ namespace MediaBrowser.Server.Implementations.LiveTv.EmbyTV try { + var recordingEndDate = timer.EndDate.AddSeconds(timer.PostPaddingSeconds); + + if (recordingEndDate <= DateTime.UtcNow) + { + _logger.Warn("Recording timer fired for timer {0}, Id: {1}, but the program has already ended.", timer.Name, timer.Id); + return; + } + var cancellationTokenSource = new CancellationTokenSource(); if (_activeRecordings.TryAdd(timer.Id, cancellationTokenSource)) { - await RecordStream(timer, cancellationTokenSource.Token).ConfigureAwait(false); + await RecordStream(timer, recordingEndDate, cancellationTokenSource.Token).ConfigureAwait(false); } } catch (OperationCanceledException) @@ -628,22 +636,15 @@ namespace MediaBrowser.Server.Implementations.LiveTv.EmbyTV } } - private async Task RecordStream(TimerInfo timer, CancellationToken cancellationToken) + private async Task RecordStream(TimerInfo timer, DateTime recordingEndDate, CancellationToken cancellationToken) { if (timer == null) { throw new ArgumentNullException("timer"); } - var mediaStreamInfo = await GetChannelStream(timer.ChannelId, null, CancellationToken.None); - var duration = (timer.EndDate - DateTime.UtcNow).Add(TimeSpan.FromSeconds(timer.PostPaddingSeconds)); - - HttpRequestOptions httpRequestOptions = new HttpRequestOptions() - { - Url = mediaStreamInfo.Path - }; - var info = GetProgramInfoFromCache(timer.ChannelId, timer.ProgramId); + var recordPath = RecordingPath; if (info.IsMovie) @@ -708,15 +709,27 @@ namespace MediaBrowser.Server.Implementations.LiveTv.EmbyTV _recordingProvider.Add(recording); } - recording.Path = recordPath; - recording.Status = RecordingStatus.InProgress; - recording.DateLastUpdated = DateTime.UtcNow; - _recordingProvider.Update(recording); - - _logger.Info("Beginning recording."); - try { + var mediaStreamInfo = await GetChannelStream(timer.ChannelId, null, CancellationToken.None); + + // HDHR doesn't seem to release the tuner right away after first probing with ffmpeg + await Task.Delay(3000, cancellationToken).ConfigureAwait(false); + + var duration = recordingEndDate - DateTime.UtcNow; + + HttpRequestOptions httpRequestOptions = new HttpRequestOptions() + { + Url = mediaStreamInfo.Path + }; + + recording.Path = recordPath; + recording.Status = RecordingStatus.InProgress; + recording.DateLastUpdated = DateTime.UtcNow; + _recordingProvider.Update(recording); + + _logger.Info("Beginning recording."); + httpRequestOptions.BufferContent = false; var durationToken = new CancellationTokenSource(duration); var linkedToken = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken, durationToken.Token).Token; diff --git a/MediaBrowser.Server.Implementations/Session/SessionManager.cs b/MediaBrowser.Server.Implementations/Session/SessionManager.cs index d9c3ed7a6..d164874dc 100644 --- a/MediaBrowser.Server.Implementations/Session/SessionManager.cs +++ b/MediaBrowser.Server.Implementations/Session/SessionManager.cs @@ -29,6 +29,7 @@ using System.Globalization; using System.Linq; using System.Threading; using System.Threading.Tasks; +using MediaBrowser.Controller.Net; namespace MediaBrowser.Server.Implementations.Session { @@ -1276,7 +1277,7 @@ namespace MediaBrowser.Server.Implementations.Session { if (!_deviceManager.CanAccessDevice(user.Id.ToString("N"), request.DeviceId)) { - throw new UnauthorizedAccessException("User is not allowed access from this device."); + throw new SecurityException("User is not allowed access from this device."); } } @@ -1286,7 +1287,7 @@ namespace MediaBrowser.Server.Implementations.Session { EventHelper.FireEventIfNotNull(AuthenticationFailed, this, new GenericEventArgs(request), _logger); - throw new UnauthorizedAccessException("Invalid user or password entered."); + throw new SecurityException("Invalid user or password entered."); } var token = await GetAuthorizationToken(user.Id.ToString("N"), request.DeviceId, request.App, request.AppVersion, request.DeviceName).ConfigureAwait(false); diff --git a/MediaBrowser.WebDashboard/Api/PackageCreator.cs b/MediaBrowser.WebDashboard/Api/PackageCreator.cs index 7aaf9c27a..9e9c1f1b9 100644 --- a/MediaBrowser.WebDashboard/Api/PackageCreator.cs +++ b/MediaBrowser.WebDashboard/Api/PackageCreator.cs @@ -9,6 +9,7 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; +using MediaBrowser.Controller.Net; using WebMarkupMin.Core; using WebMarkupMin.Core.Minifiers; using WebMarkupMin.Core.Settings; @@ -136,7 +137,7 @@ namespace MediaBrowser.WebDashboard.Api // Don't allow file system access outside of the source folder if (!_fileSystem.ContainsSubPath(rootPath, fullPath)) { - throw new UnauthorizedAccessException(); + throw new SecurityException("Access denied"); } return fullPath; -- cgit v1.2.3 From e76e8bb96cf119380582d573fa057fd258c839a0 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Fri, 2 Oct 2015 14:30:27 -0400 Subject: update sync progress display --- MediaBrowser.Api/Sync/SyncService.cs | 10 +++++++++- MediaBrowser.Controller/Net/StaticResultOptions.cs | 1 + .../HttpServer/HttpResultFactory.cs | 3 ++- MediaBrowser.Server.Implementations/HttpServer/StreamWriter.cs | 6 ++++++ 4 files changed, 18 insertions(+), 2 deletions(-) (limited to 'MediaBrowser.Server.Implementations/HttpServer') diff --git a/MediaBrowser.Api/Sync/SyncService.cs b/MediaBrowser.Api/Sync/SyncService.cs index 5863e05e3..593c3a108 100644 --- a/MediaBrowser.Api/Sync/SyncService.cs +++ b/MediaBrowser.Api/Sync/SyncService.cs @@ -244,7 +244,15 @@ namespace MediaBrowser.Api.Sync var task = _syncManager.ReportSyncJobItemTransferBeginning(request.Id); Task.WaitAll(task); - return ToStaticFileResult(jobItem.OutputPath); + return ResultFactory.GetStaticFileResult(Request, new StaticFileResultOptions + { + Path = jobItem.OutputPath, + OnError = () => + { + var failedTask = _syncManager.ReportSyncJobItemTransferFailed(request.Id); + Task.WaitAll(failedTask); + } + }); } public object Get(GetSyncDialogOptions request) diff --git a/MediaBrowser.Controller/Net/StaticResultOptions.cs b/MediaBrowser.Controller/Net/StaticResultOptions.cs index 6a104554a..b5efc1b8f 100644 --- a/MediaBrowser.Controller/Net/StaticResultOptions.cs +++ b/MediaBrowser.Controller/Net/StaticResultOptions.cs @@ -19,6 +19,7 @@ namespace MediaBrowser.Controller.Net public IDictionary ResponseHeaders { get; set; } public Action OnComplete { get; set; } + public Action OnError { get; set; } public StaticResultOptions() { diff --git a/MediaBrowser.Server.Implementations/HttpServer/HttpResultFactory.cs b/MediaBrowser.Server.Implementations/HttpServer/HttpResultFactory.cs index 961d58eb6..9dc8d94e2 100644 --- a/MediaBrowser.Server.Implementations/HttpServer/HttpResultFactory.cs +++ b/MediaBrowser.Server.Implementations/HttpServer/HttpResultFactory.cs @@ -476,7 +476,8 @@ namespace MediaBrowser.Server.Implementations.HttpServer return new StreamWriter(stream, contentType, _logger) { - OnComplete = options.OnComplete + OnComplete = options.OnComplete, + OnError = options.OnError }; } diff --git a/MediaBrowser.Server.Implementations/HttpServer/StreamWriter.cs b/MediaBrowser.Server.Implementations/HttpServer/StreamWriter.cs index daa5b86d9..a756f4aa8 100644 --- a/MediaBrowser.Server.Implementations/HttpServer/StreamWriter.cs +++ b/MediaBrowser.Server.Implementations/HttpServer/StreamWriter.cs @@ -36,6 +36,7 @@ namespace MediaBrowser.Server.Implementations.HttpServer } public Action OnComplete { get; set; } + public Action OnError { get; set; } /// /// Initializes a new instance of the class. @@ -102,6 +103,11 @@ namespace MediaBrowser.Server.Implementations.HttpServer { Logger.ErrorException("Error streaming data", ex); + if (OnError != null) + { + OnError(); + } + throw; } finally -- cgit v1.2.3 From 078277ebc29bd749045e5d109024d9d08aa8edea Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sun, 4 Oct 2015 00:23:11 -0400 Subject: continue file system rework --- Emby.Drawing/Common/ImageHeader.cs | 1 + Emby.Drawing/Emby.Drawing.csproj | 7 + Emby.Drawing/GDI/DynamicImageHelpers.cs | 1 + Emby.Drawing/GDI/GDIImageEncoder.cs | 1 + Emby.Drawing/ImageMagick/ImageMagickEncoder.cs | 1 + Emby.Drawing/ImageMagick/PlayedIndicatorDrawer.cs | 1 + Emby.Drawing/ImageMagick/StripCollageBuilder.cs | 1 + Emby.Drawing/ImageMagick/UnplayedCountIndicator.cs | 1 + Emby.Drawing/ImageProcessor.cs | 1 + Emby.Drawing/packages.config | 2 + MediaBrowser.Api/ApiEntryPoint.cs | 1 + MediaBrowser.Api/ConfigurationService.cs | 1 + MediaBrowser.Api/EnvironmentService.cs | 1 + MediaBrowser.Api/Images/ImageByNameService.cs | 1 + MediaBrowser.Api/Images/ImageService.cs | 1 + MediaBrowser.Api/Images/RemoteImageService.cs | 1 + MediaBrowser.Api/ItemLookupService.cs | 1 + MediaBrowser.Api/ItemRefreshService.cs | 1 + MediaBrowser.Api/Library/LibraryHelpers.cs | 1 + MediaBrowser.Api/Library/LibraryService.cs | 1 + .../Library/LibraryStructureService.cs | 1 + MediaBrowser.Api/MediaBrowser.Api.csproj | 7 + MediaBrowser.Api/Playback/BaseStreamingService.cs | 1 + MediaBrowser.Api/Playback/Dash/MpegDashService.cs | 1 + MediaBrowser.Api/Playback/Hls/BaseHlsService.cs | 1 + MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs | 1 + MediaBrowser.Api/Playback/Hls/VideoHlsService.cs | 1 + .../Playback/Progressive/AudioService.cs | 1 + .../Progressive/BaseProgressiveStreamingService.cs | 1 + .../Progressive/ProgressiveStreamWriter.cs | 1 + .../Playback/Progressive/VideoService.cs | 1 + MediaBrowser.Api/Subtitles/SubtitleService.cs | 1 + MediaBrowser.Api/System/SystemService.cs | 1 + MediaBrowser.Api/VideosService.cs | 1 + MediaBrowser.Api/packages.config | 2 + .../Archiving/ZipClient.cs | 1 + .../BaseApplicationHost.cs | 1 + .../Devices/DeviceId.cs | 1 + .../HttpClientManager/HttpClientManager.cs | 1 + .../IO/CommonFileSystem.cs | 559 --------------------- .../MediaBrowser.Common.Implementations.csproj | 8 +- .../ScheduledTasks/ScheduledTaskWorker.cs | 1 + .../ScheduledTasks/TaskManager.cs | 1 + .../ScheduledTasks/Tasks/DeleteCacheFileTask.cs | 1 + .../ScheduledTasks/Tasks/DeleteLogFileTask.cs | 1 + .../Serialization/JsonSerializer.cs | 1 + .../Serialization/XmlSerializer.cs | 1 + .../Updates/InstallationManager.cs | 1 + .../packages.config | 2 + MediaBrowser.Common/IO/FileSystemMetadata.cs | 32 -- MediaBrowser.Common/IO/IFileSystem.cs | 291 ----------- MediaBrowser.Common/MediaBrowser.Common.csproj | 2 - .../Entities/AggregateFolder.cs | 1 + MediaBrowser.Controller/Entities/BaseItem.cs | 1 + .../Entities/CollectionFolder.cs | 1 + MediaBrowser.Controller/Entities/Folder.cs | 1 + MediaBrowser.Controller/Entities/IHasImages.cs | 1 + MediaBrowser.Controller/Entities/Movies/Movie.cs | 1 + MediaBrowser.Controller/Entities/Video.cs | 1 + MediaBrowser.Controller/IO/FileData.cs | 1 + MediaBrowser.Controller/Library/ILibraryManager.cs | 1 + MediaBrowser.Controller/Library/ItemResolveArgs.cs | 1 + .../MediaBrowser.Controller.csproj | 7 + .../MediaEncoding/MediaEncoderHelpers.cs | 1 + .../Providers/DirectoryService.cs | 1 + .../Providers/IDirectoryService.cs | 1 + .../Providers/LocalImageInfo.cs | 1 + .../Providers/MetadataRefreshOptions.cs | 1 + MediaBrowser.Controller/Resolvers/IItemResolver.cs | 1 + MediaBrowser.Controller/packages.config | 2 + MediaBrowser.Dlna/DlnaManager.cs | 1 + MediaBrowser.Dlna/MediaBrowser.Dlna.csproj | 12 + MediaBrowser.Dlna/packages.config | 5 + MediaBrowser.LocalMetadata/BaseXmlProvider.cs | 1 + .../Images/CollectionFolderImageProvider.cs | 1 + .../Images/EpisodeLocalImageProvider.cs | 1 + .../Images/ImagesByNameImageProvider.cs | 1 + .../Images/InternalMetadataFolderImageProvider.cs | 1 + .../Images/LocalImageProvider.cs | 1 + .../MediaBrowser.LocalMetadata.csproj | 13 +- .../Parsers/EpisodeXmlParser.cs | 1 + .../Providers/BoxSetXmlProvider.cs | 1 + .../Providers/EpisodeXmlProvider.cs | 1 + .../Providers/FolderXmlProvider.cs | 1 + .../Providers/GameSystemXmlProvider.cs | 1 + .../Providers/GameXmlProvider.cs | 1 + .../Providers/MovieXmlProvider.cs | 1 + .../Providers/MusicVideoXmlProvider.cs | 1 + .../Providers/PersonXmlProvider.cs | 1 + .../Providers/PlaylistXmlProvider.cs | 1 + .../Providers/SeasonXmlProvider.cs | 1 + .../Providers/SeriesXmlProvider.cs | 1 + .../Providers/VideoXmlProvider.cs | 1 + .../Savers/BoxSetXmlSaver.cs | 1 + .../Savers/EpisodeXmlSaver.cs | 1 + .../Savers/FolderXmlSaver.cs | 1 + .../Savers/GameSystemXmlSaver.cs | 1 + MediaBrowser.LocalMetadata/Savers/GameXmlSaver.cs | 1 + MediaBrowser.LocalMetadata/Savers/MovieXmlSaver.cs | 1 + .../Savers/PersonXmlSaver.cs | 1 + .../Savers/PlaylistXmlSaver.cs | 1 + .../Savers/SeriesXmlSaver.cs | 1 + .../Savers/XmlSaverHelpers.cs | 1 + MediaBrowser.LocalMetadata/packages.config | 5 + .../Configuration/EncodingConfigurationFactory.cs | 1 + MediaBrowser.MediaEncoding/Encoder/AudioEncoder.cs | 1 + MediaBrowser.MediaEncoding/Encoder/BaseEncoder.cs | 1 + MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs | 1 + MediaBrowser.MediaEncoding/Encoder/VideoEncoder.cs | 1 + .../MediaBrowser.MediaEncoding.csproj | 7 + .../Probing/ProbeResultNormalizer.cs | 1 + .../Subtitles/SubtitleEncoder.cs | 1 + MediaBrowser.MediaEncoding/packages.config | 2 + .../Books/BookMetadataService.cs | 1 + .../BoxSets/BoxSetMetadataService.cs | 1 + .../BoxSets/MovieDbBoxSetProvider.cs | 1 + .../Channels/AudioChannelItemMetadataService.cs | 1 + .../Channels/ChannelMetadataService.cs | 1 + .../Channels/VideoChannelItemMetadataService.cs | 1 + .../Folders/FolderMetadataService.cs | 1 + .../Folders/UserViewMetadataService.cs | 1 + .../GameGenres/GameGenreImageProvider.cs | 1 + .../GameGenres/GameGenreMetadataService.cs | 1 + .../Games/GameMetadataService.cs | 1 + .../Games/GameSystemMetadataService.cs | 1 + .../Genres/GenreImageProvider.cs | 1 + .../Genres/GenreMetadataService.cs | 1 + MediaBrowser.Providers/ImagesByName/ImageUtils.cs | 1 + .../LiveTv/AudioRecordingService.cs | 1 + .../LiveTv/ChannelMetadataService.cs | 1 + .../LiveTv/ProgramMetadataService.cs | 1 + .../LiveTv/VideoRecordingService.cs | 1 + MediaBrowser.Providers/Manager/ImageSaver.cs | 1 + .../Manager/ItemImageProvider.cs | 1 + MediaBrowser.Providers/Manager/MetadataService.cs | 1 + MediaBrowser.Providers/Manager/ProviderManager.cs | 1 + .../MediaBrowser.Providers.csproj | 7 + .../MediaInfo/AudioImageProvider.cs | 1 + .../MediaInfo/FFProbeProvider.cs | 1 + .../MediaInfo/FFProbeVideoInfo.cs | 1 + .../MediaInfo/SubtitleResolver.cs | 1 + .../MediaInfo/VideoImageProvider.cs | 1 + .../Movies/FanArtMovieUpdatesPostScanTask.cs | 1 + .../Movies/FanartMovieImageProvider.cs | 1 + .../Movies/GenericMovieDbInfo.cs | 1 + MediaBrowser.Providers/Movies/MovieDbProvider.cs | 1 + .../Movies/MovieMetadataService.cs | 1 + .../Movies/MovieUpdatesPrescanTask.cs | 1 + .../Music/AlbumMetadataService.cs | 1 + .../Music/ArtistMetadataService.cs | 1 + .../Music/AudioDbAlbumProvider.cs | 1 + .../Music/AudioDbArtistProvider.cs | 1 + .../Music/AudioMetadataService.cs | 1 + .../Music/FanArtAlbumProvider.cs | 1 + .../Music/FanArtArtistProvider.cs | 1 + .../Music/FanArtUpdatesPostScanTask.cs | 1 + .../Music/MusicVideoMetadataService.cs | 1 + .../MusicGenres/MusicGenreImageProvider.cs | 1 + .../MusicGenres/MusicGenreMetadataService.cs | 1 + .../People/MovieDbPersonProvider.cs | 1 + .../People/PersonMetadataService.cs | 1 + .../Photos/PhotoAlbumMetadataService.cs | 1 + .../Photos/PhotoMetadataService.cs | 1 + .../Playlists/PlaylistMetadataService.cs | 1 + .../Studios/StudioMetadataService.cs | 1 + .../Studios/StudiosImageProvider.cs | 1 + .../Subtitles/SubtitleManager.cs | 1 + MediaBrowser.Providers/TV/DummySeasonProvider.cs | 1 + .../TV/EpisodeMetadataService.cs | 1 + MediaBrowser.Providers/TV/FanArtSeasonProvider.cs | 1 + .../TV/FanArtTvUpdatesPostScanTask.cs | 1 + MediaBrowser.Providers/TV/FanartSeriesProvider.cs | 1 + .../TV/MissingEpisodeProvider.cs | 1 + .../TV/MovieDbEpisodeImageProvider.cs | 1 + MediaBrowser.Providers/TV/MovieDbSeasonProvider.cs | 1 + MediaBrowser.Providers/TV/MovieDbSeriesProvider.cs | 1 + MediaBrowser.Providers/TV/SeasonMetadataService.cs | 1 + MediaBrowser.Providers/TV/SeriesMetadataService.cs | 1 + MediaBrowser.Providers/TV/SeriesPostScanTask.cs | 1 + .../TV/TvdbEpisodeImageProvider.cs | 1 + MediaBrowser.Providers/TV/TvdbEpisodeProvider.cs | 1 + MediaBrowser.Providers/TV/TvdbPrescanTask.cs | 1 + .../TV/TvdbSeasonImageProvider.cs | 1 + .../TV/TvdbSeriesImageProvider.cs | 1 + MediaBrowser.Providers/TV/TvdbSeriesProvider.cs | 1 + .../Users/UserMetadataService.cs | 1 + .../Videos/VideoMetadataService.cs | 1 + .../Years/YearMetadataService.cs | 1 + MediaBrowser.Providers/packages.config | 2 + .../Channels/ChannelManager.cs | 1 + .../Collections/CollectionImageProvider.cs | 1 + .../Collections/CollectionManager.cs | 1 + .../Collections/CollectionsDynamicFolder.cs | 1 + .../Configuration/ServerConfigurationManager.cs | 1 + .../Connect/ConnectEntryPoint.cs | 1 + .../Connect/ConnectManager.cs | 1 + .../Devices/CameraUploadsFolder.cs | 1 + .../Devices/DeviceManager.cs | 1 + .../Devices/DeviceRepository.cs | 1 + .../Dto/DtoService.cs | 1 + .../Notifications/RemoteNotifications.cs | 1 + .../FileOrganization/EpisodeFileOrganizer.cs | 1 + .../FileOrganization/FileOrganizationService.cs | 1 + .../FileOrganization/OrganizerScheduledTask.cs | 1 + .../FileOrganization/TvFolderOrganizer.cs | 1 + .../HttpServer/HttpResultFactory.cs | 1 + .../IO/LibraryMonitor.cs | 1 + .../Intros/DefaultIntroProvider.cs | 1 + .../Library/CoreResolutionIgnoreRule.cs | 1 + .../Library/LibraryManager.cs | 1 + .../Library/MediaSourceManager.cs | 1 + .../Library/ResolverHelper.cs | 1 + .../Library/Resolvers/Audio/MusicAlbumResolver.cs | 1 + .../Library/Resolvers/Audio/MusicArtistResolver.cs | 1 + .../Library/Resolvers/Movies/MovieResolver.cs | 1 + .../Library/Resolvers/SpecialFolderResolver.cs | 1 + .../Library/Resolvers/TV/SeriesResolver.cs | 1 + .../Library/UserManager.cs | 1 + .../Library/Validators/PeopleValidator.cs | 1 + .../LiveTv/EmbyTV/EmbyTV.cs | 1 + .../LiveTv/EmbyTV/ItemDataProvider.cs | 1 + .../LiveTv/EmbyTV/SeriesTimerManager.cs | 1 + .../LiveTv/EmbyTV/TimerManager.cs | 1 + .../LiveTv/LiveTvManager.cs | 1 + .../LiveTv/TunerHosts/M3UTunerHost.cs | 1 + .../Localization/LocalizationManager.cs | 1 + .../MediaBrowser.Server.Implementations.csproj | 4 + .../MediaEncoder/EncodingManager.cs | 1 + .../News/NewsEntryPoint.cs | 1 + .../Persistence/CleanDatabaseScheduledTask.cs | 1 + .../Photos/BaseDynamicImageProvider.cs | 1 + .../Photos/PhotoAlbumImageProvider.cs | 1 + .../Playlists/ManualPlaylistsFolder.cs | 1 + .../Playlists/PlaylistImageProvider.cs | 1 + .../Playlists/PlaylistManager.cs | 1 + .../ScheduledTasks/ChapterImagesTask.cs | 1 + .../ScheduledTasks/RefreshIntrosTask.cs | 1 + .../Sync/MediaSync.cs | 1 + .../Sync/MultiProviderSync.cs | 1 + .../Sync/ServerSyncScheduledTask.cs | 1 + .../Sync/SyncConvertScheduledTask.cs | 1 + .../Sync/SyncJobProcessor.cs | 1 + .../Sync/SyncManager.cs | 1 + .../Sync/TargetDataProvider.cs | 1 + .../UserViews/CollectionFolderImageProvider.cs | 1 + .../UserViews/DynamicImageProvider.cs | 1 + .../packages.config | 1 + .../MediaBrowser.Server.Mono.csproj | 7 + MediaBrowser.Server.Mono/Program.cs | 5 +- MediaBrowser.Server.Mono/packages.config | 2 + .../ApplicationHost.cs | 1 + .../FFMpeg/FFMpegDownloader.cs | 1 + .../FFMpeg/FFmpegValidator.cs | 1 + .../MbLinkShortcutHandler.cs | 53 ++ .../MediaBrowser.Server.Startup.Common.csproj | 8 + .../Migrations/DeleteDlnaProfiles.cs | 1 + .../Migrations/DeprecatePlugins.cs | 1 + .../Migrations/MigrateUserFolders.cs | 1 + MediaBrowser.Server.Startup.Common/packages.config | 2 + MediaBrowser.ServerApplication/MainStartup.cs | 5 +- .../MediaBrowser.ServerApplication.csproj | 8 +- MediaBrowser.ServerApplication/Native/Autorun.cs | 1 + .../Native/NativeFileSystem.cs | 419 --------------- .../Native/WindowsApp.cs | 1 + MediaBrowser.ServerApplication/packages.config | 2 + MediaBrowser.WebDashboard/Api/DashboardService.cs | 1 + MediaBrowser.WebDashboard/Api/PackageCreator.cs | 1 + .../MediaBrowser.WebDashboard.csproj | 7 + MediaBrowser.WebDashboard/packages.config | 2 + .../MediaBrowser.XbmcMetadata.csproj | 12 + .../Providers/AlbumNfoProvider.cs | 1 + .../Providers/ArtistNfoProvider.cs | 1 + .../Providers/BaseNfoProvider.cs | 1 + .../Providers/BaseVideoNfoProvider.cs | 1 + .../Providers/EpisodeNfoProvider.cs | 1 + .../Providers/MovieNfoProvider.cs | 3 +- .../Providers/SeasonNfoProvider.cs | 1 + .../Providers/SeriesNfoProvider.cs | 1 + MediaBrowser.XbmcMetadata/Savers/AlbumNfoSaver.cs | 1 + MediaBrowser.XbmcMetadata/Savers/ArtistNfoSaver.cs | 1 + MediaBrowser.XbmcMetadata/Savers/BaseNfoSaver.cs | 1 + .../Savers/EpisodeNfoSaver.cs | 1 + MediaBrowser.XbmcMetadata/Savers/MovieNfoSaver.cs | 1 + MediaBrowser.XbmcMetadata/Savers/SeasonNfoSaver.cs | 1 + MediaBrowser.XbmcMetadata/Savers/SeriesNfoSaver.cs | 1 + MediaBrowser.XbmcMetadata/packages.config | 5 + 286 files changed, 459 insertions(+), 1309 deletions(-) delete mode 100644 MediaBrowser.Common.Implementations/IO/CommonFileSystem.cs delete mode 100644 MediaBrowser.Common/IO/FileSystemMetadata.cs delete mode 100644 MediaBrowser.Common/IO/IFileSystem.cs create mode 100644 MediaBrowser.Dlna/packages.config create mode 100644 MediaBrowser.LocalMetadata/packages.config create mode 100644 MediaBrowser.Server.Startup.Common/MbLinkShortcutHandler.cs delete mode 100644 MediaBrowser.ServerApplication/Native/NativeFileSystem.cs create mode 100644 MediaBrowser.XbmcMetadata/packages.config (limited to 'MediaBrowser.Server.Implementations/HttpServer') diff --git a/Emby.Drawing/Common/ImageHeader.cs b/Emby.Drawing/Common/ImageHeader.cs index 59df5c04f..266dcdfb8 100644 --- a/Emby.Drawing/Common/ImageHeader.cs +++ b/Emby.Drawing/Common/ImageHeader.cs @@ -5,6 +5,7 @@ using System; using System.Collections.Generic; using System.IO; using System.Linq; +using CommonIO; namespace Emby.Drawing.Common { diff --git a/Emby.Drawing/Emby.Drawing.csproj b/Emby.Drawing/Emby.Drawing.csproj index 800756ee9..c93538d61 100644 --- a/Emby.Drawing/Emby.Drawing.csproj +++ b/Emby.Drawing/Emby.Drawing.csproj @@ -32,10 +32,17 @@ 4 + + False + ..\packages\CommonIO.1.0.0.3\lib\net45\CommonIO.dll + False ..\packages\ImageMagickSharp.1.0.0.16\lib\net45\ImageMagickSharp.dll + + ..\packages\Patterns.Logging.1.0.0.2\lib\portable-net45+sl4+wp71+win8+wpa81\Patterns.Logging.dll + ..\packages\taglib.2.1.0.0\lib\policy.2.0.taglib-sharp.dll diff --git a/Emby.Drawing/GDI/DynamicImageHelpers.cs b/Emby.Drawing/GDI/DynamicImageHelpers.cs index b4a63b31e..5cedf820d 100644 --- a/Emby.Drawing/GDI/DynamicImageHelpers.cs +++ b/Emby.Drawing/GDI/DynamicImageHelpers.cs @@ -4,6 +4,7 @@ using System.Drawing; using System.Drawing.Drawing2D; using System.Drawing.Imaging; using System.IO; +using CommonIO; namespace Emby.Drawing.GDI { diff --git a/Emby.Drawing/GDI/GDIImageEncoder.cs b/Emby.Drawing/GDI/GDIImageEncoder.cs index 1eabce74e..6d0998662 100644 --- a/Emby.Drawing/GDI/GDIImageEncoder.cs +++ b/Emby.Drawing/GDI/GDIImageEncoder.cs @@ -8,6 +8,7 @@ using System.Drawing.Drawing2D; using System.Drawing.Imaging; using System.IO; using System.Linq; +using CommonIO; using ImageFormat = MediaBrowser.Model.Drawing.ImageFormat; namespace Emby.Drawing.GDI diff --git a/Emby.Drawing/ImageMagick/ImageMagickEncoder.cs b/Emby.Drawing/ImageMagick/ImageMagickEncoder.cs index 2f8577acc..146ee2d3f 100644 --- a/Emby.Drawing/ImageMagick/ImageMagickEncoder.cs +++ b/Emby.Drawing/ImageMagick/ImageMagickEncoder.cs @@ -8,6 +8,7 @@ using MediaBrowser.Model.Logging; using System; using System.IO; using System.Linq; +using CommonIO; using MediaBrowser.Common.IO; namespace Emby.Drawing.ImageMagick diff --git a/Emby.Drawing/ImageMagick/PlayedIndicatorDrawer.cs b/Emby.Drawing/ImageMagick/PlayedIndicatorDrawer.cs index b5912788f..0870b3767 100644 --- a/Emby.Drawing/ImageMagick/PlayedIndicatorDrawer.cs +++ b/Emby.Drawing/ImageMagick/PlayedIndicatorDrawer.cs @@ -5,6 +5,7 @@ using MediaBrowser.Model.Drawing; using System; using System.IO; using System.Threading.Tasks; +using CommonIO; using MediaBrowser.Common.IO; namespace Emby.Drawing.ImageMagick diff --git a/Emby.Drawing/ImageMagick/StripCollageBuilder.cs b/Emby.Drawing/ImageMagick/StripCollageBuilder.cs index 92eb1cd59..b096a4999 100644 --- a/Emby.Drawing/ImageMagick/StripCollageBuilder.cs +++ b/Emby.Drawing/ImageMagick/StripCollageBuilder.cs @@ -2,6 +2,7 @@ using MediaBrowser.Common.Configuration; using System; using System.Collections.Generic; +using CommonIO; using MediaBrowser.Common.IO; namespace Emby.Drawing.ImageMagick diff --git a/Emby.Drawing/ImageMagick/UnplayedCountIndicator.cs b/Emby.Drawing/ImageMagick/UnplayedCountIndicator.cs index 92601313a..d3d9c1e7a 100644 --- a/Emby.Drawing/ImageMagick/UnplayedCountIndicator.cs +++ b/Emby.Drawing/ImageMagick/UnplayedCountIndicator.cs @@ -3,6 +3,7 @@ using MediaBrowser.Common.Configuration; using MediaBrowser.Common.IO; using MediaBrowser.Model.Drawing; using System.Globalization; +using CommonIO; namespace Emby.Drawing.ImageMagick { diff --git a/Emby.Drawing/ImageProcessor.cs b/Emby.Drawing/ImageProcessor.cs index 3e5dca9b7..4eecaaced 100644 --- a/Emby.Drawing/ImageProcessor.cs +++ b/Emby.Drawing/ImageProcessor.cs @@ -16,6 +16,7 @@ using System.IO; using System.Linq; using System.Threading; using System.Threading.Tasks; +using CommonIO; using Emby.Drawing.Common; namespace Emby.Drawing diff --git a/Emby.Drawing/packages.config b/Emby.Drawing/packages.config index acbd2ee3a..bf2f4ff74 100644 --- a/Emby.Drawing/packages.config +++ b/Emby.Drawing/packages.config @@ -1,4 +1,6 @@  + + \ No newline at end of file diff --git a/MediaBrowser.Api/ApiEntryPoint.cs b/MediaBrowser.Api/ApiEntryPoint.cs index 3faa6e63b..7f4db5a89 100644 --- a/MediaBrowser.Api/ApiEntryPoint.cs +++ b/MediaBrowser.Api/ApiEntryPoint.cs @@ -15,6 +15,7 @@ using System.IO; using System.Linq; using System.Threading; using System.Threading.Tasks; +using CommonIO; namespace MediaBrowser.Api { diff --git a/MediaBrowser.Api/ConfigurationService.cs b/MediaBrowser.Api/ConfigurationService.cs index f266180a4..f33a30892 100644 --- a/MediaBrowser.Api/ConfigurationService.cs +++ b/MediaBrowser.Api/ConfigurationService.cs @@ -11,6 +11,7 @@ using ServiceStack.Web; using System.Collections.Generic; using System.IO; using System.Linq; +using CommonIO; namespace MediaBrowser.Api { diff --git a/MediaBrowser.Api/EnvironmentService.cs b/MediaBrowser.Api/EnvironmentService.cs index 81b326da8..3a31fc1d2 100644 --- a/MediaBrowser.Api/EnvironmentService.cs +++ b/MediaBrowser.Api/EnvironmentService.cs @@ -9,6 +9,7 @@ using System.Collections.Generic; using System.Globalization; using System.IO; using System.Linq; +using CommonIO; namespace MediaBrowser.Api { diff --git a/MediaBrowser.Api/Images/ImageByNameService.cs b/MediaBrowser.Api/Images/ImageByNameService.cs index a6e1af516..1e0ca3438 100644 --- a/MediaBrowser.Api/Images/ImageByNameService.cs +++ b/MediaBrowser.Api/Images/ImageByNameService.cs @@ -9,6 +9,7 @@ using System; using System.Collections.Generic; using System.IO; using System.Linq; +using CommonIO; namespace MediaBrowser.Api.Images { diff --git a/MediaBrowser.Api/Images/ImageService.cs b/MediaBrowser.Api/Images/ImageService.cs index b8ea62137..d264b896d 100644 --- a/MediaBrowser.Api/Images/ImageService.cs +++ b/MediaBrowser.Api/Images/ImageService.cs @@ -17,6 +17,7 @@ using System.IO; using System.Linq; using System.Threading; using System.Threading.Tasks; +using CommonIO; using MimeTypes = MediaBrowser.Model.Net.MimeTypes; namespace MediaBrowser.Api.Images diff --git a/MediaBrowser.Api/Images/RemoteImageService.cs b/MediaBrowser.Api/Images/RemoteImageService.cs index c67ef96c9..9683632b2 100644 --- a/MediaBrowser.Api/Images/RemoteImageService.cs +++ b/MediaBrowser.Api/Images/RemoteImageService.cs @@ -16,6 +16,7 @@ using System.IO; using System.Linq; using System.Threading; using System.Threading.Tasks; +using CommonIO; namespace MediaBrowser.Api.Images { diff --git a/MediaBrowser.Api/ItemLookupService.cs b/MediaBrowser.Api/ItemLookupService.cs index 9f7f57155..f453036d7 100644 --- a/MediaBrowser.Api/ItemLookupService.cs +++ b/MediaBrowser.Api/ItemLookupService.cs @@ -16,6 +16,7 @@ using System.IO; using System.Linq; using System.Threading; using System.Threading.Tasks; +using CommonIO; namespace MediaBrowser.Api { diff --git a/MediaBrowser.Api/ItemRefreshService.cs b/MediaBrowser.Api/ItemRefreshService.cs index 1e74b3692..af1f1c90a 100644 --- a/MediaBrowser.Api/ItemRefreshService.cs +++ b/MediaBrowser.Api/ItemRefreshService.cs @@ -4,6 +4,7 @@ using MediaBrowser.Controller.Net; using MediaBrowser.Controller.Providers; using ServiceStack; using System.Threading; +using CommonIO; using MediaBrowser.Common.IO; namespace MediaBrowser.Api diff --git a/MediaBrowser.Api/Library/LibraryHelpers.cs b/MediaBrowser.Api/Library/LibraryHelpers.cs index 877321b77..c18c90b20 100644 --- a/MediaBrowser.Api/Library/LibraryHelpers.cs +++ b/MediaBrowser.Api/Library/LibraryHelpers.cs @@ -3,6 +3,7 @@ using MediaBrowser.Controller; using System; using System.IO; using System.Linq; +using CommonIO; namespace MediaBrowser.Api.Library { diff --git a/MediaBrowser.Api/Library/LibraryService.cs b/MediaBrowser.Api/Library/LibraryService.cs index 20fd1ef40..319bc13fd 100644 --- a/MediaBrowser.Api/Library/LibraryService.cs +++ b/MediaBrowser.Api/Library/LibraryService.cs @@ -27,6 +27,7 @@ using System.IO; using System.Linq; using System.Threading; using System.Threading.Tasks; +using CommonIO; using MediaBrowser.Common.IO; namespace MediaBrowser.Api.Library diff --git a/MediaBrowser.Api/Library/LibraryStructureService.cs b/MediaBrowser.Api/Library/LibraryStructureService.cs index c8731637c..42c6ef6e5 100644 --- a/MediaBrowser.Api/Library/LibraryStructureService.cs +++ b/MediaBrowser.Api/Library/LibraryStructureService.cs @@ -10,6 +10,7 @@ using System.IO; using System.Linq; using System.Threading; using System.Threading.Tasks; +using CommonIO; namespace MediaBrowser.Api.Library { diff --git a/MediaBrowser.Api/MediaBrowser.Api.csproj b/MediaBrowser.Api/MediaBrowser.Api.csproj index 901dd11e2..9e70fc5f3 100644 --- a/MediaBrowser.Api/MediaBrowser.Api.csproj +++ b/MediaBrowser.Api/MediaBrowser.Api.csproj @@ -46,6 +46,13 @@ Always + + False + ..\packages\CommonIO.1.0.0.3\lib\net45\CommonIO.dll + + + ..\packages\Patterns.Logging.1.0.0.2\lib\portable-net45+sl4+wp71+win8+wpa81\Patterns.Logging.dll + diff --git a/MediaBrowser.Api/Playback/BaseStreamingService.cs b/MediaBrowser.Api/Playback/BaseStreamingService.cs index 8e5061d62..4cf97d48b 100644 --- a/MediaBrowser.Api/Playback/BaseStreamingService.cs +++ b/MediaBrowser.Api/Playback/BaseStreamingService.cs @@ -23,6 +23,7 @@ using System.Linq; using System.Text; using System.Threading; using System.Threading.Tasks; +using CommonIO; namespace MediaBrowser.Api.Playback { diff --git a/MediaBrowser.Api/Playback/Dash/MpegDashService.cs b/MediaBrowser.Api/Playback/Dash/MpegDashService.cs index 5a36b0aa2..49d3db110 100644 --- a/MediaBrowser.Api/Playback/Dash/MpegDashService.cs +++ b/MediaBrowser.Api/Playback/Dash/MpegDashService.cs @@ -17,6 +17,7 @@ using System.IO; using System.Linq; using System.Threading; using System.Threading.Tasks; +using CommonIO; using MimeTypes = MediaBrowser.Model.Net.MimeTypes; namespace MediaBrowser.Api.Playback.Dash diff --git a/MediaBrowser.Api/Playback/Hls/BaseHlsService.cs b/MediaBrowser.Api/Playback/Hls/BaseHlsService.cs index a9a9610a9..60412159c 100644 --- a/MediaBrowser.Api/Playback/Hls/BaseHlsService.cs +++ b/MediaBrowser.Api/Playback/Hls/BaseHlsService.cs @@ -15,6 +15,7 @@ using System.IO; using System.Text; using System.Threading; using System.Threading.Tasks; +using CommonIO; namespace MediaBrowser.Api.Playback.Hls { diff --git a/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs b/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs index 39bdee699..6ca2677e7 100644 --- a/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs +++ b/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs @@ -20,6 +20,7 @@ using System.Linq; using System.Text; using System.Threading; using System.Threading.Tasks; +using CommonIO; using MimeTypes = MediaBrowser.Model.Net.MimeTypes; namespace MediaBrowser.Api.Playback.Hls diff --git a/MediaBrowser.Api/Playback/Hls/VideoHlsService.cs b/MediaBrowser.Api/Playback/Hls/VideoHlsService.cs index 2d1abf7e9..c5392b38f 100644 --- a/MediaBrowser.Api/Playback/Hls/VideoHlsService.cs +++ b/MediaBrowser.Api/Playback/Hls/VideoHlsService.cs @@ -8,6 +8,7 @@ using MediaBrowser.Model.IO; using MediaBrowser.Model.Serialization; using ServiceStack; using System; +using CommonIO; namespace MediaBrowser.Api.Playback.Hls { diff --git a/MediaBrowser.Api/Playback/Progressive/AudioService.cs b/MediaBrowser.Api/Playback/Progressive/AudioService.cs index 67a9cab58..ada4761c7 100644 --- a/MediaBrowser.Api/Playback/Progressive/AudioService.cs +++ b/MediaBrowser.Api/Playback/Progressive/AudioService.cs @@ -11,6 +11,7 @@ using MediaBrowser.Model.IO; using MediaBrowser.Model.Serialization; using ServiceStack; using System.Collections.Generic; +using CommonIO; namespace MediaBrowser.Api.Playback.Progressive { diff --git a/MediaBrowser.Api/Playback/Progressive/BaseProgressiveStreamingService.cs b/MediaBrowser.Api/Playback/Progressive/BaseProgressiveStreamingService.cs index aa0cda133..61c3e9aa8 100644 --- a/MediaBrowser.Api/Playback/Progressive/BaseProgressiveStreamingService.cs +++ b/MediaBrowser.Api/Playback/Progressive/BaseProgressiveStreamingService.cs @@ -17,6 +17,7 @@ using System.Globalization; using System.IO; using System.Threading; using System.Threading.Tasks; +using CommonIO; namespace MediaBrowser.Api.Playback.Progressive { diff --git a/MediaBrowser.Api/Playback/Progressive/ProgressiveStreamWriter.cs b/MediaBrowser.Api/Playback/Progressive/ProgressiveStreamWriter.cs index adedd9461..2719b1faf 100644 --- a/MediaBrowser.Api/Playback/Progressive/ProgressiveStreamWriter.cs +++ b/MediaBrowser.Api/Playback/Progressive/ProgressiveStreamWriter.cs @@ -5,6 +5,7 @@ using System; using System.Collections.Generic; using System.IO; using System.Threading.Tasks; +using CommonIO; namespace MediaBrowser.Api.Playback.Progressive { diff --git a/MediaBrowser.Api/Playback/Progressive/VideoService.cs b/MediaBrowser.Api/Playback/Progressive/VideoService.cs index 1dfb43387..d79040dd4 100644 --- a/MediaBrowser.Api/Playback/Progressive/VideoService.cs +++ b/MediaBrowser.Api/Playback/Progressive/VideoService.cs @@ -11,6 +11,7 @@ using MediaBrowser.Model.Serialization; using ServiceStack; using System; using System.IO; +using CommonIO; namespace MediaBrowser.Api.Playback.Progressive { diff --git a/MediaBrowser.Api/Subtitles/SubtitleService.cs b/MediaBrowser.Api/Subtitles/SubtitleService.cs index 0bfe7354d..37034751d 100644 --- a/MediaBrowser.Api/Subtitles/SubtitleService.cs +++ b/MediaBrowser.Api/Subtitles/SubtitleService.cs @@ -15,6 +15,7 @@ using System.Linq; using System.Text; using System.Threading; using System.Threading.Tasks; +using CommonIO; using MimeTypes = MediaBrowser.Model.Net.MimeTypes; using MediaBrowser.Common.IO; diff --git a/MediaBrowser.Api/System/SystemService.cs b/MediaBrowser.Api/System/SystemService.cs index 4ad8b3903..a95fcb542 100644 --- a/MediaBrowser.Api/System/SystemService.cs +++ b/MediaBrowser.Api/System/SystemService.cs @@ -12,6 +12,7 @@ using System.Collections.Generic; using System.IO; using System.Linq; using System.Threading.Tasks; +using CommonIO; namespace MediaBrowser.Api.System { diff --git a/MediaBrowser.Api/VideosService.cs b/MediaBrowser.Api/VideosService.cs index a65bee7ef..0cffbb42c 100644 --- a/MediaBrowser.Api/VideosService.cs +++ b/MediaBrowser.Api/VideosService.cs @@ -11,6 +11,7 @@ using System; using System.Linq; using System.Threading; using System.Threading.Tasks; +using CommonIO; namespace MediaBrowser.Api { diff --git a/MediaBrowser.Api/packages.config b/MediaBrowser.Api/packages.config index 0cdb26bd5..307021704 100644 --- a/MediaBrowser.Api/packages.config +++ b/MediaBrowser.Api/packages.config @@ -1,4 +1,6 @@  + + \ No newline at end of file diff --git a/MediaBrowser.Common.Implementations/Archiving/ZipClient.cs b/MediaBrowser.Common.Implementations/Archiving/ZipClient.cs index 1377e9d55..0009c7193 100644 --- a/MediaBrowser.Common.Implementations/Archiving/ZipClient.cs +++ b/MediaBrowser.Common.Implementations/Archiving/ZipClient.cs @@ -7,6 +7,7 @@ using SharpCompress.Reader; using SharpCompress.Reader.Zip; using System; using System.IO; +using CommonIO; using MediaBrowser.Common.IO; namespace MediaBrowser.Common.Implementations.Archiving diff --git a/MediaBrowser.Common.Implementations/BaseApplicationHost.cs b/MediaBrowser.Common.Implementations/BaseApplicationHost.cs index af41635f3..97c856035 100644 --- a/MediaBrowser.Common.Implementations/BaseApplicationHost.cs +++ b/MediaBrowser.Common.Implementations/BaseApplicationHost.cs @@ -30,6 +30,7 @@ using System.Reflection; using System.Text; using System.Threading; using System.Threading.Tasks; +using CommonIO; namespace MediaBrowser.Common.Implementations { diff --git a/MediaBrowser.Common.Implementations/Devices/DeviceId.cs b/MediaBrowser.Common.Implementations/Devices/DeviceId.cs index 39f11fabf..4cad3cd31 100644 --- a/MediaBrowser.Common.Implementations/Devices/DeviceId.cs +++ b/MediaBrowser.Common.Implementations/Devices/DeviceId.cs @@ -3,6 +3,7 @@ using MediaBrowser.Model.Logging; using System; using System.IO; using System.Text; +using CommonIO; using MediaBrowser.Common.IO; namespace MediaBrowser.Common.Implementations.Devices diff --git a/MediaBrowser.Common.Implementations/HttpClientManager/HttpClientManager.cs b/MediaBrowser.Common.Implementations/HttpClientManager/HttpClientManager.cs index 7157f6325..48d674432 100644 --- a/MediaBrowser.Common.Implementations/HttpClientManager/HttpClientManager.cs +++ b/MediaBrowser.Common.Implementations/HttpClientManager/HttpClientManager.cs @@ -17,6 +17,7 @@ using System.Net.Cache; using System.Text; using System.Threading; using System.Threading.Tasks; +using CommonIO; namespace MediaBrowser.Common.Implementations.HttpClientManager { diff --git a/MediaBrowser.Common.Implementations/IO/CommonFileSystem.cs b/MediaBrowser.Common.Implementations/IO/CommonFileSystem.cs deleted file mode 100644 index f13b9b1a9..000000000 --- a/MediaBrowser.Common.Implementations/IO/CommonFileSystem.cs +++ /dev/null @@ -1,559 +0,0 @@ -using MediaBrowser.Model.Extensions; -using MediaBrowser.Common.IO; -using MediaBrowser.Model.Logging; -using System; -using System.IO; -using System.Text; -using System.Collections.Generic; -using System.Linq; - -namespace MediaBrowser.Common.Implementations.IO -{ - /// - /// Class CommonFileSystem - /// - public class CommonFileSystem : IFileSystem - { - protected ILogger Logger; - - private readonly bool _supportsAsyncFileStreams; - private char[] _invalidFileNameChars; - - public CommonFileSystem(ILogger logger, bool supportsAsyncFileStreams, bool usePresetInvalidFileNameChars) - { - Logger = logger; - _supportsAsyncFileStreams = supportsAsyncFileStreams; - - SetInvalidFileNameChars(usePresetInvalidFileNameChars); - } - - protected void SetInvalidFileNameChars(bool usePresetInvalidFileNameChars) - { - // GetInvalidFileNameChars is less restrictive in Linux/Mac than Windows, this mimic Windows behavior for mono under Linux/Mac. - - if (usePresetInvalidFileNameChars) - { - _invalidFileNameChars = new char[41] { '\x00', '\x01', '\x02', '\x03', '\x04', '\x05', '\x06', '\x07', - '\x08', '\x09', '\x0A', '\x0B', '\x0C', '\x0D', '\x0E', '\x0F', '\x10', '\x11', '\x12', - '\x13', '\x14', '\x15', '\x16', '\x17', '\x18', '\x19', '\x1A', '\x1B', '\x1C', '\x1D', - '\x1E', '\x1F', '\x22', '\x3C', '\x3E', '\x7C', ':', '*', '?', '\\', '/' }; - } - else - { - _invalidFileNameChars = Path.GetInvalidFileNameChars(); - } - } - - /// - /// Determines whether the specified filename is shortcut. - /// - /// The filename. - /// true if the specified filename is shortcut; otherwise, false. - /// filename - public virtual bool IsShortcut(string filename) - { - if (string.IsNullOrEmpty(filename)) - { - throw new ArgumentNullException("filename"); - } - - var extension = Path.GetExtension(filename); - - return string.Equals(extension, ".mblink", StringComparison.OrdinalIgnoreCase); - } - - /// - /// Resolves the shortcut. - /// - /// The filename. - /// System.String. - /// filename - public virtual string ResolveShortcut(string filename) - { - if (string.IsNullOrEmpty(filename)) - { - throw new ArgumentNullException("filename"); - } - - if (string.Equals(Path.GetExtension(filename), ".mblink", StringComparison.OrdinalIgnoreCase)) - { - var path = ReadAllText(filename); - - return NormalizePath(path); - } - - return null; - } - - /// - /// Creates the shortcut. - /// - /// The shortcut path. - /// The target. - /// - /// shortcutPath - /// or - /// target - /// - public void CreateShortcut(string shortcutPath, string target) - { - if (string.IsNullOrEmpty(shortcutPath)) - { - throw new ArgumentNullException("shortcutPath"); - } - - if (string.IsNullOrEmpty(target)) - { - throw new ArgumentNullException("target"); - } - - File.WriteAllText(shortcutPath, target); - } - - /// - /// Gets the file system info. - /// - /// The path. - /// FileSystemInfo. - public FileSystemMetadata GetFileSystemInfo(string path) - { - if (string.IsNullOrEmpty(path)) - { - throw new ArgumentNullException("path"); - } - - // Take a guess to try and avoid two file system hits, but we'll double-check by calling Exists - if (Path.HasExtension(path)) - { - var fileInfo = new FileInfo(path); - - if (fileInfo.Exists) - { - return GetFileSystemMetadata(fileInfo); - } - - return GetFileSystemMetadata(new DirectoryInfo(path)); - } - else - { - var fileInfo = new DirectoryInfo(path); - - if (fileInfo.Exists) - { - return GetFileSystemMetadata(fileInfo); - } - - return GetFileSystemMetadata(new FileInfo(path)); - } - } - - public FileSystemMetadata GetFileInfo(string path) - { - if (string.IsNullOrEmpty(path)) - { - throw new ArgumentNullException("path"); - } - - var fileInfo = new FileInfo(path); - - return GetFileSystemMetadata(fileInfo); - } - - public FileSystemMetadata GetDirectoryInfo(string path) - { - if (string.IsNullOrEmpty(path)) - { - throw new ArgumentNullException("path"); - } - - var fileInfo = new DirectoryInfo(path); - - return GetFileSystemMetadata(fileInfo); - } - - private FileSystemMetadata GetFileSystemMetadata(FileSystemInfo info) - { - var result = new FileSystemMetadata(); - - result.Attributes = info.Attributes; - result.Exists = info.Exists; - result.FullName = info.FullName; - result.Extension = info.Extension; - result.Name = info.Name; - - if (result.Exists) - { - var fileInfo = info as FileInfo; - if (fileInfo != null) - { - result.Length = fileInfo.Length; - result.DirectoryName = fileInfo.DirectoryName; - } - - result.CreationTimeUtc = GetCreationTimeUtc(info); - result.LastWriteTimeUtc = GetLastWriteTimeUtc(info); - } - - return result; - } - - /// - /// The space char - /// - private const char SpaceChar = ' '; - - /// - /// Takes a filename and removes invalid characters - /// - /// The filename. - /// System.String. - /// filename - public string GetValidFilename(string filename) - { - if (string.IsNullOrEmpty(filename)) - { - throw new ArgumentNullException("filename"); - } - - var builder = new StringBuilder(filename); - - foreach (var c in _invalidFileNameChars) - { - builder = builder.Replace(c, SpaceChar); - } - - return builder.ToString(); - } - - /// - /// Gets the creation time UTC. - /// - /// The info. - /// DateTime. - public DateTime GetCreationTimeUtc(FileSystemInfo info) - { - // This could throw an error on some file systems that have dates out of range - try - { - return info.CreationTimeUtc; - } - catch (Exception ex) - { - Logger.ErrorException("Error determining CreationTimeUtc for {0}", ex, info.FullName); - return DateTime.MinValue; - } - } - - /// - /// Gets the creation time UTC. - /// - /// The path. - /// DateTime. - public DateTime GetCreationTimeUtc(string path) - { - return GetCreationTimeUtc(GetFileSystemInfo(path)); - } - - public DateTime GetCreationTimeUtc(FileSystemMetadata info) - { - return info.CreationTimeUtc; - } - - public DateTime GetLastWriteTimeUtc(FileSystemMetadata info) - { - return info.LastWriteTimeUtc; - } - - /// - /// Gets the creation time UTC. - /// - /// The info. - /// DateTime. - public DateTime GetLastWriteTimeUtc(FileSystemInfo info) - { - // This could throw an error on some file systems that have dates out of range - try - { - return info.LastWriteTimeUtc; - } - catch (Exception ex) - { - Logger.ErrorException("Error determining LastAccessTimeUtc for {0}", ex, info.FullName); - return DateTime.MinValue; - } - } - - /// - /// Gets the last write time UTC. - /// - /// The path. - /// DateTime. - public DateTime GetLastWriteTimeUtc(string path) - { - return GetLastWriteTimeUtc(GetFileSystemInfo(path)); - } - - /// - /// Gets the file stream. - /// - /// The path. - /// The mode. - /// The access. - /// The share. - /// if set to true [is asynchronous]. - /// FileStream. - public Stream GetFileStream(string path, FileMode mode, FileAccess access, FileShare share, bool isAsync = false) - { - if (_supportsAsyncFileStreams && isAsync) - { - return new FileStream(path, mode, access, share, StreamDefaults.DefaultFileStreamBufferSize, true); - } - - return new FileStream(path, mode, access, share, StreamDefaults.DefaultFileStreamBufferSize); - } - - /// - /// Swaps the files. - /// - /// The file1. - /// The file2. - public void SwapFiles(string file1, string file2) - { - if (string.IsNullOrEmpty(file1)) - { - throw new ArgumentNullException("file1"); - } - - if (string.IsNullOrEmpty(file2)) - { - throw new ArgumentNullException("file2"); - } - - var temp1 = Path.GetTempFileName(); - var temp2 = Path.GetTempFileName(); - - // Copying over will fail against hidden files - RemoveHiddenAttribute(file1); - RemoveHiddenAttribute(file2); - - CopyFile(file1, temp1, true); - CopyFile(file2, temp2, true); - - CopyFile(temp1, file2, true); - CopyFile(temp2, file1, true); - - DeleteFile(temp1); - DeleteFile(temp2); - } - - /// - /// Removes the hidden attribute. - /// - /// The path. - private void RemoveHiddenAttribute(string path) - { - if (string.IsNullOrEmpty(path)) - { - throw new ArgumentNullException("path"); - } - - var currentFile = new FileInfo(path); - - // This will fail if the file is hidden - if (currentFile.Exists) - { - if ((currentFile.Attributes & FileAttributes.Hidden) == FileAttributes.Hidden) - { - currentFile.Attributes &= ~FileAttributes.Hidden; - } - } - } - - public bool ContainsSubPath(string parentPath, string path) - { - if (string.IsNullOrEmpty(parentPath)) - { - throw new ArgumentNullException("parentPath"); - } - - if (string.IsNullOrEmpty(path)) - { - throw new ArgumentNullException("path"); - } - - return path.IndexOf(parentPath.TrimEnd(Path.DirectorySeparatorChar) + Path.DirectorySeparatorChar, StringComparison.OrdinalIgnoreCase) != -1; - } - - public bool IsRootPath(string path) - { - if (string.IsNullOrEmpty(path)) - { - throw new ArgumentNullException("path"); - } - - var parent = Path.GetDirectoryName(path); - - if (!string.IsNullOrEmpty(parent)) - { - return false; - } - - return true; - } - - public string NormalizePath(string path) - { - if (string.IsNullOrEmpty(path)) - { - throw new ArgumentNullException("path"); - } - - if (path.EndsWith(":\\", StringComparison.OrdinalIgnoreCase)) - { - return path; - } - - return path.TrimEnd(Path.DirectorySeparatorChar); - } - - public string GetFileNameWithoutExtension(FileSystemMetadata info) - { - if (info.IsDirectory) - { - return info.Name; - } - - return Path.GetFileNameWithoutExtension(info.FullName); - } - - public string GetFileNameWithoutExtension(string path) - { - return Path.GetFileNameWithoutExtension(path); - } - - public bool IsPathFile(string path) - { - if (string.IsNullOrWhiteSpace(path)) - { - throw new ArgumentNullException("path"); - } - - // Cannot use Path.IsPathRooted because it returns false under mono when using windows-based paths, e.g. C:\\ - - if (path.IndexOf("://", StringComparison.OrdinalIgnoreCase) != -1 && - !path.StartsWith("file://", StringComparison.OrdinalIgnoreCase)) - { - return false; - } - return true; - - //return Path.IsPathRooted(path); - } - - public void DeleteFile(string path) - { - File.Delete(path); - } - - public void DeleteDirectory(string path, bool recursive) - { - Directory.Delete(path, recursive); - } - - public void CreateDirectory(string path) - { - Directory.CreateDirectory(path); - } - - public IEnumerable GetDirectories(string path, bool recursive = false) - { - var searchOption = recursive ? SearchOption.AllDirectories : SearchOption.TopDirectoryOnly; - - return new DirectoryInfo(path).EnumerateDirectories("*", searchOption).Select(GetFileSystemMetadata); - } - - public IEnumerable GetFiles(string path, bool recursive = false) - { - var searchOption = recursive ? SearchOption.AllDirectories : SearchOption.TopDirectoryOnly; - - return new DirectoryInfo (path).EnumerateFiles("*", searchOption).Select(GetFileSystemMetadata); - } - - public IEnumerable GetFileSystemEntries(string path, bool recursive = false) - { - var directoryInfo = new DirectoryInfo (path); - var searchOption = recursive ? SearchOption.AllDirectories : SearchOption.TopDirectoryOnly; - - return directoryInfo.EnumerateDirectories("*", searchOption).Select(GetFileSystemMetadata) - .Concat(directoryInfo.EnumerateFiles("*", searchOption).Select(GetFileSystemMetadata)); - } - - public Stream OpenRead(string path) - { - return File.OpenRead(path); - } - - public void CopyFile(string source, string target, bool overwrite) - { - File.Copy(source, target, overwrite); - } - - public void MoveFile(string source, string target) - { - File.Move(source, target); - } - - public void MoveDirectory(string source, string target) - { - Directory.Move(source, target); - } - - public bool DirectoryExists(string path) - { - return Directory.Exists(path); - } - - public bool FileExists(string path) - { - return File.Exists(path); - } - - public string ReadAllText(string path) - { - return File.ReadAllText(path); - } - - public void WriteAllText(string path, string text, Encoding encoding) - { - File.WriteAllText(path, text, encoding); - } - - public void WriteAllText(string path, string text) - { - File.WriteAllText(path, text); - } - - public string ReadAllText(string path, Encoding encoding) - { - return File.ReadAllText(path, encoding); - } - - public IEnumerable GetDirectoryPaths(string path, bool recursive = false) - { - var searchOption = recursive ? SearchOption.AllDirectories : SearchOption.TopDirectoryOnly; - return Directory.EnumerateDirectories(path, "*", searchOption); - } - - public IEnumerable GetFilePaths(string path, bool recursive = false) - { - var searchOption = recursive ? SearchOption.AllDirectories : SearchOption.TopDirectoryOnly; - return Directory.EnumerateFiles(path, "*", searchOption); - } - - public IEnumerable GetFileSystemEntryPaths(string path, bool recursive = false) - { - var searchOption = recursive ? SearchOption.AllDirectories : SearchOption.TopDirectoryOnly; - return Directory.EnumerateFileSystemEntries(path, "*", searchOption); - } - } -} diff --git a/MediaBrowser.Common.Implementations/MediaBrowser.Common.Implementations.csproj b/MediaBrowser.Common.Implementations/MediaBrowser.Common.Implementations.csproj index eb1122902..a195415d0 100644 --- a/MediaBrowser.Common.Implementations/MediaBrowser.Common.Implementations.csproj +++ b/MediaBrowser.Common.Implementations/MediaBrowser.Common.Implementations.csproj @@ -48,10 +48,17 @@ Always + + False + ..\packages\CommonIO.1.0.0.3\lib\net45\CommonIO.dll + False ..\packages\NLog.4.1.1\lib\net45\NLog.dll + + ..\packages\Patterns.Logging.1.0.0.2\lib\portable-net45+sl4+wp71+win8+wpa81\Patterns.Logging.dll + False ..\ThirdParty\SharpCompress\SharpCompress.dll @@ -81,7 +88,6 @@ - diff --git a/MediaBrowser.Common.Implementations/ScheduledTasks/ScheduledTaskWorker.cs b/MediaBrowser.Common.Implementations/ScheduledTasks/ScheduledTaskWorker.cs index 906184c75..f2b235bd9 100644 --- a/MediaBrowser.Common.Implementations/ScheduledTasks/ScheduledTaskWorker.cs +++ b/MediaBrowser.Common.Implementations/ScheduledTasks/ScheduledTaskWorker.cs @@ -12,6 +12,7 @@ using System.IO; using System.Linq; using System.Threading; using System.Threading.Tasks; +using CommonIO; using MediaBrowser.Common.IO; namespace MediaBrowser.Common.Implementations.ScheduledTasks diff --git a/MediaBrowser.Common.Implementations/ScheduledTasks/TaskManager.cs b/MediaBrowser.Common.Implementations/ScheduledTasks/TaskManager.cs index 9419bdf22..6c72441aa 100644 --- a/MediaBrowser.Common.Implementations/ScheduledTasks/TaskManager.cs +++ b/MediaBrowser.Common.Implementations/ScheduledTasks/TaskManager.cs @@ -10,6 +10,7 @@ using System.Collections.Concurrent; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; +using CommonIO; using MediaBrowser.Common.IO; namespace MediaBrowser.Common.Implementations.ScheduledTasks diff --git a/MediaBrowser.Common.Implementations/ScheduledTasks/Tasks/DeleteCacheFileTask.cs b/MediaBrowser.Common.Implementations/ScheduledTasks/Tasks/DeleteCacheFileTask.cs index ec48bb5dc..0e50f9315 100644 --- a/MediaBrowser.Common.Implementations/ScheduledTasks/Tasks/DeleteCacheFileTask.cs +++ b/MediaBrowser.Common.Implementations/ScheduledTasks/Tasks/DeleteCacheFileTask.cs @@ -8,6 +8,7 @@ using System.IO; using System.Linq; using System.Threading; using System.Threading.Tasks; +using CommonIO; namespace MediaBrowser.Common.Implementations.ScheduledTasks.Tasks { diff --git a/MediaBrowser.Common.Implementations/ScheduledTasks/Tasks/DeleteLogFileTask.cs b/MediaBrowser.Common.Implementations/ScheduledTasks/Tasks/DeleteLogFileTask.cs index ffba3d9da..8507d3184 100644 --- a/MediaBrowser.Common.Implementations/ScheduledTasks/Tasks/DeleteLogFileTask.cs +++ b/MediaBrowser.Common.Implementations/ScheduledTasks/Tasks/DeleteLogFileTask.cs @@ -7,6 +7,7 @@ using System.IO; using System.Linq; using System.Threading; using System.Threading.Tasks; +using CommonIO; namespace MediaBrowser.Common.Implementations.ScheduledTasks.Tasks { diff --git a/MediaBrowser.Common.Implementations/Serialization/JsonSerializer.cs b/MediaBrowser.Common.Implementations/Serialization/JsonSerializer.cs index a758a0c1e..269294b36 100644 --- a/MediaBrowser.Common.Implementations/Serialization/JsonSerializer.cs +++ b/MediaBrowser.Common.Implementations/Serialization/JsonSerializer.cs @@ -2,6 +2,7 @@ using MediaBrowser.Model.Serialization; using System; using System.IO; +using CommonIO; namespace MediaBrowser.Common.Implementations.Serialization { diff --git a/MediaBrowser.Common.Implementations/Serialization/XmlSerializer.cs b/MediaBrowser.Common.Implementations/Serialization/XmlSerializer.cs index 41a59fb2b..449c23b2d 100644 --- a/MediaBrowser.Common.Implementations/Serialization/XmlSerializer.cs +++ b/MediaBrowser.Common.Implementations/Serialization/XmlSerializer.cs @@ -3,6 +3,7 @@ using System; using System.Collections.Concurrent; using System.IO; using System.Xml; +using CommonIO; using MediaBrowser.Common.IO; namespace MediaBrowser.Common.Implementations.Serialization diff --git a/MediaBrowser.Common.Implementations/Updates/InstallationManager.cs b/MediaBrowser.Common.Implementations/Updates/InstallationManager.cs index 12afdd8d7..dc642a0a8 100644 --- a/MediaBrowser.Common.Implementations/Updates/InstallationManager.cs +++ b/MediaBrowser.Common.Implementations/Updates/InstallationManager.cs @@ -19,6 +19,7 @@ using System.Linq; using System.Security.Cryptography; using System.Threading; using System.Threading.Tasks; +using CommonIO; namespace MediaBrowser.Common.Implementations.Updates { diff --git a/MediaBrowser.Common.Implementations/packages.config b/MediaBrowser.Common.Implementations/packages.config index 151a3a36d..eb48d9d67 100644 --- a/MediaBrowser.Common.Implementations/packages.config +++ b/MediaBrowser.Common.Implementations/packages.config @@ -1,5 +1,7 @@  + + diff --git a/MediaBrowser.Common/IO/FileSystemMetadata.cs b/MediaBrowser.Common/IO/FileSystemMetadata.cs deleted file mode 100644 index ba8a1b8b8..000000000 --- a/MediaBrowser.Common/IO/FileSystemMetadata.cs +++ /dev/null @@ -1,32 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace MediaBrowser.Common.IO -{ - public class FileSystemMetadata - { - public FileAttributes Attributes { get; set; } - - public bool Exists { get; set; } - public string FullName { get; set; } - public string Name { get; set; } - public string Extension { get; set; } - public long Length { get; set; } - public string DirectoryName { get; set; } - - public DateTime LastWriteTimeUtc { get; set; } - public DateTime CreationTimeUtc { get; set; } - - public bool IsDirectory - { - get - { - return (Attributes & FileAttributes.Directory) == FileAttributes.Directory; - } - } - } -} diff --git a/MediaBrowser.Common/IO/IFileSystem.cs b/MediaBrowser.Common/IO/IFileSystem.cs deleted file mode 100644 index e084f94ed..000000000 --- a/MediaBrowser.Common/IO/IFileSystem.cs +++ /dev/null @@ -1,291 +0,0 @@ -using System; -using System.IO; -using System.Collections.Generic; -using System.Text; - -namespace MediaBrowser.Common.IO -{ - /// - /// Interface IFileSystem - /// - public interface IFileSystem - { - /// - /// Determines whether the specified filename is shortcut. - /// - /// The filename. - /// true if the specified filename is shortcut; otherwise, false. - bool IsShortcut(string filename); - - /// - /// Resolves the shortcut. - /// - /// The filename. - /// System.String. - string ResolveShortcut(string filename); - - /// - /// Creates the shortcut. - /// - /// The shortcut path. - /// The target. - void CreateShortcut(string shortcutPath, string target); - - /// - /// Gets the file system info. - /// - /// The path. - /// FileSystemInfo. - FileSystemMetadata GetFileSystemInfo(string path); - - /// - /// Gets the file information. - /// - /// The path. - /// FileSystemMetadata. - FileSystemMetadata GetFileInfo(string path); - - /// - /// Gets the directory information. - /// - /// The path. - /// FileSystemMetadata. - FileSystemMetadata GetDirectoryInfo(string path); - - /// - /// Gets the valid filename. - /// - /// The filename. - /// System.String. - string GetValidFilename(string filename); - - /// - /// Gets the creation time UTC. - /// - /// The information. - /// DateTime. - DateTime GetCreationTimeUtc(FileSystemMetadata info); - - /// - /// Gets the creation time UTC. - /// - /// The path. - /// DateTime. - DateTime GetCreationTimeUtc(string path); - - /// - /// Gets the last write time UTC. - /// - /// The information. - /// DateTime. - DateTime GetLastWriteTimeUtc(FileSystemMetadata info); - - /// - /// Gets the last write time UTC. - /// - /// The path. - /// DateTime. - DateTime GetLastWriteTimeUtc(string path); - - /// - /// Gets the file stream. - /// - /// The path. - /// The mode. - /// The access. - /// The share. - /// if set to true [is asynchronous]. - /// FileStream. - Stream GetFileStream(string path, FileMode mode, FileAccess access, FileShare share, bool isAsync = false); - - /// - /// Opens the read. - /// - /// The path. - /// Stream. - Stream OpenRead(String path); - - /// - /// Swaps the files. - /// - /// The file1. - /// The file2. - void SwapFiles(string file1, string file2); - - /// - /// Determines whether [contains sub path] [the specified parent path]. - /// - /// The parent path. - /// The path. - /// true if [contains sub path] [the specified parent path]; otherwise, false. - bool ContainsSubPath(string parentPath, string path); - - /// - /// Determines whether [is root path] [the specified path]. - /// - /// The path. - /// true if [is root path] [the specified path]; otherwise, false. - bool IsRootPath(string path); - - /// - /// Normalizes the path. - /// - /// The path. - /// System.String. - string NormalizePath(string path); - - /// - /// Gets the file name without extension. - /// - /// The information. - /// System.String. - string GetFileNameWithoutExtension(FileSystemMetadata info); - - /// - /// Gets the file name without extension. - /// - /// The path. - /// System.String. - string GetFileNameWithoutExtension(string path); - - /// - /// Determines whether [is path file] [the specified path]. - /// - /// The path. - /// true if [is path file] [the specified path]; otherwise, false. - bool IsPathFile(string path); - - /// - /// Deletes the file. - /// - /// The path. - void DeleteFile(string path); - - /// - /// Deletes the directory. - /// - /// The path. - /// if set to true [recursive]. - void DeleteDirectory(string path, bool recursive); - - /// - /// Gets the directories. - /// - /// The path. - /// if set to true [recursive]. - /// IEnumerable<DirectoryInfo>. - IEnumerable GetDirectories(string path, bool recursive = false); - - /// - /// Gets the files. - /// - /// The path. - /// if set to true [recursive]. - /// IEnumerable<FileInfo>. - IEnumerable GetFiles(string path, bool recursive = false); - - /// - /// Gets the file system entries. - /// - /// The path. - /// if set to true [recursive]. - /// IEnumerable<FileSystemMetadata>. - IEnumerable GetFileSystemEntries(string path, bool recursive = false); - - /// - /// Creates the directory. - /// - /// The path. - void CreateDirectory(string path); - - /// - /// Copies the file. - /// - /// The source. - /// The target. - /// if set to true [overwrite]. - void CopyFile(string source, string target, bool overwrite); - - /// - /// Moves the file. - /// - /// The source. - /// The target. - void MoveFile(string source, string target); - - /// - /// Moves the directory. - /// - /// The source. - /// The target. - void MoveDirectory(string source, string target); - - /// - /// Directories the exists. - /// - /// The path. - /// true if XXXX, false otherwise. - bool DirectoryExists(string path); - - /// - /// Files the exists. - /// - /// The path. - /// true if XXXX, false otherwise. - bool FileExists(string path); - - /// - /// Reads all text. - /// - /// The path. - /// System.String. - string ReadAllText(string path); - - /// - /// Writes all text. - /// - /// The path. - /// The text. - void WriteAllText(string path, string text); - - /// - /// Writes all text. - /// - /// The path. - /// The text. - /// The encoding. - void WriteAllText(string path, string text, Encoding encoding); - - /// - /// Reads all text. - /// - /// The path. - /// The encoding. - /// System.String. - string ReadAllText(string path, Encoding encoding); - - /// - /// Gets the directory paths. - /// - /// The path. - /// if set to true [recursive]. - /// IEnumerable<System.String>. - IEnumerable GetDirectoryPaths(string path, bool recursive = false); - - /// - /// Gets the file paths. - /// - /// The path. - /// if set to true [recursive]. - /// IEnumerable<System.String>. - IEnumerable GetFilePaths(string path, bool recursive = false); - - /// - /// Gets the file system entry paths. - /// - /// The path. - /// if set to true [recursive]. - /// IEnumerable<System.String>. - IEnumerable GetFileSystemEntryPaths(string path, bool recursive = false); - } -} diff --git a/MediaBrowser.Common/MediaBrowser.Common.csproj b/MediaBrowser.Common/MediaBrowser.Common.csproj index 0476f3f60..b2f62dd21 100644 --- a/MediaBrowser.Common/MediaBrowser.Common.csproj +++ b/MediaBrowser.Common/MediaBrowser.Common.csproj @@ -60,8 +60,6 @@ - - diff --git a/MediaBrowser.Controller/Entities/AggregateFolder.cs b/MediaBrowser.Controller/Entities/AggregateFolder.cs index 5af02e9bb..14f8c1617 100644 --- a/MediaBrowser.Controller/Entities/AggregateFolder.cs +++ b/MediaBrowser.Controller/Entities/AggregateFolder.cs @@ -6,6 +6,7 @@ using System.Collections.Generic; using System.IO; using System.Linq; using System.Runtime.Serialization; +using CommonIO; using MediaBrowser.Common.IO; using MediaBrowser.Controller.Providers; diff --git a/MediaBrowser.Controller/Entities/BaseItem.cs b/MediaBrowser.Controller/Entities/BaseItem.cs index 963f4725a..796ba70ba 100644 --- a/MediaBrowser.Controller/Entities/BaseItem.cs +++ b/MediaBrowser.Controller/Entities/BaseItem.cs @@ -23,6 +23,7 @@ using System.Linq; using System.Runtime.Serialization; using System.Threading; using System.Threading.Tasks; +using CommonIO; namespace MediaBrowser.Controller.Entities { diff --git a/MediaBrowser.Controller/Entities/CollectionFolder.cs b/MediaBrowser.Controller/Entities/CollectionFolder.cs index b299929d0..946d95a0b 100644 --- a/MediaBrowser.Controller/Entities/CollectionFolder.cs +++ b/MediaBrowser.Controller/Entities/CollectionFolder.cs @@ -8,6 +8,7 @@ using System.Linq; using System.Runtime.Serialization; using System.Threading; using System.Threading.Tasks; +using CommonIO; using MediaBrowser.Common.IO; namespace MediaBrowser.Controller.Entities diff --git a/MediaBrowser.Controller/Entities/Folder.cs b/MediaBrowser.Controller/Entities/Folder.cs index 422c83d3b..c3f767c0d 100644 --- a/MediaBrowser.Controller/Entities/Folder.cs +++ b/MediaBrowser.Controller/Entities/Folder.cs @@ -13,6 +13,7 @@ using System.Linq; using System.Runtime.Serialization; using System.Threading; using System.Threading.Tasks; +using CommonIO; using MediaBrowser.Common.IO; namespace MediaBrowser.Controller.Entities diff --git a/MediaBrowser.Controller/Entities/IHasImages.cs b/MediaBrowser.Controller/Entities/IHasImages.cs index 55c5f7e11..ef478c516 100644 --- a/MediaBrowser.Controller/Entities/IHasImages.cs +++ b/MediaBrowser.Controller/Entities/IHasImages.cs @@ -3,6 +3,7 @@ using MediaBrowser.Model.Entities; using System.Collections.Generic; using System.IO; using System.Threading.Tasks; +using CommonIO; using MediaBrowser.Common.IO; namespace MediaBrowser.Controller.Entities diff --git a/MediaBrowser.Controller/Entities/Movies/Movie.cs b/MediaBrowser.Controller/Entities/Movies/Movie.cs index 8910fdbdd..1a8148edf 100644 --- a/MediaBrowser.Controller/Entities/Movies/Movie.cs +++ b/MediaBrowser.Controller/Entities/Movies/Movie.cs @@ -8,6 +8,7 @@ using System.IO; using System.Linq; using System.Threading; using System.Threading.Tasks; +using CommonIO; using MediaBrowser.Common.IO; namespace MediaBrowser.Controller.Entities.Movies diff --git a/MediaBrowser.Controller/Entities/Video.cs b/MediaBrowser.Controller/Entities/Video.cs index 5f5743b1d..45c497fcf 100644 --- a/MediaBrowser.Controller/Entities/Video.cs +++ b/MediaBrowser.Controller/Entities/Video.cs @@ -11,6 +11,7 @@ using System.Linq; using System.Runtime.Serialization; using System.Threading; using System.Threading.Tasks; +using CommonIO; using MediaBrowser.Common.IO; namespace MediaBrowser.Controller.Entities diff --git a/MediaBrowser.Controller/IO/FileData.cs b/MediaBrowser.Controller/IO/FileData.cs index 503727e14..20dfc425e 100644 --- a/MediaBrowser.Controller/IO/FileData.cs +++ b/MediaBrowser.Controller/IO/FileData.cs @@ -5,6 +5,7 @@ using MediaBrowser.Model.Logging; using System; using System.Collections.Generic; using System.IO; +using CommonIO; namespace MediaBrowser.Controller.IO { diff --git a/MediaBrowser.Controller/Library/ILibraryManager.cs b/MediaBrowser.Controller/Library/ILibraryManager.cs index 93f291aae..843fba0d0 100644 --- a/MediaBrowser.Controller/Library/ILibraryManager.cs +++ b/MediaBrowser.Controller/Library/ILibraryManager.cs @@ -11,6 +11,7 @@ using System.Collections.Generic; using System.IO; using System.Threading; using System.Threading.Tasks; +using CommonIO; using MediaBrowser.Common.IO; namespace MediaBrowser.Controller.Library diff --git a/MediaBrowser.Controller/Library/ItemResolveArgs.cs b/MediaBrowser.Controller/Library/ItemResolveArgs.cs index 653436691..90158942f 100644 --- a/MediaBrowser.Controller/Library/ItemResolveArgs.cs +++ b/MediaBrowser.Controller/Library/ItemResolveArgs.cs @@ -4,6 +4,7 @@ using System; using System.Collections.Generic; using System.IO; using System.Linq; +using CommonIO; using MediaBrowser.Common.IO; namespace MediaBrowser.Controller.Library diff --git a/MediaBrowser.Controller/MediaBrowser.Controller.csproj b/MediaBrowser.Controller/MediaBrowser.Controller.csproj index b20f15544..946ea34d4 100644 --- a/MediaBrowser.Controller/MediaBrowser.Controller.csproj +++ b/MediaBrowser.Controller/MediaBrowser.Controller.csproj @@ -45,9 +45,16 @@ 4 + + False + ..\packages\CommonIO.1.0.0.3\lib\net45\CommonIO.dll + ..\packages\Interfaces.IO.1.0.0.5\lib\portable-net45+sl4+wp71+win8+wpa81\Interfaces.IO.dll + + ..\packages\Patterns.Logging.1.0.0.2\lib\portable-net45+sl4+wp71+win8+wpa81\Patterns.Logging.dll + diff --git a/MediaBrowser.Controller/MediaEncoding/MediaEncoderHelpers.cs b/MediaBrowser.Controller/MediaEncoding/MediaEncoderHelpers.cs index 6b7bddcfa..7985ec054 100644 --- a/MediaBrowser.Controller/MediaEncoding/MediaEncoderHelpers.cs +++ b/MediaBrowser.Controller/MediaEncoding/MediaEncoderHelpers.cs @@ -4,6 +4,7 @@ using System; using System.Collections.Generic; using System.IO; using System.Linq; +using CommonIO; using MediaBrowser.Common.IO; namespace MediaBrowser.Controller.MediaEncoding diff --git a/MediaBrowser.Controller/Providers/DirectoryService.cs b/MediaBrowser.Controller/Providers/DirectoryService.cs index 6890b7a7c..cf1c3d286 100644 --- a/MediaBrowser.Controller/Providers/DirectoryService.cs +++ b/MediaBrowser.Controller/Providers/DirectoryService.cs @@ -4,6 +4,7 @@ using System.Collections.Concurrent; using System.Collections.Generic; using System.IO; using System.Linq; +using CommonIO; using MediaBrowser.Common.IO; namespace MediaBrowser.Controller.Providers diff --git a/MediaBrowser.Controller/Providers/IDirectoryService.cs b/MediaBrowser.Controller/Providers/IDirectoryService.cs index 06507d5d2..062a10901 100644 --- a/MediaBrowser.Controller/Providers/IDirectoryService.cs +++ b/MediaBrowser.Controller/Providers/IDirectoryService.cs @@ -1,5 +1,6 @@ using System.Collections.Generic; using System.IO; +using CommonIO; using MediaBrowser.Common.IO; namespace MediaBrowser.Controller.Providers diff --git a/MediaBrowser.Controller/Providers/LocalImageInfo.cs b/MediaBrowser.Controller/Providers/LocalImageInfo.cs index 3b51a96f0..51916268f 100644 --- a/MediaBrowser.Controller/Providers/LocalImageInfo.cs +++ b/MediaBrowser.Controller/Providers/LocalImageInfo.cs @@ -1,4 +1,5 @@ using System.IO; +using CommonIO; using MediaBrowser.Common.IO; using MediaBrowser.Model.Entities; diff --git a/MediaBrowser.Controller/Providers/MetadataRefreshOptions.cs b/MediaBrowser.Controller/Providers/MetadataRefreshOptions.cs index 097c613cb..6f217eea2 100644 --- a/MediaBrowser.Controller/Providers/MetadataRefreshOptions.cs +++ b/MediaBrowser.Controller/Providers/MetadataRefreshOptions.cs @@ -1,4 +1,5 @@ using System.Linq; +using CommonIO; using MediaBrowser.Common.IO; namespace MediaBrowser.Controller.Providers diff --git a/MediaBrowser.Controller/Resolvers/IItemResolver.cs b/MediaBrowser.Controller/Resolvers/IItemResolver.cs index 660a6a87a..f747c055e 100644 --- a/MediaBrowser.Controller/Resolvers/IItemResolver.cs +++ b/MediaBrowser.Controller/Resolvers/IItemResolver.cs @@ -3,6 +3,7 @@ using MediaBrowser.Controller.Library; using MediaBrowser.Controller.Providers; using System.Collections.Generic; using System.IO; +using CommonIO; using MediaBrowser.Common.IO; namespace MediaBrowser.Controller.Resolvers diff --git a/MediaBrowser.Controller/packages.config b/MediaBrowser.Controller/packages.config index c320ed9d9..c03c15de8 100644 --- a/MediaBrowser.Controller/packages.config +++ b/MediaBrowser.Controller/packages.config @@ -1,5 +1,7 @@  + + \ No newline at end of file diff --git a/MediaBrowser.Dlna/DlnaManager.cs b/MediaBrowser.Dlna/DlnaManager.cs index 0fd3cec89..be49c0f89 100644 --- a/MediaBrowser.Dlna/DlnaManager.cs +++ b/MediaBrowser.Dlna/DlnaManager.cs @@ -17,6 +17,7 @@ using System.IO; using System.Linq; using System.Text; using System.Text.RegularExpressions; +using CommonIO; namespace MediaBrowser.Dlna { diff --git a/MediaBrowser.Dlna/MediaBrowser.Dlna.csproj b/MediaBrowser.Dlna/MediaBrowser.Dlna.csproj index c49cbc654..325df86d1 100644 --- a/MediaBrowser.Dlna/MediaBrowser.Dlna.csproj +++ b/MediaBrowser.Dlna/MediaBrowser.Dlna.csproj @@ -13,6 +13,8 @@ 10.0.0 2.0 v4.5 + ..\ + true true @@ -39,6 +41,13 @@ 4 + + False + ..\packages\CommonIO.1.0.0.3\lib\net45\CommonIO.dll + + + ..\packages\Patterns.Logging.1.0.0.2\lib\portable-net45+sl4+wp71+win8+wpa81\Patterns.Logging.dll + @@ -230,6 +239,9 @@ Designer + + +