mirror of
https://github.com/yattee/yattee.git
synced 2026-10-23 13:12:53 +00:00
Prefer the active instance when selecting a playback instance
This commit is contained in:
@@ -299,9 +299,19 @@ final class InstancesManager {
|
||||
// Extracted content requires Yattee Server (yt-dlp)
|
||||
return yatteeServerInstances.first
|
||||
case .global, .federated:
|
||||
// YouTube content - prefer Yattee Server, fall back to other YouTube-capable instances
|
||||
return enabledYatteeServerInstances.first
|
||||
?? enabledInstances.first(where: \.isYouTubeInstance)
|
||||
// YouTube content - prefer Yattee Server (the active one if it is one),
|
||||
// then the active instance, then any other YouTube-capable instance
|
||||
let active = activeInstance
|
||||
if let active, active.isYatteeServerInstance {
|
||||
return active
|
||||
}
|
||||
if let yatteeServer = enabledYatteeServerInstances.first {
|
||||
return yatteeServer
|
||||
}
|
||||
if let active, active.isYouTubeInstance {
|
||||
return active
|
||||
}
|
||||
return enabledInstances.first(where: \.isYouTubeInstance)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user