@@ -325,9 +325,18 @@ class _DiscoverScreenState extends State<DiscoverScreen>
|
||||
// Wait for libraries and then fetch hubs
|
||||
final librariesByServer = await librariesFuture;
|
||||
|
||||
// Fetch hubs using the pre-fetched libraries
|
||||
// Get hidden libraries to filter from hubs
|
||||
final hiddenLibrariesProvider = Provider.of<HiddenLibrariesProvider>(
|
||||
context,
|
||||
listen: false,
|
||||
);
|
||||
|
||||
// Fetch hubs using the pre-fetched libraries and hidden keys
|
||||
final allHubs = await multiServerProvider.aggregationService
|
||||
.getHubsFromAllServers(librariesByServer: librariesByServer);
|
||||
.getHubsFromAllServers(
|
||||
librariesByServer: librariesByServer,
|
||||
hiddenLibraryKeys: hiddenLibrariesProvider.hiddenLibraryKeys,
|
||||
);
|
||||
|
||||
// Filter out duplicate hubs that we already fetch separately
|
||||
final filteredHubs = allHubs.where((hub) {
|
||||
|
||||
@@ -134,6 +134,7 @@ class DataAggregationService {
|
||||
Future<List<PlexHub>> getHubsFromAllServers({
|
||||
int? limit,
|
||||
Map<String, List<PlexLibrary>>? librariesByServer,
|
||||
Set<String>? hiddenLibraryKeys,
|
||||
}) async {
|
||||
final clients = _serverManager.onlineClients;
|
||||
|
||||
@@ -171,6 +172,11 @@ class DataAggregationService {
|
||||
if (library.hidden != null && library.hidden != 0) {
|
||||
return false;
|
||||
}
|
||||
// Check app-level hidden libraries
|
||||
if (hiddenLibraryKeys != null &&
|
||||
hiddenLibraryKeys.contains(library.globalKey)) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}).toList();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user