|
@@ -46,7 +46,6 @@ using MediaBrowser.Model.IO;
|
|
using MediaBrowser.Model.Library;
|
|
using MediaBrowser.Model.Library;
|
|
using MediaBrowser.Model.Querying;
|
|
using MediaBrowser.Model.Querying;
|
|
using MediaBrowser.Model.Tasks;
|
|
using MediaBrowser.Model.Tasks;
|
|
-using Microsoft.Extensions.Caching.Memory;
|
|
|
|
using Microsoft.Extensions.Logging;
|
|
using Microsoft.Extensions.Logging;
|
|
using Episode = MediaBrowser.Controller.Entities.TV.Episode;
|
|
using Episode = MediaBrowser.Controller.Entities.TV.Episode;
|
|
using EpisodeInfo = Emby.Naming.TV.EpisodeInfo;
|
|
using EpisodeInfo = Emby.Naming.TV.EpisodeInfo;
|
|
@@ -526,14 +525,14 @@ namespace Emby.Server.Implementations.Library
|
|
IDirectoryService directoryService,
|
|
IDirectoryService directoryService,
|
|
IItemResolver[] resolvers,
|
|
IItemResolver[] resolvers,
|
|
Folder parent = null,
|
|
Folder parent = null,
|
|
- string collectionType = null,
|
|
|
|
|
|
+ CollectionType? collectionType = null,
|
|
LibraryOptions libraryOptions = null)
|
|
LibraryOptions libraryOptions = null)
|
|
{
|
|
{
|
|
ArgumentNullException.ThrowIfNull(fileInfo);
|
|
ArgumentNullException.ThrowIfNull(fileInfo);
|
|
|
|
|
|
var fullPath = fileInfo.FullName;
|
|
var fullPath = fileInfo.FullName;
|
|
|
|
|
|
- if (string.IsNullOrEmpty(collectionType) && parent is not null)
|
|
|
|
|
|
+ if (collectionType is null && parent is not null)
|
|
{
|
|
{
|
|
collectionType = GetContentTypeOverride(fullPath, true);
|
|
collectionType = GetContentTypeOverride(fullPath, true);
|
|
}
|
|
}
|
|
@@ -636,7 +635,7 @@ namespace Emby.Server.Implementations.Library
|
|
return !args.ContainsFileSystemEntryByName(".ignore");
|
|
return !args.ContainsFileSystemEntryByName(".ignore");
|
|
}
|
|
}
|
|
|
|
|
|
- public IEnumerable<BaseItem> ResolvePaths(IEnumerable<FileSystemMetadata> files, IDirectoryService directoryService, Folder parent, LibraryOptions libraryOptions, string collectionType = null)
|
|
|
|
|
|
+ public IEnumerable<BaseItem> ResolvePaths(IEnumerable<FileSystemMetadata> files, IDirectoryService directoryService, Folder parent, LibraryOptions libraryOptions, CollectionType? collectionType = null)
|
|
{
|
|
{
|
|
return ResolvePaths(files, directoryService, parent, libraryOptions, collectionType, EntityResolvers);
|
|
return ResolvePaths(files, directoryService, parent, libraryOptions, collectionType, EntityResolvers);
|
|
}
|
|
}
|
|
@@ -646,7 +645,7 @@ namespace Emby.Server.Implementations.Library
|
|
IDirectoryService directoryService,
|
|
IDirectoryService directoryService,
|
|
Folder parent,
|
|
Folder parent,
|
|
LibraryOptions libraryOptions,
|
|
LibraryOptions libraryOptions,
|
|
- string collectionType,
|
|
|
|
|
|
+ CollectionType? collectionType,
|
|
IItemResolver[] resolvers)
|
|
IItemResolver[] resolvers)
|
|
{
|
|
{
|
|
var fileList = files.Where(i => !IgnoreFile(i, parent)).ToList();
|
|
var fileList = files.Where(i => !IgnoreFile(i, parent)).ToList();
|
|
@@ -676,7 +675,7 @@ namespace Emby.Server.Implementations.Library
|
|
IReadOnlyList<FileSystemMetadata> fileList,
|
|
IReadOnlyList<FileSystemMetadata> fileList,
|
|
IDirectoryService directoryService,
|
|
IDirectoryService directoryService,
|
|
Folder parent,
|
|
Folder parent,
|
|
- string collectionType,
|
|
|
|
|
|
+ CollectionType? collectionType,
|
|
IItemResolver[] resolvers,
|
|
IItemResolver[] resolvers,
|
|
LibraryOptions libraryOptions)
|
|
LibraryOptions libraryOptions)
|
|
{
|
|
{
|
|
@@ -839,19 +838,12 @@ namespace Emby.Server.Implementations.Library
|
|
{
|
|
{
|
|
var path = Person.GetPath(name);
|
|
var path = Person.GetPath(name);
|
|
var id = GetItemByNameId<Person>(path);
|
|
var id = GetItemByNameId<Person>(path);
|
|
- if (GetItemById(id) is not Person item)
|
|
|
|
|
|
+ if (GetItemById(id) is Person item)
|
|
{
|
|
{
|
|
- item = new Person
|
|
|
|
- {
|
|
|
|
- Name = name,
|
|
|
|
- Id = id,
|
|
|
|
- DateCreated = DateTime.UtcNow,
|
|
|
|
- DateModified = DateTime.UtcNow,
|
|
|
|
- Path = path
|
|
|
|
- };
|
|
|
|
|
|
+ return item;
|
|
}
|
|
}
|
|
|
|
|
|
- return item;
|
|
|
|
|
|
+ return null;
|
|
}
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// <summary>
|
|
@@ -1162,7 +1154,7 @@ namespace Emby.Server.Implementations.Library
|
|
Name = Path.GetFileName(dir),
|
|
Name = Path.GetFileName(dir),
|
|
|
|
|
|
Locations = _fileSystem.GetFilePaths(dir, false)
|
|
Locations = _fileSystem.GetFilePaths(dir, false)
|
|
- .Where(i => string.Equals(ShortcutFileExtension, Path.GetExtension(i), StringComparison.OrdinalIgnoreCase))
|
|
|
|
|
|
+ .Where(i => Path.GetExtension(i.AsSpan()).Equals(ShortcutFileExtension, StringComparison.OrdinalIgnoreCase))
|
|
.Select(i =>
|
|
.Select(i =>
|
|
{
|
|
{
|
|
try
|
|
try
|
|
@@ -1522,7 +1514,7 @@ namespace Emby.Server.Implementations.Library
|
|
{
|
|
{
|
|
if (item is UserView view)
|
|
if (item is UserView view)
|
|
{
|
|
{
|
|
- if (string.Equals(view.ViewType, CollectionType.LiveTv, StringComparison.Ordinal))
|
|
|
|
|
|
+ if (view.ViewType == CollectionType.LiveTv)
|
|
{
|
|
{
|
|
return new[] { view.Id };
|
|
return new[] { view.Id };
|
|
}
|
|
}
|
|
@@ -1551,13 +1543,13 @@ namespace Emby.Server.Implementations.Library
|
|
}
|
|
}
|
|
|
|
|
|
// Handle grouping
|
|
// Handle grouping
|
|
- if (user is not null && !string.IsNullOrEmpty(view.ViewType) && UserView.IsEligibleForGrouping(view.ViewType)
|
|
|
|
|
|
+ if (user is not null && view.ViewType != CollectionType.Unknown && UserView.IsEligibleForGrouping(view.ViewType)
|
|
&& user.GetPreference(PreferenceKind.GroupedFolders).Length > 0)
|
|
&& user.GetPreference(PreferenceKind.GroupedFolders).Length > 0)
|
|
{
|
|
{
|
|
return GetUserRootFolder()
|
|
return GetUserRootFolder()
|
|
.GetChildren(user, true)
|
|
.GetChildren(user, true)
|
|
.OfType<CollectionFolder>()
|
|
.OfType<CollectionFolder>()
|
|
- .Where(i => string.IsNullOrEmpty(i.CollectionType) || string.Equals(i.CollectionType, view.ViewType, StringComparison.OrdinalIgnoreCase))
|
|
|
|
|
|
+ .Where(i => i.CollectionType is null || i.CollectionType == view.ViewType)
|
|
.Where(i => user.IsFolderGrouped(i.Id))
|
|
.Where(i => user.IsFolderGrouped(i.Id))
|
|
.SelectMany(i => GetTopParentIdsForQuery(i, user));
|
|
.SelectMany(i => GetTopParentIdsForQuery(i, user));
|
|
}
|
|
}
|
|
@@ -1686,7 +1678,7 @@ namespace Emby.Server.Implementations.Library
|
|
/// <param name="sortBy">The sort by.</param>
|
|
/// <param name="sortBy">The sort by.</param>
|
|
/// <param name="sortOrder">The sort order.</param>
|
|
/// <param name="sortOrder">The sort order.</param>
|
|
/// <returns>IEnumerable{BaseItem}.</returns>
|
|
/// <returns>IEnumerable{BaseItem}.</returns>
|
|
- public IEnumerable<BaseItem> Sort(IEnumerable<BaseItem> items, User user, IEnumerable<string> sortBy, SortOrder sortOrder)
|
|
|
|
|
|
+ public IEnumerable<BaseItem> Sort(IEnumerable<BaseItem> items, User user, IEnumerable<ItemSortBy> sortBy, SortOrder sortOrder)
|
|
{
|
|
{
|
|
var isFirst = true;
|
|
var isFirst = true;
|
|
|
|
|
|
@@ -1709,7 +1701,7 @@ namespace Emby.Server.Implementations.Library
|
|
return orderedItems ?? items;
|
|
return orderedItems ?? items;
|
|
}
|
|
}
|
|
|
|
|
|
- public IEnumerable<BaseItem> Sort(IEnumerable<BaseItem> items, User user, IEnumerable<(string OrderBy, SortOrder SortOrder)> orderBy)
|
|
|
|
|
|
+ public IEnumerable<BaseItem> Sort(IEnumerable<BaseItem> items, User user, IEnumerable<(ItemSortBy OrderBy, SortOrder SortOrder)> orderBy)
|
|
{
|
|
{
|
|
var isFirst = true;
|
|
var isFirst = true;
|
|
|
|
|
|
@@ -1744,9 +1736,9 @@ namespace Emby.Server.Implementations.Library
|
|
/// <param name="name">The name.</param>
|
|
/// <param name="name">The name.</param>
|
|
/// <param name="user">The user.</param>
|
|
/// <param name="user">The user.</param>
|
|
/// <returns>IBaseItemComparer.</returns>
|
|
/// <returns>IBaseItemComparer.</returns>
|
|
- private IBaseItemComparer GetComparer(string name, User user)
|
|
|
|
|
|
+ private IBaseItemComparer GetComparer(ItemSortBy name, User user)
|
|
{
|
|
{
|
|
- var comparer = Comparers.FirstOrDefault(c => string.Equals(name, c.Name, StringComparison.OrdinalIgnoreCase));
|
|
|
|
|
|
+ var comparer = Comparers.FirstOrDefault(c => name == c.Type);
|
|
|
|
|
|
// If it requires a user, create a new one, and assign the user
|
|
// If it requires a user, create a new one, and assign the user
|
|
if (comparer is IUserBaseItemComparer)
|
|
if (comparer is IUserBaseItemComparer)
|
|
@@ -2073,16 +2065,16 @@ namespace Emby.Server.Implementations.Library
|
|
: collectionFolder.GetLibraryOptions();
|
|
: collectionFolder.GetLibraryOptions();
|
|
}
|
|
}
|
|
|
|
|
|
- public string GetContentType(BaseItem item)
|
|
|
|
|
|
+ public CollectionType? GetContentType(BaseItem item)
|
|
{
|
|
{
|
|
- string configuredContentType = GetConfiguredContentType(item, false);
|
|
|
|
- if (!string.IsNullOrEmpty(configuredContentType))
|
|
|
|
|
|
+ var configuredContentType = GetConfiguredContentType(item, false);
|
|
|
|
+ if (configuredContentType is not null)
|
|
{
|
|
{
|
|
return configuredContentType;
|
|
return configuredContentType;
|
|
}
|
|
}
|
|
|
|
|
|
configuredContentType = GetConfiguredContentType(item, true);
|
|
configuredContentType = GetConfiguredContentType(item, true);
|
|
- if (!string.IsNullOrEmpty(configuredContentType))
|
|
|
|
|
|
+ if (configuredContentType is not null)
|
|
{
|
|
{
|
|
return configuredContentType;
|
|
return configuredContentType;
|
|
}
|
|
}
|
|
@@ -2090,31 +2082,31 @@ namespace Emby.Server.Implementations.Library
|
|
return GetInheritedContentType(item);
|
|
return GetInheritedContentType(item);
|
|
}
|
|
}
|
|
|
|
|
|
- public string GetInheritedContentType(BaseItem item)
|
|
|
|
|
|
+ public CollectionType? GetInheritedContentType(BaseItem item)
|
|
{
|
|
{
|
|
var type = GetTopFolderContentType(item);
|
|
var type = GetTopFolderContentType(item);
|
|
|
|
|
|
- if (!string.IsNullOrEmpty(type))
|
|
|
|
|
|
+ if (type is not null)
|
|
{
|
|
{
|
|
return type;
|
|
return type;
|
|
}
|
|
}
|
|
|
|
|
|
return item.GetParents()
|
|
return item.GetParents()
|
|
.Select(GetConfiguredContentType)
|
|
.Select(GetConfiguredContentType)
|
|
- .LastOrDefault(i => !string.IsNullOrEmpty(i));
|
|
|
|
|
|
+ .LastOrDefault(i => i is not null);
|
|
}
|
|
}
|
|
|
|
|
|
- public string GetConfiguredContentType(BaseItem item)
|
|
|
|
|
|
+ public CollectionType? GetConfiguredContentType(BaseItem item)
|
|
{
|
|
{
|
|
return GetConfiguredContentType(item, false);
|
|
return GetConfiguredContentType(item, false);
|
|
}
|
|
}
|
|
|
|
|
|
- public string GetConfiguredContentType(string path)
|
|
|
|
|
|
+ public CollectionType? GetConfiguredContentType(string path)
|
|
{
|
|
{
|
|
return GetContentTypeOverride(path, false);
|
|
return GetContentTypeOverride(path, false);
|
|
}
|
|
}
|
|
|
|
|
|
- public string GetConfiguredContentType(BaseItem item, bool inheritConfiguredPath)
|
|
|
|
|
|
+ public CollectionType? GetConfiguredContentType(BaseItem item, bool inheritConfiguredPath)
|
|
{
|
|
{
|
|
if (item is ICollectionFolder collectionFolder)
|
|
if (item is ICollectionFolder collectionFolder)
|
|
{
|
|
{
|
|
@@ -2124,16 +2116,21 @@ namespace Emby.Server.Implementations.Library
|
|
return GetContentTypeOverride(item.ContainingFolderPath, inheritConfiguredPath);
|
|
return GetContentTypeOverride(item.ContainingFolderPath, inheritConfiguredPath);
|
|
}
|
|
}
|
|
|
|
|
|
- private string GetContentTypeOverride(string path, bool inherit)
|
|
|
|
|
|
+ private CollectionType? GetContentTypeOverride(string path, bool inherit)
|
|
{
|
|
{
|
|
var nameValuePair = _configurationManager.Configuration.ContentTypes
|
|
var nameValuePair = _configurationManager.Configuration.ContentTypes
|
|
.FirstOrDefault(i => _fileSystem.AreEqual(i.Name, path)
|
|
.FirstOrDefault(i => _fileSystem.AreEqual(i.Name, path)
|
|
|| (inherit && !string.IsNullOrEmpty(i.Name)
|
|
|| (inherit && !string.IsNullOrEmpty(i.Name)
|
|
&& _fileSystem.ContainsSubPath(i.Name, path)));
|
|
&& _fileSystem.ContainsSubPath(i.Name, path)));
|
|
- return nameValuePair?.Value;
|
|
|
|
|
|
+ if (Enum.TryParse<CollectionType>(nameValuePair?.Value, out var collectionType))
|
|
|
|
+ {
|
|
|
|
+ return collectionType;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return null;
|
|
}
|
|
}
|
|
|
|
|
|
- private string GetTopFolderContentType(BaseItem item)
|
|
|
|
|
|
+ private CollectionType? GetTopFolderContentType(BaseItem item)
|
|
{
|
|
{
|
|
if (item is null)
|
|
if (item is null)
|
|
{
|
|
{
|
|
@@ -2155,13 +2152,13 @@ namespace Emby.Server.Implementations.Library
|
|
.OfType<ICollectionFolder>()
|
|
.OfType<ICollectionFolder>()
|
|
.Where(i => string.Equals(i.Path, item.Path, StringComparison.OrdinalIgnoreCase) || i.PhysicalLocations.Contains(item.Path))
|
|
.Where(i => string.Equals(i.Path, item.Path, StringComparison.OrdinalIgnoreCase) || i.PhysicalLocations.Contains(item.Path))
|
|
.Select(i => i.CollectionType)
|
|
.Select(i => i.CollectionType)
|
|
- .FirstOrDefault(i => !string.IsNullOrEmpty(i));
|
|
|
|
|
|
+ .FirstOrDefault(i => i is not null);
|
|
}
|
|
}
|
|
|
|
|
|
public UserView GetNamedView(
|
|
public UserView GetNamedView(
|
|
User user,
|
|
User user,
|
|
string name,
|
|
string name,
|
|
- string viewType,
|
|
|
|
|
|
+ CollectionType? viewType,
|
|
string sortName)
|
|
string sortName)
|
|
{
|
|
{
|
|
return GetNamedView(user, name, Guid.Empty, viewType, sortName);
|
|
return GetNamedView(user, name, Guid.Empty, viewType, sortName);
|
|
@@ -2169,13 +2166,13 @@ namespace Emby.Server.Implementations.Library
|
|
|
|
|
|
public UserView GetNamedView(
|
|
public UserView GetNamedView(
|
|
string name,
|
|
string name,
|
|
- string viewType,
|
|
|
|
|
|
+ CollectionType viewType,
|
|
string sortName)
|
|
string sortName)
|
|
{
|
|
{
|
|
var path = Path.Combine(
|
|
var path = Path.Combine(
|
|
_configurationManager.ApplicationPaths.InternalMetadataPath,
|
|
_configurationManager.ApplicationPaths.InternalMetadataPath,
|
|
"views",
|
|
"views",
|
|
- _fileSystem.GetValidFilename(viewType));
|
|
|
|
|
|
+ _fileSystem.GetValidFilename(viewType.ToString()));
|
|
|
|
|
|
var id = GetNewItemId(path + "_namedview_" + name, typeof(UserView));
|
|
var id = GetNewItemId(path + "_namedview_" + name, typeof(UserView));
|
|
|
|
|
|
@@ -2215,13 +2212,13 @@ namespace Emby.Server.Implementations.Library
|
|
User user,
|
|
User user,
|
|
string name,
|
|
string name,
|
|
Guid parentId,
|
|
Guid parentId,
|
|
- string viewType,
|
|
|
|
|
|
+ CollectionType? viewType,
|
|
string sortName)
|
|
string sortName)
|
|
{
|
|
{
|
|
var parentIdString = parentId.Equals(default)
|
|
var parentIdString = parentId.Equals(default)
|
|
? null
|
|
? null
|
|
: parentId.ToString("N", CultureInfo.InvariantCulture);
|
|
: parentId.ToString("N", CultureInfo.InvariantCulture);
|
|
- var idValues = "38_namedview_" + name + user.Id.ToString("N", CultureInfo.InvariantCulture) + (parentIdString ?? string.Empty) + (viewType ?? string.Empty);
|
|
|
|
|
|
+ var idValues = "38_namedview_" + name + user.Id.ToString("N", CultureInfo.InvariantCulture) + (parentIdString ?? string.Empty) + (viewType?.ToString() ?? string.Empty);
|
|
|
|
|
|
var id = GetNewItemId(idValues, typeof(UserView));
|
|
var id = GetNewItemId(idValues, typeof(UserView));
|
|
|
|
|
|
@@ -2277,7 +2274,7 @@ namespace Emby.Server.Implementations.Library
|
|
|
|
|
|
public UserView GetShadowView(
|
|
public UserView GetShadowView(
|
|
BaseItem parent,
|
|
BaseItem parent,
|
|
- string viewType,
|
|
|
|
|
|
+ CollectionType? viewType,
|
|
string sortName)
|
|
string sortName)
|
|
{
|
|
{
|
|
ArgumentNullException.ThrowIfNull(parent);
|
|
ArgumentNullException.ThrowIfNull(parent);
|
|
@@ -2285,7 +2282,7 @@ namespace Emby.Server.Implementations.Library
|
|
var name = parent.Name;
|
|
var name = parent.Name;
|
|
var parentId = parent.Id;
|
|
var parentId = parent.Id;
|
|
|
|
|
|
- var idValues = "38_namedview_" + name + parentId + (viewType ?? string.Empty);
|
|
|
|
|
|
+ var idValues = "38_namedview_" + name + parentId + (viewType?.ToString() ?? string.Empty);
|
|
|
|
|
|
var id = GetNewItemId(idValues, typeof(UserView));
|
|
var id = GetNewItemId(idValues, typeof(UserView));
|
|
|
|
|
|
@@ -2342,7 +2339,7 @@ namespace Emby.Server.Implementations.Library
|
|
public UserView GetNamedView(
|
|
public UserView GetNamedView(
|
|
string name,
|
|
string name,
|
|
Guid parentId,
|
|
Guid parentId,
|
|
- string viewType,
|
|
|
|
|
|
+ CollectionType? viewType,
|
|
string sortName,
|
|
string sortName,
|
|
string uniqueId)
|
|
string uniqueId)
|
|
{
|
|
{
|
|
@@ -2351,7 +2348,7 @@ namespace Emby.Server.Implementations.Library
|
|
var parentIdString = parentId.Equals(default)
|
|
var parentIdString = parentId.Equals(default)
|
|
? null
|
|
? null
|
|
: parentId.ToString("N", CultureInfo.InvariantCulture);
|
|
: parentId.ToString("N", CultureInfo.InvariantCulture);
|
|
- var idValues = "37_namedview_" + name + (parentIdString ?? string.Empty) + (viewType ?? string.Empty);
|
|
|
|
|
|
+ var idValues = "37_namedview_" + name + (parentIdString ?? string.Empty) + (viewType?.ToString() ?? string.Empty);
|
|
if (!string.IsNullOrEmpty(uniqueId))
|
|
if (!string.IsNullOrEmpty(uniqueId))
|
|
{
|
|
{
|
|
idValues += uniqueId;
|
|
idValues += uniqueId;
|
|
@@ -2386,7 +2383,7 @@ namespace Emby.Server.Implementations.Library
|
|
isNew = true;
|
|
isNew = true;
|
|
}
|
|
}
|
|
|
|
|
|
- if (!string.Equals(viewType, item.ViewType, StringComparison.OrdinalIgnoreCase))
|
|
|
|
|
|
+ if (viewType != item.ViewType)
|
|
{
|
|
{
|
|
item.ViewType = viewType;
|
|
item.ViewType = viewType;
|
|
item.UpdateToRepositoryAsync(ItemUpdateType.MetadataEdit, CancellationToken.None).GetAwaiter().GetResult();
|
|
item.UpdateToRepositoryAsync(ItemUpdateType.MetadataEdit, CancellationToken.None).GetAwaiter().GetResult();
|
|
@@ -2858,7 +2855,7 @@ namespace Emby.Server.Implementations.Library
|
|
{
|
|
{
|
|
var path = Path.Combine(virtualFolderPath, collectionType.ToString().ToLowerInvariant() + ".collection");
|
|
var path = Path.Combine(virtualFolderPath, collectionType.ToString().ToLowerInvariant() + ".collection");
|
|
|
|
|
|
- File.WriteAllBytes(path, Array.Empty<byte>());
|
|
|
|
|
|
+ await File.WriteAllBytesAsync(path, Array.Empty<byte>()).ConfigureAwait(false);
|
|
}
|
|
}
|
|
|
|
|
|
CollectionFolder.SaveLibraryOptions(virtualFolderPath, options);
|
|
CollectionFolder.SaveLibraryOptions(virtualFolderPath, options);
|
|
@@ -2900,9 +2897,18 @@ namespace Emby.Server.Implementations.Library
|
|
var saveEntity = false;
|
|
var saveEntity = false;
|
|
var personEntity = GetPerson(person.Name);
|
|
var personEntity = GetPerson(person.Name);
|
|
|
|
|
|
- // if PresentationUniqueKey is empty it's likely a new item.
|
|
|
|
- if (string.IsNullOrEmpty(personEntity.PresentationUniqueKey))
|
|
|
|
|
|
+ if (personEntity is null)
|
|
{
|
|
{
|
|
|
|
+ var path = Person.GetPath(person.Name);
|
|
|
|
+ personEntity = new Person()
|
|
|
|
+ {
|
|
|
|
+ Name = person.Name,
|
|
|
|
+ Id = GetItemByNameId<Person>(path),
|
|
|
|
+ DateCreated = DateTime.UtcNow,
|
|
|
|
+ DateModified = DateTime.UtcNow,
|
|
|
|
+ Path = path
|
|
|
|
+ };
|
|
|
|
+
|
|
personEntity.PresentationUniqueKey = personEntity.CreatePresentationUniqueKey();
|
|
personEntity.PresentationUniqueKey = personEntity.CreatePresentationUniqueKey();
|
|
saveEntity = true;
|
|
saveEntity = true;
|
|
}
|
|
}
|
|
@@ -3135,7 +3141,7 @@ namespace Emby.Server.Implementations.Library
|
|
}
|
|
}
|
|
|
|
|
|
var shortcut = _fileSystem.GetFilePaths(virtualFolderPath, true)
|
|
var shortcut = _fileSystem.GetFilePaths(virtualFolderPath, true)
|
|
- .Where(i => string.Equals(ShortcutFileExtension, Path.GetExtension(i), StringComparison.OrdinalIgnoreCase))
|
|
|
|
|
|
+ .Where(i => Path.GetExtension(i.AsSpan()).Equals(ShortcutFileExtension, StringComparison.OrdinalIgnoreCase))
|
|
.FirstOrDefault(f => _appHost.ExpandVirtualPath(_fileSystem.ResolveShortcut(f)).Equals(mediaPath, StringComparison.OrdinalIgnoreCase));
|
|
.FirstOrDefault(f => _appHost.ExpandVirtualPath(_fileSystem.ResolveShortcut(f)).Equals(mediaPath, StringComparison.OrdinalIgnoreCase));
|
|
|
|
|
|
if (!string.IsNullOrEmpty(shortcut))
|
|
if (!string.IsNullOrEmpty(shortcut))
|