mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-11-15 18:08:53 -07:00
3.0.5306.42925
This commit is contained in:
parent
8b630e2d41
commit
baf44b2718
@ -122,42 +122,44 @@ namespace MediaBrowser.Api
|
||||
return ToOptimizedResult(result);
|
||||
}
|
||||
|
||||
const string XbmcMetadata = "Xbmc Nfo";
|
||||
const string MediaBrowserMetadata = "Media Browser Xml";
|
||||
|
||||
public void Post(AutoSetMetadataOptions request)
|
||||
{
|
||||
var service = AutoDetectMetadataService();
|
||||
|
||||
Logger.Info("Setting preferred metadata format to " + service);
|
||||
|
||||
_configurationManager.SetPreferredMetadataService(service);
|
||||
var serviceToDisable = string.Equals(service, XbmcMetadata) ?
|
||||
MediaBrowserMetadata :
|
||||
XbmcMetadata;
|
||||
|
||||
_configurationManager.DisableMetadataService(serviceToDisable);
|
||||
_configurationManager.SaveConfiguration();
|
||||
}
|
||||
|
||||
private string AutoDetectMetadataService()
|
||||
{
|
||||
const string xbmc = "Xbmc Nfo";
|
||||
const string mb = "Media Browser Xml";
|
||||
|
||||
var paths = _libraryManager.GetDefaultVirtualFolders()
|
||||
.SelectMany(i => i.Locations)
|
||||
.Distinct(StringComparer.OrdinalIgnoreCase)
|
||||
.Select(i => new DirectoryInfo(i))
|
||||
.ToList();
|
||||
|
||||
if (paths.Select(i => i.EnumerateFiles("*.xml", SearchOption.AllDirectories))
|
||||
.SelectMany(i => i)
|
||||
if (paths.SelectMany(i => i.EnumerateFiles("*.xml", SearchOption.AllDirectories))
|
||||
.Any())
|
||||
{
|
||||
return xbmc;
|
||||
return XbmcMetadata;
|
||||
}
|
||||
|
||||
if (paths.Select(i => i.EnumerateFiles("*.xml", SearchOption.AllDirectories))
|
||||
.SelectMany(i => i)
|
||||
if (paths.SelectMany(i => i.EnumerateFiles("*.xml", SearchOption.AllDirectories))
|
||||
.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>
|
||||
|
@ -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)
|
||||
{
|
||||
item.Name = request.Name;
|
||||
@ -140,11 +145,11 @@ namespace MediaBrowser.Api
|
||||
|
||||
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.PremiereDate = request.PremiereDate.HasValue ? request.PremiereDate.Value.ToUniversalTime() : (DateTime?)null;
|
||||
item.EndDate = request.EndDate.HasValue ? NormalizeDateTime(request.EndDate.Value) : (DateTime?)null;
|
||||
item.PremiereDate = request.PremiereDate.HasValue ? NormalizeDateTime(request.PremiereDate.Value) : (DateTime?)null;
|
||||
item.ProductionYear = request.ProductionYear;
|
||||
item.OfficialRating = request.OfficialRating;
|
||||
item.CustomRating = request.CustomRating;
|
||||
|
@ -1,4 +1,5 @@
|
||||
using MediaBrowser.Common.Extensions;
|
||||
using MediaBrowser.Common.Net;
|
||||
using MediaBrowser.Controller.Configuration;
|
||||
using MediaBrowser.Controller.Dto;
|
||||
using MediaBrowser.Controller.Library;
|
||||
@ -11,6 +12,7 @@ using ServiceStack.Text.Controller;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MediaBrowser.Api
|
||||
@ -168,6 +170,7 @@ namespace MediaBrowser.Api
|
||||
private readonly IDtoService _dtoService;
|
||||
private readonly ISessionManager _sessionMananger;
|
||||
private readonly IServerConfigurationManager _config;
|
||||
private readonly INetworkManager _networkManager;
|
||||
|
||||
public IAuthorizationContext AuthorizationContext { get; set; }
|
||||
|
||||
@ -178,12 +181,13 @@ namespace MediaBrowser.Api
|
||||
/// <param name="dtoService">The dto service.</param>
|
||||
/// <param name="sessionMananger">The session mananger.</param>
|
||||
/// <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;
|
||||
_dtoService = dtoService;
|
||||
_sessionMananger = sessionMananger;
|
||||
_config = config;
|
||||
_networkManager = networkManager;
|
||||
}
|
||||
|
||||
public object Get(GetPublicUsers request)
|
||||
@ -200,18 +204,65 @@ namespace MediaBrowser.Api
|
||||
});
|
||||
}
|
||||
|
||||
// TODO: Add or is authenticated
|
||||
if (_sessionMananger.IsInLocalNetwork(Request.RemoteIp))
|
||||
// TODO: Uncomment this once all clients can handle an empty user list.
|
||||
return Get(new GetUsers
|
||||
{
|
||||
return Get(new GetUsers
|
||||
{
|
||||
IsHidden = false,
|
||||
IsDisabled = false
|
||||
});
|
||||
IsHidden = 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>());
|
||||
}
|
||||
|
||||
private bool IsInLocalNetwork(string remoteEndpoint)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(remoteEndpoint))
|
||||
{
|
||||
throw new ArgumentNullException("remoteEndpoint");
|
||||
}
|
||||
|
||||
// Return empty when external
|
||||
return ToOptimizedResult(new List<UserDto>());
|
||||
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>
|
||||
@ -307,7 +358,7 @@ namespace MediaBrowser.Api
|
||||
var auth = AuthorizationContext.GetAuthorizationInfo(Request);
|
||||
|
||||
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);
|
||||
}
|
||||
|
@ -177,17 +177,27 @@ namespace MediaBrowser.Common.Implementations.Updates
|
||||
{
|
||||
if (_lastPackageListResult != null)
|
||||
{
|
||||
// Let dev users get results more often for testing purposes
|
||||
var cacheLength = _config.CommonConfiguration.SystemUpdateLevel == PackageVersionClass.Dev
|
||||
? TimeSpan.FromMinutes(3)
|
||||
: TimeSpan.FromHours(6);
|
||||
TimeSpan cacheLength;
|
||||
|
||||
switch (_config.CommonConfiguration.SystemUpdateLevel)
|
||||
{
|
||||
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)
|
||||
{
|
||||
return _lastPackageListResult.Item1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
using (var json = await _httpClient.Get(Constants.Constants.MbAdminUrl + "service/MB3Packages.json", cancellationToken).ConfigureAwait(false))
|
||||
{
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
@ -274,7 +284,7 @@ namespace MediaBrowser.Common.Implementations.Updates
|
||||
{
|
||||
var packages = await GetAvailablePackages(CancellationToken.None).ConfigureAwait(false);
|
||||
|
||||
var package = packages.FirstOrDefault(p => string.Equals(p.guid, guid ?? "none", StringComparison.OrdinalIgnoreCase))
|
||||
var package = packages.FirstOrDefault(p => string.Equals(p.guid, guid ?? "none", StringComparison.OrdinalIgnoreCase))
|
||||
?? packages.FirstOrDefault(p => p.name.Equals(name, StringComparison.OrdinalIgnoreCase));
|
||||
|
||||
if (package == null)
|
||||
@ -310,7 +320,7 @@ namespace MediaBrowser.Common.Implementations.Updates
|
||||
/// <returns>PackageVersionInfo.</returns>
|
||||
public PackageVersionInfo GetLatestCompatibleVersion(IEnumerable<PackageInfo> availablePackages, string name, string guid, Version currentServerVersion, PackageVersionClass classification = PackageVersionClass.Release)
|
||||
{
|
||||
var package = availablePackages.FirstOrDefault(p => string.Equals(p.guid, guid ?? "none", StringComparison.OrdinalIgnoreCase))
|
||||
var package = availablePackages.FirstOrDefault(p => string.Equals(p.guid, guid ?? "none", StringComparison.OrdinalIgnoreCase))
|
||||
?? availablePackages.FirstOrDefault(p => p.name.Equals(name, StringComparison.OrdinalIgnoreCase));
|
||||
|
||||
if (package == null)
|
||||
|
@ -31,6 +31,6 @@ namespace MediaBrowser.Controller.Configuration
|
||||
/// Sets the preferred metadata service.
|
||||
/// </summary>
|
||||
/// <param name="service">The service.</param>
|
||||
void SetPreferredMetadataService(string service);
|
||||
void DisableMetadataService(string service);
|
||||
}
|
||||
}
|
||||
|
@ -14,6 +14,21 @@ namespace MediaBrowser.Controller.Resolvers
|
||||
/// </summary>
|
||||
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>
|
||||
/// Any extension in this list is considered a video file - can be added to at runtime for extensibility
|
||||
/// </summary>
|
||||
|
@ -218,6 +218,7 @@ namespace MediaBrowser.Controller.Session
|
||||
/// <param name="deviceId">The device identifier.</param>
|
||||
/// <param name="deviceName">Name of the device.</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>
|
||||
Task<AuthenticationResult> AuthenticateNewSession(string username,
|
||||
string password,
|
||||
@ -225,7 +226,8 @@ namespace MediaBrowser.Controller.Session
|
||||
string appVersion,
|
||||
string deviceId,
|
||||
string deviceName,
|
||||
string remoteEndPoint);
|
||||
string remoteEndPoint,
|
||||
bool isLocal);
|
||||
|
||||
/// <summary>
|
||||
/// Reports the capabilities.
|
||||
@ -282,12 +284,5 @@ namespace MediaBrowser.Controller.Session
|
||||
/// <param name="id">The identifier.</param>
|
||||
/// <returns>Task.</returns>
|
||||
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>
|
||||
<ItemGroup>
|
||||
<!-- A reference to the entire .NET Framework is automatically included -->
|
||||
<None Include="app.config" />
|
||||
<None Include="Fody.targets" />
|
||||
<None Include="packages.config" />
|
||||
</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">
|
||||
<HintPath>..\packages\PropertyChanged.Fody.1.41.0.0\Lib\portable-net4+sl4+wp7+win8+MonoAndroid16+MonoTouch40\PropertyChanged.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</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>
|
||||
<Compile Include="..\MediaBrowser.Model\ApiClient\ApiClientExtensions.cs">
|
||||
@ -914,6 +930,11 @@ xcopy "$(TargetPath)" "$(SolutionDir)\Nuget\dlls\portable\" /y /d /r /i
|
||||
</PropertyGroup>
|
||||
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.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.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<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"?>
|
||||
<packages>
|
||||
<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" />
|
||||
</packages>
|
@ -92,6 +92,12 @@ namespace MediaBrowser.Model.ApiClient
|
||||
/// <returns>Task.</returns>
|
||||
Task ReportCapabilities(ClientCapabilities capabilities, CancellationToken cancellationToken);
|
||||
|
||||
/// <summary>
|
||||
/// Logouts this instance.
|
||||
/// </summary>
|
||||
/// <returns>Task.</returns>
|
||||
Task Logout();
|
||||
|
||||
/// <summary>
|
||||
/// Gets the index of the game players.
|
||||
/// </summary>
|
||||
|
@ -1,5 +1,4 @@
|
||||
|
||||
namespace MediaBrowser.Model.Entities
|
||||
namespace MediaBrowser.Model.Entities
|
||||
{
|
||||
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(MusicAlbum), Configuration, service);
|
||||
|
@ -14,21 +14,6 @@ namespace MediaBrowser.Server.Implementations.Library
|
||||
/// </summary>
|
||||
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;
|
||||
|
||||
public CoreResolutionIgnoreRule(IFileSystem fileSystem)
|
||||
@ -78,7 +63,7 @@ namespace MediaBrowser.Server.Implementations.Library
|
||||
if (args.IsDirectory)
|
||||
{
|
||||
// Ignore any folders in our list
|
||||
if (IgnoreFolders.ContainsKey(filename))
|
||||
if (EntityResolutionHelper.IgnoreFolders.Contains(filename, StringComparer.OrdinalIgnoreCase))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
@ -6,11 +6,11 @@ using MediaBrowser.Controller.Library;
|
||||
using MediaBrowser.Controller.Providers;
|
||||
using MediaBrowser.Controller.Resolvers;
|
||||
using MediaBrowser.Model.Entities;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using MediaBrowser.Model.Logging;
|
||||
|
||||
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))
|
||||
{
|
||||
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))
|
||||
{
|
||||
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))
|
||||
{
|
||||
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))
|
||||
{
|
||||
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) ||
|
||||
string.Equals(collectionType, CollectionType.Movies, 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;
|
||||
@ -187,7 +187,7 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers.Movies
|
||||
/// <param name="directoryService">The directory service.</param>
|
||||
/// <param name="supportMultiFileItems">if set to <c>true</c> [support multi file items].</param>
|
||||
/// <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()
|
||||
{
|
||||
var movies = new List<T>();
|
||||
|
@ -1207,18 +1207,20 @@ namespace MediaBrowser.Server.Implementations.Session
|
||||
/// <param name="deviceId">The device identifier.</param>
|
||||
/// <param name="deviceName">Name of the device.</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>
|
||||
/// <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,
|
||||
string password,
|
||||
string clientType,
|
||||
string appVersion,
|
||||
string deviceId,
|
||||
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);
|
||||
|
||||
if (!result)
|
||||
@ -1337,35 +1339,6 @@ namespace MediaBrowser.Server.Implementations.Session
|
||||
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>
|
||||
/// Reports the capabilities.
|
||||
/// </summary>
|
||||
|
@ -337,7 +337,7 @@ namespace MediaBrowser.ServerApplication
|
||||
// Make sure xbmc metadata is disabled for existing users.
|
||||
// New users will be handled by the startup wizard.
|
||||
|
||||
ServerConfigurationManager.SetPreferredMetadataService("Media Browser Xml");
|
||||
ServerConfigurationManager.DisableMetadataService("Xbmc Nfo");
|
||||
}
|
||||
|
||||
ServerConfigurationManager.Configuration.DefaultMetadataSettingsApplied = true;
|
||||
|
@ -2,7 +2,7 @@
|
||||
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
|
||||
<metadata>
|
||||
<id>MediaBrowser.Common.Internal</id>
|
||||
<version>3.0.415</version>
|
||||
<version>3.0.418</version>
|
||||
<title>MediaBrowser.Common.Internal</title>
|
||||
<authors>Luke</authors>
|
||||
<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>
|
||||
<copyright>Copyright © Media Browser 2013</copyright>
|
||||
<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="SimpleInjector" version="2.5.0" />
|
||||
<dependency id="sharpcompress" version="0.10.2" />
|
||||
|
@ -1,8 +1,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>
|
||||
<id>MediaBrowser.Common</id>
|
||||
<version>3.0.415</version>
|
||||
<version>3.0.418</version>
|
||||
<title>MediaBrowser.Common</title>
|
||||
<authors>Media Browser Team</authors>
|
||||
<owners>ebr,Luke,scottisafool</owners>
|
||||
@ -12,9 +12,11 @@
|
||||
<description>Contains common model objects and interfaces used by all Media Browser solutions.</description>
|
||||
<copyright>Copyright © Media Browser 2013</copyright>
|
||||
<dependencies>
|
||||
<group targetFramework=".NETFramework4.5"/>
|
||||
<group targetFramework=".NETFramework3.5"/>
|
||||
<group targetFramework=".NETPortable0.0-net45+sl4+wp71+win8"/>
|
||||
<group targetFramework=".NETFramework4.5" />
|
||||
<group targetFramework=".NETFramework3.5" />
|
||||
<group targetFramework=".NETPortable0.0-net45+sl4+wp71+win8">
|
||||
<dependency id="Microsoft.Bcl.Async" version="1.0.168" />
|
||||
</group>
|
||||
</dependencies>
|
||||
</metadata>
|
||||
<files>
|
||||
|
@ -2,7 +2,7 @@
|
||||
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
|
||||
<metadata>
|
||||
<id>MediaBrowser.Model.Signed</id>
|
||||
<version>3.0.415</version>
|
||||
<version>3.0.418</version>
|
||||
<title>MediaBrowser.Model - Signed Edition</title>
|
||||
<authors>Media Browser Team</authors>
|
||||
<owners>ebr,Luke,scottisafool</owners>
|
||||
|
@ -2,7 +2,7 @@
|
||||
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
|
||||
<metadata>
|
||||
<id>MediaBrowser.Server.Core</id>
|
||||
<version>3.0.415</version>
|
||||
<version>3.0.418</version>
|
||||
<title>Media Browser.Server.Core</title>
|
||||
<authors>Media Browser Team</authors>
|
||||
<owners>ebr,Luke,scottisafool</owners>
|
||||
@ -12,7 +12,7 @@
|
||||
<description>Contains core components required to build plugins for Media Browser Server.</description>
|
||||
<copyright>Copyright © Media Browser 2013</copyright>
|
||||
<dependencies>
|
||||
<dependency id="MediaBrowser.Common" version="3.0.415" />
|
||||
<dependency id="MediaBrowser.Common" version="3.0.418" />
|
||||
</dependencies>
|
||||
</metadata>
|
||||
<files>
|
||||
|
Loading…
Reference in New Issue
Block a user