Problem
When browsing music libraries through DLNA clients, music albums may not appear correctly due to two bugs in the DLNA plugin's ControlHandler.cs:
-
IsFavorite filter bug: The isFavorite parameter defaults to false, which causes query.IsFavorite = false to be set. In Jellyfin's query system, IsFavorite = false means "show only non-favorites", not "show all items". This incorrectly filters out favorite albums from DLNA results.
-
Aggregated library folder bug: Music libraries in Jellyfin are often CollectionFolder types that aggregate multiple physical folders. The original code only queries by single Parent ID, which fails to find albums stored in different physical folders under the same music library.
Evidence
IsFavorite Filter Behavior
In Jellyfin's InternalItemsQuery.cs, IsFavorite is defined as bool? (nullable boolean):
null = no filter (show all items)
true = show only favorites
false = show only non-favorites
The repository layer in BaseItemRepository.cs uses equality comparison:
if (query.IsFavorite.HasValue)
{
whereClause += " AND UserData.IsFavorite = @IsFavorite";
}
This means passing IsFavorite = false explicitly excludes favorites, rather than applying no filter.
CollectionFolder Aggregation
In CollectionFolder.cs, music libraries can aggregate multiple physical folders via PhysicalFolderIds. The main app uses LibraryManager.SetTopParentIdsOrAncestors() to convert CollectionFolder references to physical root IDs for querying.
The DLNA plugin's original code only used:
This fails for CollectionFolder types because the albums' actual parent is a physical subfolder, not the CollectionFolder itself.
Proposed Fix
-
Change IsFavorite assignment from:
query.IsFavorite = isFavorite;
to:
query.IsFavorite = isFavorite ? true : null;
-
Add fallback query strategies for album children:
- First try
Folder.GetItems()
- Then try
LibraryManager.GetItemList() with Parent parameter
- Finally try
LibraryManager.GetItemList() with AncestorIds parameter
- For
CollectionFolder types, aggregate results from all physical library folders
Environment
- Jellyfin version: 10.11.6
- DLNA plugin version: (latest)
- Affected clients: All DLNA clients when browsing music libraries
Problem
When browsing music libraries through DLNA clients, music albums may not appear correctly due to two bugs in the DLNA plugin's
ControlHandler.cs:IsFavorite filter bug: The
isFavoriteparameter defaults tofalse, which causesquery.IsFavorite = falseto be set. In Jellyfin's query system,IsFavorite = falsemeans "show only non-favorites", not "show all items". This incorrectly filters out favorite albums from DLNA results.Aggregated library folder bug: Music libraries in Jellyfin are often
CollectionFoldertypes that aggregate multiple physical folders. The original code only queries by singleParentID, which fails to find albums stored in different physical folders under the same music library.Evidence
IsFavorite Filter Behavior
In Jellyfin's
InternalItemsQuery.cs,IsFavoriteis defined asbool?(nullable boolean):null= no filter (show all items)true= show only favoritesfalse= show only non-favoritesThe repository layer in
BaseItemRepository.csuses equality comparison:This means passing
IsFavorite = falseexplicitly excludes favorites, rather than applying no filter.CollectionFolder Aggregation
In
CollectionFolder.cs, music libraries can aggregate multiple physical folders viaPhysicalFolderIds. The main app usesLibraryManager.SetTopParentIdsOrAncestors()to convertCollectionFolderreferences to physical root IDs for querying.The DLNA plugin's original code only used:
This fails for
CollectionFoldertypes because the albums' actual parent is a physical subfolder, not theCollectionFolderitself.Proposed Fix
Change
IsFavoriteassignment from:to:
Add fallback query strategies for album children:
Folder.GetItems()LibraryManager.GetItemList()withParentparameterLibraryManager.GetItemList()withAncestorIdsparameterCollectionFoldertypes, aggregate results from all physical library foldersEnvironment