fix: handle Metadata as list in DVR tune response

This commit is contained in:
edde746
2026-03-09 10:52:57 +01:00
parent 425957c804
commit a3e738773b
+3 -1
View File
@@ -2350,13 +2350,15 @@ class PlexClient {
final nested = op['Metadata'];
if (nested is Map<String, dynamic>) {
metadataJson = nested;
} else if (nested is List && nested.isNotEmpty) {
metadataJson = nested.first as Map<String, dynamic>;
}
}
}
metadataJson ??= (container['Metadata'] as List?)?.firstOrNull as Map<String, dynamic>?;
if (metadataJson == null) {
appLogger.w('Tune channel: no metadata in response');
appLogger.w('Tune channel: no metadata in response (keys: ${container.keys.toList()}, subscriptions: ${subscriptions?.length}, firstSub: ${subscriptions?.firstOrNull})');
return null;
}