mirror of
				https://github.com/jellyfin/jellyfin.git
				synced 2025-11-04 03:27:21 -05:00 
			
		
		
		
	3.0.5306.42925
This commit is contained in:
		
							parent
							
								
									8b630e2d41
								
							
						
					
					
						commit
						baf44b2718
					
				@ -122,42 +122,44 @@ namespace MediaBrowser.Api
 | 
				
			|||||||
            return ToOptimizedResult(result);
 | 
					            return ToOptimizedResult(result);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        const string XbmcMetadata = "Xbmc Nfo";
 | 
				
			||||||
 | 
					        const string MediaBrowserMetadata = "Media Browser Xml";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        public void Post(AutoSetMetadataOptions request)
 | 
					        public void Post(AutoSetMetadataOptions request)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            var service = AutoDetectMetadataService();
 | 
					            var service = AutoDetectMetadataService();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            Logger.Info("Setting preferred metadata format to " + service);
 | 
					            Logger.Info("Setting preferred metadata format to " + service);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            _configurationManager.SetPreferredMetadataService(service);
 | 
					            var serviceToDisable = string.Equals(service, XbmcMetadata) ?
 | 
				
			||||||
 | 
					                MediaBrowserMetadata :
 | 
				
			||||||
 | 
					                XbmcMetadata;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            _configurationManager.DisableMetadataService(serviceToDisable);
 | 
				
			||||||
            _configurationManager.SaveConfiguration();
 | 
					            _configurationManager.SaveConfiguration();
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        private string AutoDetectMetadataService()
 | 
					        private string AutoDetectMetadataService()
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            const string xbmc = "Xbmc Nfo";
 | 
					 | 
				
			||||||
            const string mb = "Media Browser Xml";
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            var paths = _libraryManager.GetDefaultVirtualFolders()
 | 
					            var paths = _libraryManager.GetDefaultVirtualFolders()
 | 
				
			||||||
                .SelectMany(i => i.Locations)
 | 
					                .SelectMany(i => i.Locations)
 | 
				
			||||||
                .Distinct(StringComparer.OrdinalIgnoreCase)
 | 
					                .Distinct(StringComparer.OrdinalIgnoreCase)
 | 
				
			||||||
                .Select(i => new DirectoryInfo(i))
 | 
					                .Select(i => new DirectoryInfo(i))
 | 
				
			||||||
                .ToList();
 | 
					                .ToList();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            if (paths.Select(i => i.EnumerateFiles("*.xml", SearchOption.AllDirectories))
 | 
					            if (paths.SelectMany(i => i.EnumerateFiles("*.xml", SearchOption.AllDirectories))
 | 
				
			||||||
                .SelectMany(i => i)
 | 
					 | 
				
			||||||
                .Any())
 | 
					                .Any())
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                return xbmc;
 | 
					                return XbmcMetadata;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            if (paths.Select(i => i.EnumerateFiles("*.xml", SearchOption.AllDirectories))
 | 
					            if (paths.SelectMany(i => i.EnumerateFiles("*.xml", SearchOption.AllDirectories))
 | 
				
			||||||
                .SelectMany(i => i)
 | 
					 | 
				
			||||||
                .Any(i => string.Equals(i.Name, "series.xml", StringComparison.OrdinalIgnoreCase) || string.Equals(i.Name, "movie.xml", StringComparison.OrdinalIgnoreCase)))
 | 
					                .Any(i => string.Equals(i.Name, "series.xml", StringComparison.OrdinalIgnoreCase) || string.Equals(i.Name, "movie.xml", StringComparison.OrdinalIgnoreCase)))
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                return mb;
 | 
					                return MediaBrowserMetadata;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            
 | 
					            
 | 
				
			||||||
            return xbmc;
 | 
					            return XbmcMetadata;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        /// <summary>
 | 
					        /// <summary>
 | 
				
			||||||
 | 
				
			|||||||
@ -65,6 +65,11 @@ namespace MediaBrowser.Api
 | 
				
			|||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        private DateTime NormalizeDateTime(DateTime val)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            return DateTime.SpecifyKind(val, DateTimeKind.Utc);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        private void UpdateItem(BaseItemDto request, BaseItem item)
 | 
					        private void UpdateItem(BaseItemDto request, BaseItem item)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            item.Name = request.Name;
 | 
					            item.Name = request.Name;
 | 
				
			||||||
@ -140,11 +145,11 @@ namespace MediaBrowser.Api
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
            if (request.DateCreated.HasValue)
 | 
					            if (request.DateCreated.HasValue)
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                item.DateCreated = request.DateCreated.Value.ToUniversalTime();
 | 
					                item.DateCreated = NormalizeDateTime(request.DateCreated.Value);
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            item.EndDate = request.EndDate.HasValue ? request.EndDate.Value.ToUniversalTime() : (DateTime?)null;
 | 
					            item.EndDate = request.EndDate.HasValue ? NormalizeDateTime(request.EndDate.Value) : (DateTime?)null;
 | 
				
			||||||
            item.PremiereDate = request.PremiereDate.HasValue ? request.PremiereDate.Value.ToUniversalTime() : (DateTime?)null;
 | 
					            item.PremiereDate = request.PremiereDate.HasValue ? NormalizeDateTime(request.PremiereDate.Value) : (DateTime?)null;
 | 
				
			||||||
            item.ProductionYear = request.ProductionYear;
 | 
					            item.ProductionYear = request.ProductionYear;
 | 
				
			||||||
            item.OfficialRating = request.OfficialRating;
 | 
					            item.OfficialRating = request.OfficialRating;
 | 
				
			||||||
            item.CustomRating = request.CustomRating;
 | 
					            item.CustomRating = request.CustomRating;
 | 
				
			||||||
 | 
				
			|||||||
@ -1,4 +1,5 @@
 | 
				
			|||||||
using MediaBrowser.Common.Extensions;
 | 
					using MediaBrowser.Common.Extensions;
 | 
				
			||||||
 | 
					using MediaBrowser.Common.Net;
 | 
				
			||||||
using MediaBrowser.Controller.Configuration;
 | 
					using MediaBrowser.Controller.Configuration;
 | 
				
			||||||
using MediaBrowser.Controller.Dto;
 | 
					using MediaBrowser.Controller.Dto;
 | 
				
			||||||
