|
|
|
@ -491,6 +491,8 @@ namespace Emby.Dlna.ContentDirectory
|
|
|
|
|
return GetGenreItems(item, null, user, sort, startIndex, limit);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!stubType.HasValue || stubType.Value != StubType.Folder)
|
|
|
|
|
{
|
|
|
|
|
var collectionFolder = item as ICollectionFolder;
|
|
|
|
|
if (collectionFolder != null && string.Equals(CollectionType.Music, collectionFolder.CollectionType, StringComparison.OrdinalIgnoreCase))
|
|
|
|
|
{
|
|
|
|
@ -505,6 +507,13 @@ namespace Emby.Dlna.ContentDirectory
|
|
|
|
|
return GetTvFolders(item, user, stubType, sort, startIndex, limit);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var userView = item as UserView;
|
|
|
|
|
if (userView != null && string.Equals(CollectionType.Folders, userView.ViewType, StringComparison.OrdinalIgnoreCase))
|
|
|
|
|
{
|
|
|
|
|
return GetFolders(item, user, stubType, sort, startIndex, limit);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (stubType.HasValue)
|
|
|
|
|
{
|
|
|
|
|
var person = item as Person;
|
|
|
|
@ -513,8 +522,11 @@ namespace Emby.Dlna.ContentDirectory
|
|
|
|
|
return GetItemsFromPerson(person, user, startIndex, limit);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (stubType.Value != StubType.Folder)
|
|
|
|
|
{
|
|
|
|
|
return ApplyPaging(new QueryResult<ServerItem>(), startIndex, limit);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var folder = (Folder)item;
|
|
|
|
|
|
|
|
|
@ -733,6 +745,23 @@ namespace Emby.Dlna.ContentDirectory
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private QueryResult<ServerItem> GetFolders(BaseItem item, User user, StubType? stubType, SortCriteria sort, int? startIndex, int? limit)
|
|
|
|
|
{
|
|
|
|
|
var folders = user.RootFolder.GetChildren(user, true)
|
|
|
|
|
.OrderBy(i => i.SortName)
|
|
|
|
|
.Select(i => new ServerItem(i)
|
|
|
|
|
{
|
|
|
|
|
StubType = StubType.Folder
|
|
|
|
|
})
|
|
|
|
|
.ToArray();
|
|
|
|
|
|
|
|
|
|
return new QueryResult<ServerItem>
|
|
|
|
|
{
|
|
|
|
|
Items = folders,
|
|
|
|
|
TotalRecordCount = folders.Length
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private QueryResult<ServerItem> GetTvFolders(BaseItem item, User user, StubType? stubType, SortCriteria sort, int? startIndex, int? limit)
|
|
|
|
|
{
|
|
|
|
|
var query = new InternalItemsQuery(user)
|
|
|
|
|