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