fix(libraries): filter content-type-less Jellyfin roots

This commit is contained in:
edde746
2026-07-25 17:38:09 +02:00
parent c1cfb9609e
commit 96fd47a160
4 changed files with 30 additions and 25 deletions
+10 -8
View File
@@ -474,18 +474,20 @@ void main() {
}
});
test('maps mixed collections to a movie and show root browse', () {
final mixed = JellyfinMappers.library({
'Id': 'view-mixed',
'Name': 'Mixed',
'CollectionType': 'mixed',
}, serverId: ServerId(_serverId))!;
expect(mixed.kind, MediaKind.unknown);
expect(mixed.defaultBrowseKinds, const [MediaKind.movie, MediaKind.show]);
test('maps content-type-less collection folders to a movie and show root browse', () {
for (final view in [
{'Id': 'view-missing-type', 'Name': 'Mixed', 'Type': 'CollectionFolder', 'IsFolder': true},
{'Id': 'view-empty-type', 'Name': 'Mixed', 'Type': 'CollectionFolder', 'CollectionType': '', 'IsFolder': true},
]) {
final mixed = JellyfinMappers.library(view, serverId: ServerId(_serverId))!;
expect(mixed.kind, MediaKind.folder);
expect(mixed.defaultBrowseKinds, const [MediaKind.movie, MediaKind.show]);
}
final unrecognised = JellyfinMappers.library({
'Id': 'view-books',
'Name': 'Books',
'Type': 'CollectionFolder',
'CollectionType': 'books',
}, serverId: ServerId(_serverId))!;
expect(unrecognised.kind, MediaKind.unknown);