Focus chrome was implemented twice, once in the focusable wrapper and once in the focus builders; both now go through FocusChrome. TvColorPicker's channel row was a copy of TvNumberSpinner and is now that widget in compact density. Also trims unused helpers and fields and simplifies the Jellyfin browse paths.
22 lines
769 B
Dart
22 lines
769 B
Dart
/// Utility class for parsing Plex API cache responses
|
|
///
|
|
/// Provides consistent extraction of MediaContainer data across the codebase.
|
|
class PlexCacheParser {
|
|
PlexCacheParser._();
|
|
|
|
static Map<String, dynamic>? extractMediaContainer(Map<String, dynamic>? cached) {
|
|
final container = cached?['MediaContainer'];
|
|
return container is Map<String, dynamic> ? container : null;
|
|
}
|
|
|
|
static List<dynamic>? extractMetadataList(Map<String, dynamic>? cached) {
|
|
return extractMediaContainer(cached)?['Metadata'] as List?;
|
|
}
|
|
|
|
static Map<String, dynamic>? extractFirstMetadata(Map<String, dynamic>? cached) {
|
|
final list = extractMetadataList(cached);
|
|
if (list == null || list.isEmpty) return null;
|
|
return list.first as Map<String, dynamic>;
|
|
}
|
|
}
|