add device capability bitmask checks

This commit is contained in:
bwees 2025-06-05 11:25:43 -05:00
parent 5621ceb2d6
commit 032f1165f5
No known key found for this signature in database

View File

@ -270,6 +270,8 @@ class GCastService implements ICastDestinationService {
currentAssetId = null;
}
bool isDisplay(int ca) => (ca & 0x01) != 0;
@override
Future<List<(String, CastDestinationType, dynamic)>> getDevices() async {
final dests = await _gCastRepository.listDestinations();
@ -282,7 +284,11 @@ class GCastService implements ICastDestinationService {
device
),
)
.where((device) => device.$3.extras["md"] != "Chromecast Audio")
.toList(growable: false);
.where((device) {
final caString = device.$3.extras["ca"];
final caNumber = int.tryParse(caString ?? "0") ?? 0;
return isDisplay(caNumber);
}).toList(growable: false);
}
}