add Add to collection buttons

This commit is contained in:
Luke Pulverenti
2015-01-23 23:50:45 -05:00
parent 86a9df53f2
commit 1af651bc56
13 changed files with 56 additions and 41 deletions

View File

@@ -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);
}

View File

@@ -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)