feat: transcoding

This commit is contained in:
edde746
2026-04-22 21:07:12 +02:00
parent 05aeee1124
commit c10cf55f2d
51 changed files with 1712 additions and 145 deletions
+11 -1
View File
@@ -94,9 +94,18 @@ class MultiServerManager {
final storage = await StorageService.getInstance();
final cachedEndpoint = storage.getServerEndpoint(serverId);
// The connection race already hits `/` on the winning endpoint — capture
// `transcoderVideo` from that response so PlexClient.create can skip the
// redundant warm-up probe.
bool? observedTranscoderVideo;
// Find best working connection, passing cached endpoint for fast-path
final streamIterator = StreamIterator(
server.findBestWorkingConnection(preferredUri: cachedEndpoint, clientIdentifier: clientIdentifier),
server.findBestWorkingConnection(
preferredUri: cachedEndpoint,
clientIdentifier: clientIdentifier,
onTranscoderCapability: (b) => observedTranscoderVideo = b,
),
);
if (!await streamIterator.moveNext()) {
@@ -124,6 +133,7 @@ class MultiServerManager {
appLogger.i('Updated endpoint for ${server.name} after failover: $newUrl');
},
onAllEndpointsExhausted: () => _onServerEndpointsExhausted(serverId),
seedTranscoderVideoSupport: observedTranscoderVideo,
);
// Save the initial endpoint