mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-06-03 06:18:28 +01:00
add Add to collection buttons
This commit is contained in:
@@ -381,11 +381,6 @@ namespace MediaBrowser.Controller.Entities
|
||||
{
|
||||
var basePath = ConfigurationManager.ApplicationPaths.InternalMetadataPath;
|
||||
|
||||
if (ConfigurationManager.Configuration.EnableLibraryMetadataSubFolder)
|
||||
{
|
||||
basePath = System.IO.Path.Combine(basePath, "library");
|
||||
}
|
||||
|
||||
return GetInternalMetadataPath(basePath);
|
||||
}
|
||||
|
||||
@@ -393,14 +388,10 @@ namespace MediaBrowser.Controller.Entities
|
||||
{
|
||||
var idString = Id.ToString("N");
|
||||
|
||||
return System.IO.Path.Combine(basePath, idString.Substring(0, 2), idString);
|
||||
}
|
||||
|
||||
public static string GetInternalMetadataPathForId(Guid id)
|
||||
{
|
||||
var idString = id.ToString("N");
|
||||
|
||||
var basePath = ConfigurationManager.ApplicationPaths.InternalMetadataPath;
|
||||
if (ConfigurationManager.Configuration.EnableLibraryMetadataSubFolder)
|
||||
{
|
||||
basePath = System.IO.Path.Combine(basePath, "library");
|
||||
}
|
||||
|
||||
return System.IO.Path.Combine(basePath, idString.Substring(0, 2), idString);
|
||||
}
|
||||
|
||||
@@ -117,7 +117,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
return await GetGameView(user, queryParent, query).ConfigureAwait(false);
|
||||
|
||||
case CollectionType.BoxSets:
|
||||
return GetResult(GetMediaFolders(user).SelectMany(i => i.GetRecursiveChildren(user)).OfType<BoxSet>(), queryParent, query);
|
||||
return await GetBoxsetView(queryParent, user, query).ConfigureAwait(false);
|
||||
|
||||
case CollectionType.TvShows:
|
||||
return await GetTvView(queryParent, user, query).ConfigureAwait(false);
|
||||
@@ -526,6 +526,22 @@ namespace MediaBrowser.Controller.Entities
|
||||
return GetResult(items, queryParent, query);
|
||||
}
|
||||
|
||||
private async Task<QueryResult<BaseItem>> GetBoxsetView(Folder parent, User user, InternalItemsQuery query)
|
||||
{
|
||||
return GetResult(GetMediaFolders(user).SelectMany(i =>
|
||||
{
|
||||
var hasCollectionType = i as ICollectionFolder;
|
||||
|
||||
if (hasCollectionType != null && string.Equals(hasCollectionType.CollectionType, CollectionType.BoxSets, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return i.GetChildren(user, true);
|
||||
}
|
||||
|
||||
return i.GetRecursiveChildren(user);
|
||||
|
||||
}).OfType<BoxSet>(), parent, query);
|
||||
}
|
||||
|
||||
private async Task<QueryResult<BaseItem>> GetTvView(Folder parent, User user, InternalItemsQuery query)
|
||||
{
|
||||
if (query.Recursive)
|
||||
|
||||
Reference in New Issue
Block a user