Update to 3.5.2 and .net core 2.1

This commit is contained in:
stefan
2018-09-12 19:26:21 +02:00
parent c32d865638
commit 48facb797e
1419 changed files with 27525 additions and 88927 deletions

View File

@@ -26,7 +26,7 @@ namespace Emby.Server.Implementations.Library
public static void SetInitialItemValues(BaseItem item, Folder parent, IFileSystem fileSystem, ILibraryManager libraryManager, IDirectoryService directoryService)
{
// This version of the below method has no ItemResolveArgs, so we have to require the path already being set
if (string.IsNullOrWhiteSpace(item.Path))
if (string.IsNullOrEmpty(item.Path))
{
throw new ArgumentException("Item must have a Path");
}
@@ -107,17 +107,6 @@ namespace Emby.Server.Implementations.Library
return isDirectory ? Path.GetFileName(path) : Path.GetFileNameWithoutExtension(path);
}
/// <summary>
/// The MB name regex
/// </summary>
private static readonly Regex MbNameRegex = new Regex(@"(\[.*?\])");
internal static string StripBrackets(string inputString)
{
var output = MbNameRegex.Replace(inputString, string.Empty).Trim();
return Regex.Replace(output, @"\s+", " ");
}
/// <summary>
/// Ensures DateCreated and DateModified have values
/// </summary>
@@ -140,7 +129,7 @@ namespace Emby.Server.Implementations.Library
}
// See if a different path came out of the resolver than what went in
if (!string.Equals(args.Path, item.Path, StringComparison.OrdinalIgnoreCase))
if (!fileSystem.AreEqual(args.Path, item.Path))
{
var childData = args.IsDirectory ? args.GetFileSystemEntryByPath(item.Path) : null;
@@ -173,7 +162,14 @@ namespace Emby.Server.Implementations.Library
// directoryService.getFile may return null
if (info != null)
{
item.DateCreated = fileSystem.GetCreationTimeUtc(info);
var dateCreated = fileSystem.GetCreationTimeUtc(info);
if (dateCreated.Equals(DateTime.MinValue))
{
dateCreated = DateTime.UtcNow;
}
item.DateCreated = dateCreated;
}
}
else