Hide music libraries from app (Issue #20)

- Filter out artist-type libraries in libraries_screen.dart
- Add safety check in media_card.dart to prevent music playback attempts
- Filter music content from getOnDeck() and getRecentlyAdded() in plex_client.dart

Music libraries are now hidden throughout the app since music playback
is not yet supported. This focuses the app on video content (movies and TV shows).
This commit is contained in:
Sam Matthews
2025-11-04 15:49:00 +00:00
parent 3a5b812a22
commit 1ec9fbcc02
3 changed files with 37 additions and 5 deletions
+16 -4
View File
@@ -333,23 +333,35 @@ class PlexClient {
return results;
}
/// Get recently added media
/// Get recently added media (filtered to video content only)
Future<List<PlexMetadata>> getRecentlyAdded({int limit = 50}) async {
final response = await _dio.get(
'/library/recentlyAdded',
queryParameters: {'X-Plex-Container-Size': limit, 'includeGuids': 1},
);
return _extractMetadataList(response);
final allItems = _extractMetadataList(response);
// Filter out music content (artists, albums, tracks)
return allItems.where((item) {
final type = item.type.toLowerCase();
return type != 'artist' && type != 'album' && type != 'track';
}).toList();
}
/// Get on deck items (continue watching)
/// Get on deck items (continue watching, filtered to video content only)
Future<List<PlexMetadata>> getOnDeck() async {
final response = await _dio.get('/library/onDeck');
final container = _getMediaContainer(response);
if (container != null && container['Metadata'] != null) {
return (container['Metadata'] as List)
final allItems = (container['Metadata'] as List)
.map((json) => PlexMetadata.fromJsonWithImages(json))
.toList();
// Filter out music content (artists, albums, tracks)
return allItems.where((item) {
final type = item.type.toLowerCase();
return type != 'artist' && type != 'album' && type != 'track';
}).toList();
}
return [];
}