aboutsummaryrefslogtreecommitdiff
path: root/Emby.Dlna/ContentDirectory/ControlHandler.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Emby.Dlna/ContentDirectory/ControlHandler.cs')
-rw-r--r--Emby.Dlna/ContentDirectory/ControlHandler.cs25
1 files changed, 25 insertions, 0 deletions
diff --git a/Emby.Dlna/ContentDirectory/ControlHandler.cs b/Emby.Dlna/ContentDirectory/ControlHandler.cs
index 96b282d04..5ce1d1925 100644
--- a/Emby.Dlna/ContentDirectory/ControlHandler.cs
+++ b/Emby.Dlna/ContentDirectory/ControlHandler.cs
@@ -487,6 +487,11 @@ namespace Emby.Dlna.ContentDirectory
return GetMusicArtistItems(item, null, user, sort, startIndex, limit);
}
+ if (item is Genre)
+ {
+ return GetGenreItems(item, null, user, sort, startIndex, limit);
+ }
+
var collectionFolder = item as ICollectionFolder;
if (collectionFolder != null && string.Equals(CollectionType.Music, collectionFolder.CollectionType, StringComparison.OrdinalIgnoreCase))
{
@@ -1173,6 +1178,26 @@ namespace Emby.Dlna.ContentDirectory
return ToResult(result);
}
+ private QueryResult<ServerItem> GetGenreItems(BaseItem item, Guid? parentId, User user, SortCriteria sort, int? startIndex, int? limit)
+ {
+ var query = new InternalItemsQuery(user)
+ {
+ Recursive = true,
+ ParentId = parentId,
+ GenreIds = new[] { item.Id.ToString("N") },
+ IncludeItemTypes = new[] { typeof(Movie).Name, typeof(Series).Name },
+ Limit = limit,
+ StartIndex = startIndex,
+ DtoOptions = GetDtoOptions()
+ };
+
+ SetSorting(query, sort, false);
+
+ var result = _libraryManager.GetItemsResult(query);
+
+ return ToResult(result);
+ }
+
private QueryResult<ServerItem> GetMusicGenreItems(BaseItem item, Guid? parentId, User user, SortCriteria sort, int? startIndex, int? limit)
{
var query = new InternalItemsQuery(user)