/// Utility class for parsing Plex API cache responses /// /// Provides consistent extraction of MediaContainer data across the codebase. class PlexCacheParser { PlexCacheParser._(); static List? extractMetadataList(Map? cached) { if (cached == null) return null; return cached['MediaContainer']?['Metadata'] as List?; } static Map? extractFirstMetadata(Map? cached) { final list = extractMetadataList(cached); if (list == null || list.isEmpty) return null; return list.first as Map; } static List? extractChapters(Map? cached) { final metadata = extractFirstMetadata(cached); if (metadata == null) return null; return metadata['Chapter'] as List?; } }