Merge pull request #3031 from MediaBrowser/dev

3.2.40.0
This commit is contained in:
Luke 2017-11-20 13:01:28 -05:00 committed by GitHub
commit 71ff88284b
2 changed files with 42 additions and 13 deletions

View File

@ -491,18 +491,27 @@ namespace Emby.Dlna.ContentDirectory
return GetGenreItems(item, null, user, sort, startIndex, limit);
}
var collectionFolder = item as ICollectionFolder;
if (collectionFolder != null && string.Equals(CollectionType.Music, collectionFolder.CollectionType, StringComparison.OrdinalIgnoreCase))
if (!stubType.HasValue || stubType.Value != StubType.Folder)
{
return GetMusicFolders(item, user, stubType, sort, startIndex, limit);
}
if (collectionFolder != null && string.Equals(CollectionType.Movies, collectionFolder.CollectionType, StringComparison.OrdinalIgnoreCase))
{
return GetMovieFolders(item, user, stubType, sort, startIndex, limit);
}
if (collectionFolder != null && string.Equals(CollectionType.TvShows, collectionFolder.CollectionType, StringComparison.OrdinalIgnoreCase))
{
return GetTvFolders(item, user, stubType, sort, startIndex, limit);
var collectionFolder = item as ICollectionFolder;
if (collectionFolder != null && string.Equals(CollectionType.Music, collectionFolder.CollectionType, StringComparison.OrdinalIgnoreCase))
{
return GetMusicFolders(item, user, stubType, sort, startIndex, limit);
}
if (collectionFolder != null && string.Equals(CollectionType.Movies, collectionFolder.CollectionType, StringComparison.OrdinalIgnoreCase))
{
return GetMovieFolders(item, user, stubType, sort, startIndex, limit);
}
if (collectionFolder != null && string.Equals(CollectionType.TvShows, collectionFolder.CollectionType, StringComparison.OrdinalIgnoreCase))
{
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)
@ -513,7 +522,10 @@ namespace Emby.Dlna.ContentDirectory
return GetItemsFromPerson(person, user, startIndex, limit);
}
return ApplyPaging(new QueryResult<ServerItem>(), 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)

View File

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