@@ -15,6 +15,10 @@ class PlexHub {
|
||||
final String? serverId; // Server machine identifier
|
||||
final String? serverName; // Server display name
|
||||
|
||||
/// When set, this hub was split from a multi-library hub and should only
|
||||
/// show items belonging to this library section.
|
||||
final int? librarySectionID;
|
||||
|
||||
PlexHub({
|
||||
required this.hubKey,
|
||||
required this.title,
|
||||
@@ -25,6 +29,7 @@ class PlexHub {
|
||||
required this.items,
|
||||
this.serverId,
|
||||
this.serverName,
|
||||
this.librarySectionID,
|
||||
});
|
||||
|
||||
factory PlexHub.fromJson(Map<String, dynamic> json) {
|
||||
|
||||
@@ -240,7 +240,13 @@ class _HubDetailScreenState extends State<HubDetailScreen>
|
||||
final client = _getClientForHub();
|
||||
|
||||
// Fetch items from the hub, tagged with server info at the source
|
||||
final items = await client.getHubContent(widget.hub.hubKey);
|
||||
var items = await client.getHubContent(widget.hub.hubKey);
|
||||
|
||||
// Filter to specific library if this hub was split from a multi-library hub
|
||||
final sectionFilter = widget.hub.librarySectionID;
|
||||
if (sectionFilter != null) {
|
||||
items = items.where((item) => item.librarySectionID == sectionFilter).toList();
|
||||
}
|
||||
|
||||
if (!mounted) return;
|
||||
setState(() {
|
||||
|
||||
@@ -350,6 +350,7 @@ class DataAggregationService {
|
||||
items: items,
|
||||
serverId: hub.serverId,
|
||||
serverName: hub.serverName,
|
||||
librarySectionID: entry.key,
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user