DiscoveryService

class DiscoveryService(jellyfin: Jellyfin)

Service for discovery related functionality.

Constructors

DiscoveryService
Link copied to clipboard
fun DiscoveryService(jellyfin: Jellyfin)

Functions

discoverLocalServers
Link copied to clipboard
fun discoverLocalServers(timeout: Int = LocalServerDiscovery.DISCOVERY_TIMEOUT, maxServers: Int = LocalServerDiscovery.DISCOVERY_MAX_SERVERS): Flow<ServerDiscoveryInfo>

Discover servers on the local network. Uses the discoveryBroadcastAddressesProvider to find local devices to query.

getAddressCandidates
Link copied to clipboard
fun getAddressCandidates(input: String): List<String>

Parses the given input and tries to fix common mistakes. The returned candidates are in order of most secure followed by most likely to work.

getRecommendedServers
Link copied to clipboard
suspend fun getRecommendedServers(input: String, minimumScore: RecommendedServerInfoScore = RecommendedServerInfoScore.BAD): Flow<RecommendedServerInfo>

Utility function that calls getRecommendedServers with the output of getAddressCandidates.

suspend fun getRecommendedServers(servers: List<String>, minimumScore: RecommendedServerInfoScore = RecommendedServerInfoScore.BAD): Flow<RecommendedServerInfo>

Connects to the servers and returns a flow of scored servers in the same order as the input. Uses the RecommendedServerDiscovery rules to determine the recommendation.