Bug
When searching in the Jellyfin integration, results include both folders and the audiobooks inside them when they share the same name. For example, searching "Harry Potter" returns the folder and the audiobook, when only the audiobook should appear.
This is Jellyfin-specific — AudiobookShelf uses a dedicated /search endpoint that only returns books, so it's not affected.
Expected Behavior
Search results should only return audiobooks, not navigable folders. Folders are useful when browsing a library, but not when searching by name.
Root Cause
In JellyfinConnectionService.swift, the fetchItems method determines which item types to include based only on the recursive flag:
let itemTypes: [JellyfinAPI.BaseItemKind] = recursive ? [.audioBook] : [.audioBook, .folder]
When a search term is provided, isRecursive is set to true (line above), but itemTypes still checks the original recursive parameter — which is false for search calls. This means folders are included in search results.
Proposed Fix
let itemTypes: [JellyfinAPI.BaseItemKind] = (recursive || searchTerm != nil) ? [.audioBook] : [.audioBook, .folder]
This filters out folders when searching while preserving them for normal folder-level browsing.
Bug
When searching in the Jellyfin integration, results include both folders and the audiobooks inside them when they share the same name. For example, searching "Harry Potter" returns the folder and the audiobook, when only the audiobook should appear.
This is Jellyfin-specific — AudiobookShelf uses a dedicated
/searchendpoint that only returns books, so it's not affected.Expected Behavior
Search results should only return audiobooks, not navigable folders. Folders are useful when browsing a library, but not when searching by name.
Root Cause
In
JellyfinConnectionService.swift, thefetchItemsmethod determines which item types to include based only on therecursiveflag:When a search term is provided,
isRecursiveis set totrue(line above), butitemTypesstill checks the originalrecursiveparameter — which isfalsefor search calls. This means folders are included in search results.Proposed Fix
This filters out folders when searching while preserving them for normal folder-level browsing.