Skip to content

Music albums not visible via DLNA when browsing music libraries (aggregated folders + IsFavorite filter issues) #200

@Stlouislee

Description

@Stlouislee

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:

  1. 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.

  2. 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:

query.Parent = item;

This fails for CollectionFolder types because the albums' actual parent is a physical subfolder, not the CollectionFolder itself.

Proposed Fix

  1. Change IsFavorite assignment from:

    query.IsFavorite = isFavorite;

    to:

    query.IsFavorite = isFavorite ? true : null;
  2. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions