pull/1154/head
Luke Pulverenti 7 years ago
parent 39418b4172
commit d52b0de146

@ -491,6 +491,8 @@ namespace Emby.Dlna.ContentDirectory
return GetGenreItems(item, null, user, sort, startIndex, limit); return GetGenreItems(item, null, user, sort, startIndex, limit);
} }
if (!stubType.HasValue || stubType.Value != StubType.Folder)
{
var collectionFolder = item as ICollectionFolder; var collectionFolder = item as ICollectionFolder;
if (collectionFolder != null && string.Equals(CollectionType.Music, collectionFolder.CollectionType, StringComparison.OrdinalIgnoreCase)) 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); 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) if (stubType.HasValue)
{ {
var person = item as Person; var person = item as Person;
@ -513,8 +522,11 @@ namespace Emby.Dlna.ContentDirectory
return GetItemsFromPerson(person, user, startIndex, limit); return GetItemsFromPerson(person, user, startIndex, limit);
} }
if (stubType.Value != StubType.Folder)
{
return ApplyPaging(new QueryResult<ServerItem>(), startIndex, limit); return ApplyPaging(new QueryResult<ServerItem>(), startIndex, limit);
} }
}
var folder = (Folder)item; 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) private QueryResult<ServerItem> GetTvFolders(BaseItem item, User user, StubType? stubType, SortCriteria sort, int? startIndex, int? limit)
{ {
var query = new InternalItemsQuery(user) var query = new InternalItemsQuery(user)

@ -1,3 +1,3 @@
using System.Reflection; using System.Reflection;
[assembly: AssemblyVersion("3.2.36.15")] [assembly: AssemblyVersion("3.2.40.0")]

Loading…
Cancel
Save