Chromecast currently uses mdns for autodiscovery (and MPD supports it). However handling discovering within the chromecast source leaves something to be desired:
the checkConnection and testAuth stages are bypassed due to having multiple connection
connection testing is still done but had to be implemented speparately
a lot of work went into converting found devices into a "per-device" data structure for use with multiPlatform even though it doesn't really work that way
This same work would need to be done to implement auto-discovery for MPD...it would be a duplication of effort while not utilizing the existing logic for sources.
Instead, we should implement a "discovery manager" service that generates ephemeral sources from auto-discovered devices using the config for that source as a base. This would enable re-using all the stage logic. We could additionally have a removeAfterIdle option for the source to delete the ephemeral source if it disappears for X minutes so that the dashboard and overall list of sources stays lean in the event many short-lived devices are found.
Things to think about:
[ ] discovery manager needs a place to live in the ms lifecycle
[ ] task schedule for re-discovery and pruning after idle
[ ] sources need to be marked as ephemeral
what does this entail for dashboard usage?
[ ] managing deduplication between explicitly configured source and auto-discovered (need to require a unique id is derived)
[ ] Determine and document differences between device discovery and single source with multi-platform devices
Chromecast currently uses mdns for autodiscovery (and MPD supports it). However handling discovering within the chromecast source leaves something to be desired:
multiPlatform
even though it doesn't really work that wayThis same work would need to be done to implement auto-discovery for MPD...it would be a duplication of effort while not utilizing the existing logic for sources.
Instead, we should implement a "discovery manager" service that generates ephemeral sources from auto-discovered devices using the config for that source as a base. This would enable re-using all the stage logic. We could additionally have a
removeAfterIdle
option for the source to delete the ephemeral source if it disappears for X minutes so that the dashboard and overall list of sources stays lean in the event many short-lived devices are found.Things to think about: