DiscoveryService

class DiscoveryService(jellyfin: Jellyfin)

Service for discovery related functionality.

Constructors

Link copied to clipboard
fun DiscoveryService(jellyfin: Jellyfin)

Functions

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

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

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.

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

Utility function that calls getRecommendedServers with the output of getAddressCandidates.

suspend fun getRecommendedServers(servers: List<String>, minimumScore: RecommendedServerInfoScore = RecommendedServerInfoScore.BAD): <ERROR CLASS><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.