using MediaBrowser.Controller.Library;
 | 
					using MediaBrowser.Controller.Library;
 | 
				
			||||||
@ -11,6 +12,7 @@ using ServiceStack.Text.Controller;
 | 
				
			|||||||
using System;
 | 
					using System;
 | 
				
			||||||
using System.Collections.Generic;
 | 
					using System.Collections.Generic;
 | 
				
			||||||
using System.Linq;
 | 
					using System.Linq;
 | 
				
			||||||
 | 
					using System.Net;
 | 
				
			||||||
using System.Threading.Tasks;
 | 
					using System.Threading.Tasks;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace MediaBrowser.Api
 | 
					namespace MediaBrowser.Api
 | 
				
			||||||
@ -168,6 +170,7 @@ namespace MediaBrowser.Api
 | 
				
			|||||||
        private readonly IDtoService _dtoService;
 | 
					        private readonly IDtoService _dtoService;
 | 
				
			||||||
        private readonly ISessionManager _sessionMananger;
 | 
					        private readonly ISessionManager _sessionMananger;
 | 
				
			||||||
        private readonly IServerConfigurationManager _config;
 | 
					        private readonly IServerConfigurationManager _config;
 | 
				
			||||||
 | 
					        private readonly INetworkManager _networkManager;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        public IAuthorizationContext AuthorizationContext { get; set; }
 | 
					        public IAuthorizationContext AuthorizationContext { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -178,12 +181,13 @@ namespace MediaBrowser.Api
 | 
				
			|||||||
        /// <param name="dtoService">The dto service.</param>
 | 
					        /// <param name="dtoService">The dto service.</param>
 | 
				
			||||||
        /// <param name="sessionMananger">The session mananger.</param>
 | 
					        /// <param name="sessionMananger">The session mananger.</param>
 | 
				
			||||||
        /// <exception cref="System.ArgumentNullException">xmlSerializer</exception>
 | 
					        /// <exception cref="System.ArgumentNullException">xmlSerializer</exception>
 | 
				
			||||||
        public UserService(IUserManager userManager, IDtoService dtoService, ISessionManager sessionMananger, IServerConfigurationManager config)
 | 
					        public UserService(IUserManager userManager, IDtoService dtoService, ISessionManager sessionMananger, IServerConfigurationManager config, INetworkManager networkManager)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            _userManager = userManager;
 | 
					            _userManager = userManager;
 | 
				
			||||||
            _dtoService = dtoService;
 | 
					            _dtoService = dtoService;
 | 
				
			||||||
            _sessionMananger = sessionMananger;
 | 
					            _sessionMananger = sessionMananger;
 | 
				
			||||||
            _config = config;
 | 
					            _config = config;
 | 
				
			||||||
 | 
					            _networkManager = networkManager;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        public object Get(GetPublicUsers request)
 | 
					        public object Get(GetPublicUsers request)
 | 
				
			||||||
@ -200,18 +204,65 @@ namespace MediaBrowser.Api
 | 
				
			|||||||
                });
 | 
					                });
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            // TODO: Add or is authenticated
 | 
					            // TODO: Uncomment this once all clients can handle an empty user list.
 | 
				
			||||||
            if (_sessionMananger.IsInLocalNetwork(Request.RemoteIp))
 | 
					 | 
				
			||||||
            {
 | 
					 | 
				
			||||||
            return Get(new GetUsers
 | 
					            return Get(new GetUsers
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                IsHidden = false,
 | 
					                IsHidden = false,
 | 
				
			||||||
                IsDisabled = false
 | 
					                IsDisabled = false
 | 
				
			||||||
            });
 | 
					            });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            //// TODO: Add or is authenticated
 | 
				
			||||||
 | 
					            //if (Request.IsLocal || IsInLocalNetwork(Request.RemoteIp))
 | 
				
			||||||
 | 
					            //{
 | 
				
			||||||
 | 
					            //    return Get(new GetUsers
 | 
				
			||||||
 | 
					            //    {
 | 
				
			||||||
 | 
					            //        IsHidden = false,
 | 
				
			||||||
 | 
					            //        IsDisabled = false
 | 
				
			||||||
 | 
					            //    });
 | 
				
			||||||
 | 
					            //}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            //// Return empty when external
 | 
				
			||||||
 | 
					            //return ToOptimizedResult(new List<UserDto>());
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            // Return empty when external
 | 
					        private bool IsInLocalNetwork(string remoteEndpoint)
 | 
				
			||||||
            return ToOptimizedResult(new List<UserDto>());
 | 
					        {
 | 
				
			||||||
 | 
					            if (string.IsNullOrWhiteSpace(remoteEndpoint))
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                throw new ArgumentNullException("remoteEndpoint");
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            IPAddress address;
 | 
				
			||||||
 | 
					            if (!IPAddress.TryParse(remoteEndpoint, out address))
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                return true;
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            const int lengthMatch = 4;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            if (remoteEndpoint.Length >= lengthMatch)
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                var prefix = remoteEndpoint.Substring(0, lengthMatch);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                if (_networkManager.GetLocalIpAddresses()
 | 
				
			||||||
 | 
					                    .Any(i => i.StartsWith(prefix, StringComparison.OrdinalIgnoreCase)))
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    return true;
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            // Private address space:
 | 
				
			||||||
 | 
					            // http://en.wikipedia.org/wiki/Private_network
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            return
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                // If url was requested with computer name, we may see this
 | 
				
			||||||
 | 
					                remoteEndpoint.IndexOf("::", StringComparison.OrdinalIgnoreCase) != -1 ||
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                remoteEndpoint.StartsWith("10.", StringComparison.OrdinalIgnoreCase) ||
 | 
				
			||||||
 | 
					                remoteEndpoint.StartsWith("192.", StringComparison.OrdinalIgnoreCase) ||
 | 
				
			||||||
 | 
					                remoteEndpoint.StartsWith("172.", StringComparison.OrdinalIgnoreCase) ||
 | 
				
			||||||
 | 
					                remoteEndpoint.StartsWith("169.", StringComparison.OrdinalIgnoreCase);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        /// <summary>
 | 
					        /// <summary>
 | 
				
			||||||
@ -307,7 +358,7 @@ namespace MediaBrowser.Api
 | 
				
			|||||||
            var auth = AuthorizationContext.GetAuthorizationInfo(Request);
 | 
					            var auth = AuthorizationContext.GetAuthorizationInfo(Request);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            var result = _sessionMananger.AuthenticateNewSession(request.Username, request.Password, auth.Client, auth.Version,
 | 
					            var result = _sessionMananger.AuthenticateNewSession(request.Username, request.Password, auth.Client, auth.Version,
 | 
				
			||||||
                        auth.DeviceId, auth.Device, Request.RemoteIp).Result;
 | 
					                        auth.DeviceId, auth.Device, Request.RemoteIp, Request.IsLocal).Result;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            return ToOptimizedResult(result);
 | 
					            return ToOptimizedResult(result);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
				
			|||||||
@ -177,10 +177,20 @@ namespace MediaBrowser.Common.Implementations.Updates
 | 
				
			|||||||
        {
 | 
					        {
 | 
				
			||||||
            if (_lastPackageListResult != null)
 | 
					            if (_lastPackageListResult != null)
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                // Let dev users get results more often for testing purposes
 | 
					                TimeSpan cacheLength;
 | 
				
			||||||
                var cacheLength = _config.CommonConfiguration.SystemUpdateLevel == PackageVersionClass.Dev
 | 
					
 | 
				
			||||||
                                      ? TimeSpan.FromMinutes(3)
 | 
					                switch (_config.CommonConfiguration.SystemUpdateLevel)
 | 
				
			||||||
                                      : TimeSpan.FromHours(6);
 | 
					                {
 | 
				
			||||||
 | 
					                    case PackageVersionClass.Beta:
 | 
				
			||||||
 | 
					                        cacheLength = TimeSpan.FromMinutes(30);
 | 
				
			||||||
 | 
					                        break;
 | 
				
			||||||
 | 
					                    case PackageVersionClass.Dev:
 | 
				
			||||||
 | 
					                        cacheLength = TimeSpan.FromMinutes(3);
 | 
				
			||||||
 | 
					                        break;
 | 
				
			||||||
 | 
					                    default:
 | 
				
			||||||
 | 
					                        cacheLength = TimeSpan.FromHours(6);
 | 
				
			||||||
 | 
					                        break;
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                if ((DateTime.UtcNow - _lastPackageListResult.Item2) < cacheLength)
 | 
					                if ((DateTime.UtcNow - _lastPackageListResult.Item2) < cacheLength)
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
 | 
				
			|||||||
@ -31,6 +31,6 @@ namespace MediaBrowser.Controller.Configuration
 | 
				
			|||||||
        /// Sets the preferred metadata service.
 | 
					        /// Sets the preferred metadata service.
 | 
				
			||||||
        /// </summary>
 | 
					        /// </summary>
 | 
				
			||||||
        /// <param name="service">The service.</param>
 | 
					        /// <param name="service">The service.</param>
 | 
				
			||||||
        void SetPreferredMetadataService(string service);
 | 
					        void DisableMetadataService(string service);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
@ -14,6 +14,21 @@ namespace MediaBrowser.Controller.Resolvers
 | 
				
			|||||||
    /// </summary>
 | 
					    /// </summary>
 | 
				
			||||||
    public static class EntityResolutionHelper
 | 
					    public static class EntityResolutionHelper
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// Any folder named in this list will be ignored - can be added to at runtime for extensibility
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        public static readonly List<string> IgnoreFolders = new List<string>
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					                "metadata",
 | 
				
			||||||
 | 
					                "ps3_update",
 | 
				
			||||||
 | 
					                "ps3_vprm",
 | 
				
			||||||
 | 
					                "extrafanart",
 | 
				
			||||||
 | 
					                "extrathumbs",
 | 
				
			||||||
 | 
					                ".actors",
 | 
				
			||||||
 | 
					                ".wd_tv"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        /// <summary>
 | 
					        /// <summary>
 | 
				
			||||||
        /// Any extension in this list is considered a video file - can be added to at runtime for extensibility
 | 
					        /// Any extension in this list is considered a video file - can be added to at runtime for extensibility
 | 
				
			||||||
        /// </summary>
 | 
					        /// </summary>
 | 
				
			||||||
 | 
				
			|||||||
@ -218,6 +218,7 @@ namespace MediaBrowser.Controller.Session
 | 
				
			|||||||
        /// <param name="deviceId">The device identifier.</param>
 | 
					        /// <param name="deviceId">The device identifier.</param>
 | 
				
			||||||
        /// <param name="deviceName">Name of the device.</param>
 | 
					        /// <param name="deviceName">Name of the device.</param>
 | 
				
			||||||
        /// <param name="remoteEndPoint">The remote end point.</param>
 | 
					        /// <param name="remoteEndPoint">The remote end point.</param>
 | 
				
			||||||
 | 
					        /// <param name="isLocal">if set to <c>true</c> [is local].</param>
 | 
				
			||||||
        /// <returns>Task{SessionInfo}.</returns>
 | 
					        /// <returns>Task{SessionInfo}.</returns>
 | 
				
			||||||
        Task<AuthenticationResult> AuthenticateNewSession(string username, 
 | 
					        Task<AuthenticationResult> AuthenticateNewSession(string username, 
 | 
				
			||||||
            string password, 
 | 
					            string password, 
 | 
				
			||||||
@ -225,7 +226,8 @@ namespace MediaBrowser.Controller.Session
 | 
				
			|||||||
            string appVersion, 
 | 
					            string appVersion, 
 | 
				
			||||||
            string deviceId, 
 | 
					            string deviceId, 
 | 
				
			||||||
            string deviceName, 
 | 
					            string deviceName, 
 | 
				
			||||||
            string remoteEndPoint);
 | 
					            string remoteEndPoint,
 | 
				
			||||||
 | 
					            bool isLocal);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        /// <summary>
 | 
					        /// <summary>
 | 
				
			||||||
        /// Reports the capabilities.
 | 
					        /// Reports the capabilities.
 | 
				
			||||||
@ -282,12 +284,5 @@ namespace MediaBrowser.Controller.Session
 | 
				
			|||||||
        /// <param name="id">The identifier.</param>
 | 
					        /// <param name="id">The identifier.</param>
 | 
				
			||||||
        /// <returns>Task.</returns>
 | 
					        /// <returns>Task.</returns>
 | 
				
			||||||
        Task RevokeToken(string id);
 | 
					        Task RevokeToken(string id);
 | 
				
			||||||
        
 | 
					 | 
				
			||||||
        /// <summary>
 | 
					 | 
				
			||||||
        /// Determines whether the specified remote endpoint is local.
 | 
					 | 
				
			||||||
        /// </summary>
 | 
					 | 
				
			||||||
        /// <param name="remoteEndpoint">The remote endpoint.</param>
 | 
					 | 
				
			||||||
        /// <returns><c>true</c> if the specified remote endpoint is local; otherwise, <c>false</c>.</returns>
 | 
					 | 
				
			||||||
        bool IsInLocalNetwork(string remoteEndpoint);
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@ -57,14 +57,30 @@
 | 
				
			|||||||
  </PropertyGroup>
 | 
					  </PropertyGroup>
 | 
				
			||||||
  <ItemGroup>
 | 
					  <ItemGroup>
 | 
				
			||||||
    <!-- A reference to the entire .NET Framework is automatically included -->
 | 
					    <!-- A reference to the entire .NET Framework is automatically included -->
 | 
				
			||||||
 | 
					    <None Include="app.config" />
 | 
				
			||||||
    <None Include="Fody.targets" />
 | 
					    <None Include="Fody.targets" />
 | 
				
			||||||
    <None Include="packages.config" />
 | 
					    <None Include="packages.config" />
 | 
				
			||||||
  </ItemGroup>
 | 
					  </ItemGroup>
 | 
				
			||||||
  <ItemGroup>
 | 
					  <ItemGroup>
 | 
				
			||||||
 | 
					    <Reference Include="Microsoft.Threading.Tasks">
 | 
				
			||||||
 | 
					      <HintPath>..\packages\Microsoft.Bcl.Async.1.0.168\lib\portable-net40+sl4+win8+wp71+wpa81\Microsoft.Threading.Tasks.dll</HintPath>
 | 
				
			||||||
 | 
					    </Reference>
 | 
				
			||||||
 | 
					    <Reference Include="Microsoft.Threading.Tasks.Extensions">
 | 
				
			||||||
 | 
					      <HintPath>..\packages\Microsoft.Bcl.Async.1.0.168\lib\portable-net40+sl4+win8+wp71+wpa81\Microsoft.Threading.Tasks.Extensions.dll</HintPath>
 | 
				
			||||||
 | 
					    </Reference>
 | 
				
			||||||
    <Reference Include="PropertyChanged">
 | 
					    <Reference Include="PropertyChanged">
 | 
				
			||||||
      <HintPath>..\packages\PropertyChanged.Fody.1.41.0.0\Lib\portable-net4+sl4+wp7+win8+MonoAndroid16+MonoTouch40\PropertyChanged.dll</HintPath>
 | 
					      <HintPath>..\packages\PropertyChanged.Fody.1.41.0.0\Lib\portable-net4+sl4+wp7+win8+MonoAndroid16+MonoTouch40\PropertyChanged.dll</HintPath>
 | 
				
			||||||
      <Private>False</Private>
 | 
					      <Private>False</Private>
 | 
				
			||||||
    </Reference>
 | 
					    </Reference>
 | 
				
			||||||
 | 
					    <Reference Include="System.IO">
 | 
				
			||||||
 | 
					      <HintPath>..\packages\Microsoft.Bcl.1.1.8\lib\portable-net40+sl5+win8+wp8+wpa81\System.IO.dll</HintPath>
 | 
				
			||||||
 | 
					    </Reference>
 | 
				
			||||||
 | 
					    <Reference Include="System.Runtime">
 | 
				
			||||||
 | 
					      <HintPath>..\packages\Microsoft.Bcl.1.1.8\lib\portable-net40+sl5+win8+wp8+wpa81\System.Runtime.dll</HintPath>
 | 
				
			||||||
 | 
					    </Reference>
 | 
				
			||||||
 | 
					    <Reference Include="System.Threading.Tasks">
 | 
				
			||||||
 | 
					      <HintPath>..\packages\Microsoft.Bcl.1.1.8\lib\portable-net40+sl5+win8+wp8+wpa81\System.Threading.Tasks.dll</HintPath>
 | 
				
			||||||
 | 
					    </Reference>
 | 
				
			||||||
  </ItemGroup>
 | 
					  </ItemGroup>
 | 
				
			||||||
  <ItemGroup>
 | 
					  <ItemGroup>
 | 
				
			||||||
    <Compile Include="..\MediaBrowser.Model\ApiClient\ApiClientExtensions.cs">
 | 
					    <Compile Include="..\MediaBrowser.Model\ApiClient\ApiClientExtensions.cs">
 | 
				
			||||||
@ -914,6 +930,11 @@ xcopy "$(TargetPath)" "$(SolutionDir)\Nuget\dlls\portable\" /y /d /r /i
 | 
				
			|||||||
  </PropertyGroup>
 | 
					  </PropertyGroup>
 | 
				
			||||||
  <Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
 | 
					  <Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
 | 
				
			||||||
  <Import Project="Fody.targets" />
 | 
					  <Import Project="Fody.targets" />
 | 
				
			||||||
 | 
					  <Import Project="..\packages\Microsoft.Bcl.Build.1.0.14\tools\Microsoft.Bcl.Build.targets" Condition="Exists('..\packages\Microsoft.Bcl.Build.1.0.14\tools\Microsoft.Bcl.Build.targets')" />
 | 
				
			||||||
 | 
					  <Target Name="EnsureBclBuildImported" BeforeTargets="BeforeBuild" Condition="'$(BclBuildImported)' == ''">
 | 
				
			||||||
 | 
					    <Error Condition="!Exists('..\packages\Microsoft.Bcl.Build.1.0.14\tools\Microsoft.Bcl.Build.targets')" Text="This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them.  For more information, see http://go.microsoft.com/fwlink/?LinkID=317567." HelpKeyword="BCLBUILD2001" />
 | 
				
			||||||
 | 
					    <Error Condition="Exists('..\packages\Microsoft.Bcl.Build.1.0.14\tools\Microsoft.Bcl.Build.targets')" Text="The build restored NuGet packages. Build the project again to include these packages in the build. For more information, see http://go.microsoft.com/fwlink/?LinkID=317568." HelpKeyword="BCLBUILD2002" />
 | 
				
			||||||
 | 
					  </Target>
 | 
				
			||||||
  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
 | 
					  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
 | 
				
			||||||
       Other similar extension points exist, see Microsoft.Common.targets.
 | 
					       Other similar extension points exist, see Microsoft.Common.targets.
 | 
				
			||||||
  <Target Name="BeforeBuild">
 | 
					  <Target Name="BeforeBuild">
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										15
									
								
								MediaBrowser.Model.Portable/app.config
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										15
									
								
								MediaBrowser.Model.Portable/app.config
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,15 @@
 | 
				
			|||||||
 | 
					<?xml version="1.0" encoding="utf-8"?>
 | 
				
			||||||
 | 
					<configuration>
 | 
				
			||||||
 | 
					  <runtime>
 | 
				
			||||||
 | 
					    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
 | 
				
			||||||
 | 
					      <dependentAssembly>
 | 
				
			||||||
 | 
					        <assemblyIdentity name="System.Runtime" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
 | 
				
			||||||
 | 
					        <bindingRedirect oldVersion="0.0.0.0-2.6.8.0" newVersion="2.6.8.0" />
 | 
				
			||||||
 | 
					      </dependentAssembly>
 | 
				
			||||||
 | 
					      <dependentAssembly>
 | 
				
			||||||
 | 
					        <assemblyIdentity name="System.Threading.Tasks" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
 | 
				
			||||||
 | 
					        <bindingRedirect oldVersion="0.0.0.0-2.6.8.0" newVersion="2.6.8.0" />
 | 
				
			||||||
 | 
					      </dependentAssembly>
 | 
				
			||||||
 | 
					    </assemblyBinding>
 | 
				
			||||||
 | 
					  </runtime>
 | 
				
			||||||
 | 
					</configuration>
 | 
				
			||||||
@ -1,5 +1,8 @@
 | 
				
			|||||||
<?xml version="1.0" encoding="utf-8"?>
 | 
					<?xml version="1.0" encoding="utf-8"?>
 | 
				
			||||||
<packages>
 | 
					<packages>
 | 
				
			||||||
  <package id="Fody" version="1.19.1.0" targetFramework="portable-win+net45+sl40+wp71" developmentDependency="true" />
 | 
					  <package id="Fody" version="1.19.1.0" targetFramework="portable-win+net45+sl40+wp71" developmentDependency="true" />
 | 
				
			||||||
 | 
					  <package id="Microsoft.Bcl" version="1.1.8" targetFramework="portable-net45+sl50+win+wp80" />
 | 
				
			||||||
 | 
					  <package id="Microsoft.Bcl.Async" version="1.0.168" targetFramework="portable-net45+sl50+win+wp80" />
 | 
				
			||||||
 | 
					  <package id="Microsoft.Bcl.Build" version="1.0.14" targetFramework="portable-net45+sl50+win+wp80" />
 | 
				
			||||||
  <package id="PropertyChanged.Fody" version="1.41.0.0" targetFramework="portable-net45+sl40+wp71+win" />
 | 
					  <package id="PropertyChanged.Fody" version="1.41.0.0" targetFramework="portable-net45+sl40+wp71+win" />
 | 
				
			||||||
</packages>
 | 
					</packages>
 | 
				
			||||||
@ -92,6 +92,12 @@ namespace MediaBrowser.Model.ApiClient
 | 
				
			|||||||
        /// <returns>Task.</returns>
 | 
					        /// <returns>Task.</returns>
 | 
				
			||||||
        Task ReportCapabilities(ClientCapabilities capabilities, CancellationToken cancellationToken);
 | 
					        Task ReportCapabilities(ClientCapabilities capabilities, CancellationToken cancellationToken);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// Logouts this instance.
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        /// <returns>Task.</returns>
 | 
				
			||||||
 | 
					        Task Logout();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        /// <summary>
 | 
					        /// <summary>
 | 
				
			||||||
        /// Gets the index of the game players.
 | 
					        /// Gets the index of the game players.
 | 
				
			||||||
        /// </summary>
 | 
					        /// </summary>
 | 
				
			||||||
 | 
				
			|||||||
@ -1,5 +1,4 @@
 | 
				
			|||||||
 | 
					namespace MediaBrowser.Model.Entities
 | 
				
			||||||
namespace MediaBrowser.Model.Entities
 | 
					 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    public static class CollectionType
 | 
					    public static class CollectionType
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
 | 
				
			|||||||
@ -211,7 +211,7 @@ namespace MediaBrowser.Server.Implementations.Configuration
 | 
				
			|||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        public void SetPreferredMetadataService(string service)
 | 
					        public void DisableMetadataService(string service)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            DisableMetadataService(typeof(Movie), Configuration, service);
 | 
					            DisableMetadataService(typeof(Movie), Configuration, service);
 | 
				
			||||||
            DisableMetadataService(typeof(MusicAlbum), Configuration, service);
 | 
					            DisableMetadataService(typeof(MusicAlbum), Configuration, service);
 | 
				
			||||||
 | 
				
			|||||||
@ -14,21 +14,6 @@ namespace MediaBrowser.Server.Implementations.Library
 | 
				
			|||||||
    /// </summary>
 | 
					    /// </summary>
 | 
				
			||||||
    public class CoreResolutionIgnoreRule : IResolverIgnoreRule
 | 
					    public class CoreResolutionIgnoreRule : IResolverIgnoreRule
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        /// <summary>
 | 
					 | 
				
			||||||
        /// Any folder named in this list will be ignored - can be added to at runtime for extensibility
 | 
					 | 
				
			||||||
        /// </summary>
 | 
					 | 
				
			||||||
        private static readonly Dictionary<string, string> IgnoreFolders = new List<string>
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
                "metadata",
 | 
					 | 
				
			||||||
                "ps3_update",
 | 
					 | 
				
			||||||
                "ps3_vprm",
 | 
					 | 
				
			||||||
                "extrafanart",
 | 
					 | 
				
			||||||
                "extrathumbs",
 | 
					 | 
				
			||||||
                ".actors",
 | 
					 | 
				
			||||||
                ".wd_tv"
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        }.ToDictionary(i => i, StringComparer.OrdinalIgnoreCase);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        private readonly IFileSystem _fileSystem;
 | 
					        private readonly IFileSystem _fileSystem;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        public CoreResolutionIgnoreRule(IFileSystem fileSystem)
 | 
					        public CoreResolutionIgnoreRule(IFileSystem fileSystem)
 | 
				
			||||||
@ -78,7 +63,7 @@ namespace MediaBrowser.Server.Implementations.Library
 | 
				
			|||||||
            if (args.IsDirectory)
 | 
					            if (args.IsDirectory)
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                // Ignore any folders in our list
 | 
					                // Ignore any folders in our list
 | 
				
			||||||
                if (IgnoreFolders.ContainsKey(filename))
 | 
					                if (EntityResolutionHelper.IgnoreFolders.Contains(filename, StringComparer.OrdinalIgnoreCase))
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    return true;
 | 
					                    return true;
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
 | 
				
			|||||||
@ -6,11 +6,11 @@ using MediaBrowser.Controller.Library;
 | 
				
			|||||||
using MediaBrowser.Controller.Providers;
 | 
					using MediaBrowser.Controller.Providers;
 | 
				
			||||||
using MediaBrowser.Controller.Resolvers;
 | 
					using MediaBrowser.Controller.Resolvers;
 | 
				
			||||||
using MediaBrowser.Model.Entities;
 | 
					using MediaBrowser.Model.Entities;
 | 
				
			||||||
 | 
					using MediaBrowser.Model.Logging;
 | 
				
			||||||
using System;
 | 
					using System;
 | 
				
			||||||
using System.Collections.Generic;
 | 
					using System.Collections.Generic;
 | 
				
			||||||
using System.IO;
 | 
					using System.IO;
 | 
				
			||||||
using System.Linq;
 | 
					using System.Linq;
 | 
				
			||||||
using MediaBrowser.Model.Logging;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace MediaBrowser.Server.Implementations.Library.Resolvers.Movies
 | 
					namespace MediaBrowser.Server.Implementations.Library.Resolvers.Movies
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
@ -79,29 +79,29 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers.Movies
 | 
				
			|||||||
            {
 | 
					            {
 | 
				
			||||||
                if (string.Equals(collectionType, CollectionType.Trailers, StringComparison.OrdinalIgnoreCase))
 | 
					                if (string.Equals(collectionType, CollectionType.Trailers, StringComparison.OrdinalIgnoreCase))
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    return FindMovie<Trailer>(args.Path, args.Parent, args.FileSystemChildren, args.DirectoryService, false, false);
 | 
					                    return FindMovie<Trailer>(args.Path, args.Parent, args.FileSystemChildren.ToList(), args.DirectoryService, false, false);
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                if (string.Equals(collectionType, CollectionType.MusicVideos, StringComparison.OrdinalIgnoreCase))
 | 
					                if (string.Equals(collectionType, CollectionType.MusicVideos, StringComparison.OrdinalIgnoreCase))
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    return FindMovie<MusicVideo>(args.Path, args.Parent, args.FileSystemChildren, args.DirectoryService, false, false);
 | 
					                    return FindMovie<MusicVideo>(args.Path, args.Parent, args.FileSystemChildren.ToList(), args.DirectoryService, false, false);
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                if (string.Equals(collectionType, CollectionType.AdultVideos, StringComparison.OrdinalIgnoreCase))
 | 
					                if (string.Equals(collectionType, CollectionType.AdultVideos, StringComparison.OrdinalIgnoreCase))
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    return FindMovie<AdultVideo>(args.Path, args.Parent, args.FileSystemChildren, args.DirectoryService, true, false);
 | 
					                    return FindMovie<AdultVideo>(args.Path, args.Parent, args.FileSystemChildren.ToList(), args.DirectoryService, true, false);
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                if (string.Equals(collectionType, CollectionType.HomeVideos, StringComparison.OrdinalIgnoreCase))
 | 
					                if (string.Equals(collectionType, CollectionType.HomeVideos, StringComparison.OrdinalIgnoreCase))
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    return FindMovie<Video>(args.Path, args.Parent, args.FileSystemChildren, args.DirectoryService, true, false);
 | 
					                    return FindMovie<Video>(args.Path, args.Parent, args.FileSystemChildren.ToList(), args.DirectoryService, true, false);
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                if (string.IsNullOrEmpty(collectionType) ||
 | 
					                if (string.IsNullOrEmpty(collectionType) ||
 | 
				
			||||||
                    string.Equals(collectionType, CollectionType.Movies, StringComparison.OrdinalIgnoreCase) ||
 | 
					                    string.Equals(collectionType, CollectionType.Movies, StringComparison.OrdinalIgnoreCase) ||
 | 
				
			||||||
                    string.Equals(collectionType, CollectionType.BoxSets, StringComparison.OrdinalIgnoreCase))
 | 
					                    string.Equals(collectionType, CollectionType.BoxSets, StringComparison.OrdinalIgnoreCase))
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    return FindMovie<Movie>(args.Path, args.Parent, args.FileSystemChildren, args.DirectoryService, true, true);
 | 
					                    return FindMovie<Movie>(args.Path, args.Parent, args.FileSystemChildren.ToList(), args.DirectoryService, true, true);
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                return null;
 | 
					                return null;
 | 
				
			||||||
@ -187,7 +187,7 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers.Movies
 | 
				
			|||||||
        /// <param name="directoryService">The directory service.</param>
 | 
					        /// <param name="directoryService">The directory service.</param>
 | 
				
			||||||
        /// <param name="supportMultiFileItems">if set to <c>true</c> [support multi file items].</param>
 | 
					        /// <param name="supportMultiFileItems">if set to <c>true</c> [support multi file items].</param>
 | 
				
			||||||
        /// <returns>Movie.</returns>
 | 
					        /// <returns>Movie.</returns>
 | 
				
			||||||
        private T FindMovie<T>(string path, Folder parent, IEnumerable<FileSystemInfo> fileSystemEntries, IDirectoryService directoryService, bool supportMultiFileItems, bool supportsMultipleSources)
 | 
					        private T FindMovie<T>(string path, Folder parent, List<FileSystemInfo> fileSystemEntries, IDirectoryService directoryService, bool supportMultiFileItems, bool supportsMultipleSources)
 | 
				
			||||||
            where T : Video, new()
 | 
					            where T : Video, new()
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            var movies = new List<T>();
 | 
					            var movies = new List<T>();
 | 
				
			||||||
 | 
				
			|||||||
@ -1207,18 +1207,20 @@ namespace MediaBrowser.Server.Implementations.Session
 | 
				
			|||||||
        /// <param name="deviceId">The device identifier.</param>
 | 
					        /// <param name="deviceId">The device identifier.</param>
 | 
				
			||||||
        /// <param name="deviceName">Name of the device.</param>
 | 
					        /// <param name="deviceName">Name of the device.</param>
 | 
				
			||||||
        /// <param name="remoteEndPoint">The remote end point.</param>
 | 
					        /// <param name="remoteEndPoint">The remote end point.</param>
 | 
				
			||||||
 | 
					        /// <param name="isLocal">if set to <c>true</c> [is local].</param>
 | 
				
			||||||
        /// <returns>Task{SessionInfo}.</returns>
 | 
					        /// <returns>Task{SessionInfo}.</returns>
 | 
				
			||||||
        /// <exception cref="System.UnauthorizedAccessException">Invalid user or password entered.</exception>
 | 
					        /// <exception cref="System.UnauthorizedAccessException">Invalid user or password entered.</exception>
 | 
				
			||||||
        /// <exception cref="UnauthorizedAccessException"></exception>
 | 
					        /// <exception cref="UnauthorizedAccessException">Invalid user or password entered.</exception>
 | 
				
			||||||
        public async Task<AuthenticationResult> AuthenticateNewSession(string username,
 | 
					        public async Task<AuthenticationResult> AuthenticateNewSession(string username,
 | 
				
			||||||
            string password,
 | 
					            string password,
 | 
				
			||||||
            string clientType,
 | 
					            string clientType,
 | 
				
			||||||
            string appVersion,
 | 
					            string appVersion,
 | 
				
			||||||
            string deviceId,
 | 
					            string deviceId,
 | 
				
			||||||
            string deviceName,
 | 
					            string deviceName,
 | 
				
			||||||
            string remoteEndPoint)
 | 
					            string remoteEndPoint,
 | 
				
			||||||
 | 
					            bool isLocal)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            var result = (IsLocalhost(remoteEndPoint) && string.Equals(clientType, "Dashboard", StringComparison.OrdinalIgnoreCase)) ||
 | 
					            var result = (isLocal && string.Equals(clientType, "Dashboard", StringComparison.OrdinalIgnoreCase)) ||
 | 
				
			||||||
                await _userManager.AuthenticateUser(username, password).ConfigureAwait(false);
 | 
					                await _userManager.AuthenticateUser(username, password).ConfigureAwait(false);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            if (!result)
 | 
					            if (!result)
 | 
				
			||||||
@ -1337,35 +1339,6 @@ namespace MediaBrowser.Server.Implementations.Session
 | 
				
			|||||||
            return Logout(token);
 | 
					            return Logout(token);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        private bool IsLocalhost(string remoteEndpoint)
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            if (string.IsNullOrWhiteSpace(remoteEndpoint))
 | 
					 | 
				
			||||||
            {
 | 
					 | 
				
			||||||
                throw new ArgumentNullException("remoteEndpoint");
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            return remoteEndpoint.IndexOf("localhost", StringComparison.OrdinalIgnoreCase) != -1 ||
 | 
					 | 
				
			||||||
                remoteEndpoint.StartsWith("127.", StringComparison.OrdinalIgnoreCase) ||
 | 
					 | 
				
			||||||
                remoteEndpoint.StartsWith("::", StringComparison.OrdinalIgnoreCase);
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        public bool IsInLocalNetwork(string remoteEndpoint)
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            if (string.IsNullOrWhiteSpace(remoteEndpoint))
 | 
					 | 
				
			||||||
            {
 | 
					 | 
				
			||||||
                throw new ArgumentNullException("remoteEndpoint");
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            // Private address space:
 | 
					 | 
				
			||||||
            // http://en.wikipedia.org/wiki/Private_network
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            return IsLocalhost(remoteEndpoint) ||
 | 
					 | 
				
			||||||
                remoteEndpoint.StartsWith("10.", StringComparison.OrdinalIgnoreCase) ||
 | 
					 | 
				
			||||||
                remoteEndpoint.StartsWith("192.", StringComparison.OrdinalIgnoreCase) ||
 | 
					 | 
				
			||||||
                remoteEndpoint.StartsWith("172.", StringComparison.OrdinalIgnoreCase) ||
 | 
					 | 
				
			||||||
                remoteEndpoint.StartsWith("169.", StringComparison.OrdinalIgnoreCase);
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        /// <summary>
 | 
					        /// <summary>
 | 
				
			||||||
        /// Reports the capabilities.
 | 
					        /// Reports the capabilities.
 | 
				
			||||||
        /// </summary>
 | 
					        /// </summary>
 | 
				
			||||||
 | 
				
			|||||||
@ -337,7 +337,7 @@ namespace MediaBrowser.ServerApplication
 | 
				
			|||||||
                // Make sure xbmc metadata is disabled for existing users.
 | 
					                // Make sure xbmc metadata is disabled for existing users.
 | 
				
			||||||
                // New users will be handled by the startup wizard.
 | 
					                // New users will be handled by the startup wizard.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                ServerConfigurationManager.SetPreferredMetadataService("Media Browser Xml");
 | 
					                ServerConfigurationManager.DisableMetadataService("Xbmc Nfo");
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            ServerConfigurationManager.Configuration.DefaultMetadataSettingsApplied = true;
 | 
					            ServerConfigurationManager.Configuration.DefaultMetadataSettingsApplied = true;
 | 
				
			||||||
 | 
				
			|||||||
@ -2,7 +2,7 @@
 | 
				
			|||||||
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
 | 
					<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
 | 
				
			||||||
    <metadata>
 | 
					    <metadata>
 | 
				
			||||||
        <id>MediaBrowser.Common.Internal</id>
 | 
					        <id>MediaBrowser.Common.Internal</id>
 | 
				
			||||||
        <version>3.0.415</version>
 | 
					        <version>3.0.418</version>
 | 
				
			||||||
        <title>MediaBrowser.Common.Internal</title>
 | 
					        <title>MediaBrowser.Common.Internal</title>
 | 
				
			||||||
        <authors>Luke</authors>
 | 
					        <authors>Luke</authors>
 | 
				
			||||||
        <owners>ebr,Luke,scottisafool</owners>
 | 
					        <owners>ebr,Luke,scottisafool</owners>
 | 
				
			||||||
@ -12,7 +12,7 @@
 | 
				
			|||||||
        <description>Contains common components shared by Media Browser Theater and Media Browser Server. Not intended for plugin developer consumption.</description>
 | 
					        <description>Contains common components shared by Media Browser Theater and Media Browser Server. Not intended for plugin developer consumption.</description>
 | 
				
			||||||
        <copyright>Copyright © Media Browser 2013</copyright>
 | 
					        <copyright>Copyright © Media Browser 2013</copyright>
 | 
				
			||||||
        <dependencies>
 | 
					        <dependencies>
 | 
				
			||||||
            <dependency id="MediaBrowser.Common" version="3.0.415" />
 | 
					            <dependency id="MediaBrowser.Common" version="3.0.418" />
 | 
				
			||||||
            <dependency id="NLog" version="2.1.0" />
 | 
					            <dependency id="NLog" version="2.1.0" />
 | 
				
			||||||
            <dependency id="SimpleInjector" version="2.5.0" />
 | 
					            <dependency id="SimpleInjector" version="2.5.0" />
 | 
				
			||||||
            <dependency id="sharpcompress" version="0.10.2" />
 | 
					            <dependency id="sharpcompress" version="0.10.2" />
 | 
				
			||||||
 | 
				
			|||||||
@ -1,8 +1,8 @@
 | 
				
			|||||||
<?xml version="1.0" encoding="utf-8"?>
 | 
					<?xml version="1.0" encoding="utf-8"?>
 | 
				
			||||||
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
 | 
					<package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd">
 | 
				
			||||||
    <metadata>
 | 
					    <metadata>
 | 
				
			||||||
        <id>MediaBrowser.Common</id>
 | 
					        <id>MediaBrowser.Common</id>
 | 
				
			||||||
        <version>3.0.415</version>
 | 
					        <version>3.0.418</version>
 | 
				
			||||||
        <title>MediaBrowser.Common</title>
 | 
					        <title>MediaBrowser.Common</title>
 | 
				
			||||||
        <authors>Media Browser Team</authors>
 | 
					        <authors>Media Browser Team</authors>
 | 
				
			||||||
        <owners>ebr,Luke,scottisafool</owners>
 | 
					        <owners>ebr,Luke,scottisafool</owners>
 | 
				
			||||||
@ -14,7 +14,9 @@
 | 
				
			|||||||
        <dependencies>
 | 
					        <dependencies>
 | 
				
			||||||
            <group targetFramework=".NETFramework4.5" />
 | 
					            <group targetFramework=".NETFramework4.5" />
 | 
				
			||||||
            <group targetFramework=".NETFramework3.5" />
 | 
					            <group targetFramework=".NETFramework3.5" />
 | 
				
			||||||
            <group targetFramework=".NETPortable0.0-net45+sl4+wp71+win8"/>
 | 
					            <group targetFramework=".NETPortable0.0-net45+sl4+wp71+win8">
 | 
				
			||||||
 | 
					                <dependency id="Microsoft.Bcl.Async" version="1.0.168" />
 | 
				
			||||||
 | 
					            </group>
 | 
				
			||||||
        </dependencies>
 | 
					        </dependencies>
 | 
				
			||||||
    </metadata>
 | 
					    </metadata>
 | 
				
			||||||
    <files>
 | 
					    <files>
 | 
				
			||||||
 | 
				
			|||||||
@ -2,7 +2,7 @@
 | 
				
			|||||||
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
 | 
					<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
 | 
				
			||||||
    <metadata>
 | 
					    <metadata>
 | 
				
			||||||
        <id>MediaBrowser.Model.Signed</id>
 | 
					        <id>MediaBrowser.Model.Signed</id>
 | 
				
			||||||
        <version>3.0.415</version>
 | 
					        <version>3.0.418</version>
 | 
				
			||||||
        <title>MediaBrowser.Model - Signed Edition</title>
 | 
					        <title>MediaBrowser.Model - Signed Edition</title>
 | 
				
			||||||
        <authors>Media Browser Team</authors>
 | 
					        <authors>Media Browser Team</authors>
 | 
				
			||||||
        <owners>ebr,Luke,scottisafool</owners>
 | 
					        <owners>ebr,Luke,scottisafool</owners>
 | 
				
			||||||
 | 
				
			|||||||
@ -2,7 +2,7 @@
 | 
				
			|||||||
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
 | 
					<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
 | 
				
			||||||
    <metadata>
 | 
					    <metadata>
 | 
				
			||||||
        <id>MediaBrowser.Server.Core</id>
 | 
					        <id>MediaBrowser.Server.Core</id>
 | 
				
			||||||
        <version>3.0.415</version>
 | 
					        <version>3.0.418</version>
 | 
				
			||||||
        <title>Media Browser.Server.Core</title>
 | 
					        <title>Media Browser.Server.Core</title>
 | 
				
			||||||
        <authors>Media Browser Team</authors>
 | 
					        <authors>Media Browser Team</authors>
 | 
				
			||||||
        <owners>ebr,Luke,scottisafool</owners>
 | 
					        <owners>ebr,Luke,scottisafool</owners>
 | 
				
			||||||
@ -12,7 +12,7 @@
 | 
				
			|||||||
        <description>Contains core components required to build plugins for Media Browser Server.</description>
 | 
					        <description>Contains core components required to build plugins for Media Browser Server.</description>
 | 
				
			||||||
        <copyright>Copyright © Media Browser 2013</copyright>
 | 
					        <copyright>Copyright © Media Browser 2013</copyright>
 | 
				
			||||||
        <dependencies>
 | 
					        <dependencies>
 | 
				
			||||||
            <dependency id="MediaBrowser.Common" version="3.0.415" />
 | 
					            <dependency id="MediaBrowser.Common" version="3.0.418" />
 | 
				
			||||||
        </dependencies>
 | 
					        </dependencies>
 | 
				
			||||||
    </metadata>
 | 
					    </metadata>
 | 
				
			||||||
    <files>
 | 
					    <files>
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user