Compare commits

...
21 Commits
Author SHA1 Message Date
github-actions[bot] 8f24bd478a chore: bump version to 1.21.3 2026-02-26 03:32:43 +00:00
edde746 a32422bb5e chore: remove unused formatRelativeTime 2026-02-26 04:30:48 +01:00
edde746 e25fb4c10f fix: ExoPlayer resume position lost on tunneling change 2026-02-26 04:19:17 +01:00
edde746 5740d93a35 fix: download from homepage failing 2026-02-26 03:41:27 +01:00
edde746 98776b40f5 fix: show sync controls as compact top bar
close #548
2026-02-26 03:41:19 +01:00
edde746 3418241c04 fix: disable tunneling for FFmpeg-only audio codecs 2026-02-26 02:14:22 +01:00
edde746 659b59d450 fix: remove companion remote connection history 2026-02-26 01:08:46 +01:00
edde746 acf91107ad fix: split combined recently added hubs by library
closes #552
2026-02-26 00:30:23 +01:00
edde746 3279bc7578 fix: sanitize dots in download filenames
close #556
2026-02-26 00:02:14 +01:00
edde746 383351d769 fix: detect invalid tokens and prevent startup hangs
close #553
2026-02-25 23:59:19 +01:00
edde746 0f4920cc18 fix: reduce ExoPlayer buffer limits
close #546
2026-02-25 23:43:43 +01:00
edde746 3460fa8b32 fix: download retry failing with metadata cache miss
close #555
2026-02-25 23:25:10 +01:00
edde746 bf3f5282f2 fix: skip intro button staying on screen
close #550
2026-02-25 23:03:07 +01:00
edde746 c480e44e0e fix: skeleton card visibility and layout 2026-02-25 22:54:15 +01:00
edde746 728c4854a5 feat: sparse-map pagination for library browse 2026-02-25 18:14:48 +01:00
edde746 6188d21c3d perf: limit concurrent image transcode requests 2026-02-25 17:01:43 +01:00
edde746 88d7e2d319 feat: add audio passthrough toggle for desktop 2026-02-25 16:38:58 +01:00
edde746 fc5fcbb0db fix: google tv virtual remote dpad 2026-02-25 16:13:53 +01:00
edde746 93f693c5c4 fix: macos folder picker entitlement 2026-02-25 15:59:06 +01:00
edde746andGitHub aa6a5ec234 docs: update HDR platform support info 2026-02-25 15:18:39 +01:00
github-actions[bot] 4f4192b261 chore: update cask to 1.21.2 2026-02-25 09:03:19 +00:00
58 changed files with 1211 additions and 1019 deletions
+2 -2
View File
@@ -1,6 +1,6 @@
cask "plezy" do
version "1.21.0"
sha256 "aae91bb766d2726a79a87b124a070c402106a627feacfd34b840ad14a43fd00a"
version "1.21.2"
sha256 "65dd027f58b92e9c41601b11b9603a4ba76b15947913164398577fb476021b8b"
url "https://github.com/edde746/plezy/releases/download/#{version}/plezy-macos.dmg"
name "Plezy"
+1 -1
View File
@@ -41,7 +41,7 @@ A modern Plex client for desktop and mobile. Built with Flutter for native perfo
### 🎬 Playback
- Wide codec support (HEVC, AV1, VP9, and more)
- HDR and Dolby Vision (iOS, macOS, Windows)
- HDR and Dolby Vision (not Linux)
- Full ASS/SSA subtitle support
- Audio and subtitle preferences synced with Plex profile
- Progress sync and resume
@@ -9,6 +9,8 @@ import android.app.PictureInPictureParams
import android.content.Context
import android.content.res.Configuration
import android.util.Rational
import android.view.KeyEvent
import android.view.ViewGroup
import androidx.core.content.FileProvider
import io.flutter.embedding.android.FlutterActivity
import io.flutter.embedding.android.RenderMode
@@ -25,6 +27,7 @@ class MainActivity : FlutterActivity() {
private val PIP_CHANNEL = "app.plezy/pip"
private val EXTERNAL_PLAYER_CHANNEL = "app.plezy/external_player"
private var watchNextPlugin: WatchNextPlugin? = null
private var cachedFlutterView: android.view.View? = null
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
@@ -39,6 +42,37 @@ class MainActivity : FlutterActivity() {
handleWatchNextIntent(intent)
}
override fun dispatchKeyEvent(event: KeyEvent): Boolean {
// Ensure FlutterView has focus for DPAD events so they reach Flutter's
// key event system. Without this, Android's native focus navigation can
// consume DPAD direction events (especially from the Google TV virtual
// remote) before they reach Flutter.
when (event.keyCode) {
KeyEvent.KEYCODE_DPAD_UP,
KeyEvent.KEYCODE_DPAD_DOWN,
KeyEvent.KEYCODE_DPAD_LEFT,
KeyEvent.KEYCODE_DPAD_RIGHT,
KeyEvent.KEYCODE_DPAD_CENTER -> {
val fv = cachedFlutterView ?: findFlutterView(window.decorView)?.also { cachedFlutterView = it }
if (fv != null && !fv.hasFocus()) {
fv.requestFocus()
}
}
}
return super.dispatchKeyEvent(event)
}
private fun findFlutterView(view: android.view.View): android.view.View? {
if (view.javaClass.name.contains("FlutterView")) return view
if (view is ViewGroup) {
for (i in 0 until view.childCount) {
val found = findFlutterView(view.getChildAt(i))
if (found != null) return found
}
}
return null
}
override fun onNewIntent(intent: Intent) {
super.onNewIntent(intent)
// Handle Watch Next deep link when app is already running
@@ -90,6 +90,8 @@ class ExoPlayerCore(private val activity: Activity) : Player.Listener {
private var overlayLayoutListener: ViewTreeObserver.OnGlobalLayoutListener? = null
private var exoPlayer: ExoPlayer? = null
private var trackSelector: DefaultTrackSelector? = null
private var tunnelingDisabledForCodec: Boolean = false
private var pendingStartPositionMs: Long = 0L
var delegate: ExoPlayerDelegate? = null
var isInitialized: Boolean = false
private set
@@ -356,16 +358,21 @@ class ExoPlayerCore(private val activity: Activity) : Player.Listener {
} else {
// Scale buffer to available memory to reduce hardware decoder pressure
when {
availableMB < 512 -> 50 * 1024 * 1024
availableMB < 1024 -> 75 * 1024 * 1024
else -> 150 * 1024 * 1024
availableMB <= 512 -> 30 * 1024 * 1024
availableMB <= 1024 -> 50 * 1024 * 1024
availableMB <= 2048 -> 60 * 1024 * 1024
else -> 130 * 1024 * 1024
}
}
val loadControl = DefaultLoadControl.Builder().apply {
setTargetBufferBytes(targetBufferBytes)
setPrioritizeTimeOverSizeThresholds(false)
setBufferDurationsMs(15_000, 30_000, 2_500, 5_000)
if (availableMB <= 2048) {
setBufferDurationsMs(15_000, 50_000, 2_500, 5_000)
} else {
setBufferDurationsMs(30_000, 60_000, 2_500, 5_000)
}
}.build()
Log.d(TAG, "Buffer: ${targetBufferBytes / 1024 / 1024}MB limit, available=${availableMB}MB")
@@ -514,6 +521,16 @@ class ExoPlayerCore(private val activity: Activity) : Player.Listener {
delegate?.onPropertyChange("paused-for-cache", true)
}
Player.STATE_READY -> {
// Restore start position if it was lost during track reselection
// (e.g. tunneling state change in onTracksChanged triggers renderer teardown)
if (pendingStartPositionMs > 0L) {
val currentPos = exoPlayer?.currentPosition ?: 0L
if (currentPos < 1000L) {
Log.w(TAG, "Position lost during init (at ${currentPos}ms, expected ${pendingStartPositionMs}ms) — restoring")
exoPlayer?.seekTo(pendingStartPositionMs)
}
pendingStartPositionMs = 0L
}
delegate?.onPropertyChange("paused-for-cache", false)
delegate?.onEvent("playback-restart", null)
emitTrackList()
@@ -527,6 +544,7 @@ class ExoPlayerCore(private val activity: Activity) : Player.Listener {
override fun onTracksChanged(tracks: Tracks) {
Log.d(TAG, "onTracksChanged")
evaluateAudioCodecForTunneling()
emitTrackList()
}
@@ -711,6 +729,69 @@ class ExoPlayerCore(private val activity: Activity) : Player.Listener {
delegate?.onPropertyChange("track-list", trackList)
}
// Tunneling control — disabled when audio codec has no hardware decoder (requires FFmpeg)
private fun hasHardwareAudioDecoder(mimeType: String): Boolean {
try {
val codecList = android.media.MediaCodecList(android.media.MediaCodecList.REGULAR_CODECS)
for (info in codecList.codecInfos) {
if (info.isEncoder) continue
for (type in info.supportedTypes) {
if (type.equals(mimeType, ignoreCase = true)) {
val name = info.name
if (!name.startsWith("OMX.google.") &&
!name.startsWith("c2.android.") &&
!name.contains(".sw.") &&
!name.startsWith("c2.ffmpeg.")) {
Log.d(TAG, "Found hardware audio decoder for $mimeType: $name")
return true
}
}
}
}
} catch (e: Exception) {
Log.w(TAG, "Failed to query audio decoders for $mimeType: ${e.message}")
}
Log.d(TAG, "No hardware audio decoder for $mimeType — FFmpeg will handle it")
return false
}
private fun updateTunnelingState() {
val selector = trackSelector ?: return
val player = exoPlayer ?: return
val currentSpeed = player.playbackParameters.speed
val shouldTunnel = (currentSpeed == 1f) && !tunnelingDisabledForCodec
val currentTunneling = selector.parameters.tunnelingEnabled
if (shouldTunnel == currentTunneling) return // No change needed
Log.d(TAG, "updateTunnelingState: tunneling $currentTunneling -> $shouldTunnel")
selector.setParameters(
selector.buildUponParameters()
.setTunnelingEnabled(shouldTunnel)
)
// Track reselection from setParameters() can reset position during initial load.
// Restore the pending start position if it hasn't been consumed yet.
if (pendingStartPositionMs > 0L) {
player.seekTo(pendingStartPositionMs)
}
}
private fun evaluateAudioCodecForTunneling() {
val player = exoPlayer ?: return
val selectedAudioGroup = player.currentTracks.groups.firstOrNull {
it.type == C.TRACK_TYPE_AUDIO && it.isSelected
} ?: return
val format = selectedAudioGroup.mediaTrackGroup.getFormat(0)
val mimeType = format.sampleMimeType ?: return
val newDisabled = !hasHardwareAudioDecoder(mimeType)
if (newDisabled != tunnelingDisabledForCodec) {
tunnelingDisabledForCodec = newDisabled
Log.i(TAG, "Audio codec ${format.codecs} ($mimeType): tunneling ${if (newDisabled) "DISABLED" else "enabled"}")
updateTunnelingState()
}
}
// Public API
fun open(uri: String, headers: Map<String, String>?, startPositionMs: Long, autoPlay: Boolean, isLive: Boolean = false) {
@@ -719,6 +800,8 @@ class ExoPlayerCore(private val activity: Activity) : Player.Listener {
currentMediaUri = uri
currentHeaders = headers
externalSubtitles.clear()
tunnelingDisabledForCodec = false
pendingStartPositionMs = startPositionMs
if (isLive) {
// Live MKV streams lack Cues (seek index). FLAG_DISABLE_SEEK_FOR_CUES tells
@@ -796,14 +879,7 @@ class ExoPlayerCore(private val activity: Activity) : Player.Listener {
fun setPlaybackSpeed(speed: Float) {
val clampedSpeed = speed.coerceIn(0.25f, 4f)
exoPlayer?.setPlaybackSpeed(clampedSpeed)
// Disable tunneling when speed != 1.0 — tunneled playback bypasses
// ExoPlayer's audio processors, silently ignoring speed changes.
trackSelector?.setParameters(
trackSelector!!.buildUponParameters()
.setTunnelingEnabled(clampedSpeed == 1f)
)
updateTunnelingState()
delegate?.onPropertyChange("speed", speed.toDouble())
}
@@ -820,9 +896,23 @@ class ExoPlayerCore(private val activity: Activity) : Player.Listener {
val audioGroups = player.currentTracks.groups.filter { it.type == C.TRACK_TYPE_AUDIO }
if (trackIndex >= 0 && trackIndex < audioGroups.size) {
val group = audioGroups[trackIndex]
// Pre-evaluate the new track's codec for tunneling before applying the override,
// so tunneling state is set correctly in the same parameter update.
val format = group.mediaTrackGroup.getFormat(0)
val mimeType = format.sampleMimeType
if (mimeType != null) {
tunnelingDisabledForCodec = !hasHardwareAudioDecoder(mimeType)
Log.i(TAG, "Audio track switch to ${format.codecs} ($mimeType): tunneling ${if (tunnelingDisabledForCodec) "DISABLED" else "enabled"}")
}
val currentSpeed = player.playbackParameters.speed
val shouldTunnel = (currentSpeed == 1f) && !tunnelingDisabledForCodec
selector.parameters = selector.buildUponParameters()
.setOverrideForType(TrackSelectionOverride(group.mediaTrackGroup, 0))
.setTrackTypeDisabled(C.TRACK_TYPE_AUDIO, false)
.setTunnelingEnabled(shouldTunnel)
.build()
delegate?.onPropertyChange("aid", trackId)
@@ -1305,6 +1395,8 @@ class ExoPlayerCore(private val activity: Activity) : Player.Listener {
memoryCallback?.let { activity.unregisterComponentCallbacks(it) }
memoryCallback = null
tunnelingDisabledForCodec = false
pendingStartPositionMs = 0L
exoPlayer?.clearVideoSurface()
exoPlayer?.removeListener(this)
exoPlayer?.release()
+3 -10
View File
@@ -732,11 +732,8 @@
"minimize": "Minimieren"
},
"pairing": {
"recent": "Zuletzt",
"scan": "Scannen",
"manual": "Manuell",
"recentConnections": "Letzte Verbindungen",
"quickReconnect": "Schnell mit zuvor gekoppelten Geräten verbinden",
"pairWithDesktop": "Mit Desktop koppeln",
"enterSessionDetails": "Gib die Sitzungsdetails ein, die auf deinem Desktop-Gerät angezeigt werden",
"hostAddressHint": "192.168.1.100:48632",
@@ -750,11 +747,7 @@
"cameraPermissionRequired": "Kameraberechtigung wird zum Scannen von QR-Codes benötigt.\nBitte erteile den Kamerazugriff in den Geräteeinstellungen.",
"cameraError": "Kamera konnte nicht gestartet werden: ${error}",
"scanInstruction": "Richte deine Kamera auf den QR-Code auf deinem Desktop",
"noRecentConnections": "Keine letzten Verbindungen",
"connectUsingManual": "Verbinde dich über die manuelle Eingabe, um loszulegen",
"invalidQrCode": "Ungültiges QR-Code-Format",
"removeRecentConnection": "Letzte Verbindung entfernen",
"removeConfirm": "\"${name}\" aus den letzten Verbindungen entfernen?",
"validationHostRequired": "Bitte Host-Adresse eingeben",
"validationHostFormat": "Format muss IP:Port sein (z.B. 192.168.1.100:48632)",
"validationSessionIdRequired": "Bitte Sitzungs-ID eingeben",
@@ -763,8 +756,7 @@
"validationPinLength": "PIN muss 6 Ziffern haben",
"connectionTimedOut": "Zeitüberschreitung. Bitte Sitzungs-ID und PIN überprüfen.",
"sessionNotFound": "Sitzung nicht gefunden. Bitte Zugangsdaten überprüfen.",
"failedToConnect": "Verbindung fehlgeschlagen: ${error}",
"failedToLoadRecent": "Letzte Sitzungen konnten nicht geladen werden: ${error}"
"failedToConnect": "Verbindung fehlgeschlagen: ${error}"
},
"remote": {
"disconnectConfirm": "Möchtest du die Verbindung zur Fernsteuerungssitzung trennen?",
@@ -806,7 +798,8 @@
"subtitleSync": "Untertitel-Synchronisation",
"hdr": "HDR",
"audioOutput": "Audioausgabe",
"performanceOverlay": "Leistungsanzeige"
"performanceOverlay": "Leistungsanzeige",
"audioPassthrough": "Audio-Durchleitung"
},
"externalPlayer": {
"title": "Externer Player",
+3 -10
View File
@@ -732,11 +732,8 @@
"minimize": "Minimize"
},
"pairing": {
"recent": "Recent",
"scan": "Scan",
"manual": "Manual",
"recentConnections": "Recent Connections",
"quickReconnect": "Quickly reconnect to previously paired devices",
"pairWithDesktop": "Pair with Desktop",
"enterSessionDetails": "Enter the session details shown on your desktop device",
"hostAddressHint": "192.168.1.100:48632",
@@ -750,11 +747,7 @@
"cameraPermissionRequired": "Camera permission is required to scan QR codes.\nPlease grant camera access in your device settings.",
"cameraError": "Could not start camera: ${error}",
"scanInstruction": "Point your camera at the QR code shown on your desktop",
"noRecentConnections": "No recent connections",
"connectUsingManual": "Connect to a device using Manual entry to get started",
"invalidQrCode": "Invalid QR code format",
"removeRecentConnection": "Remove Recent Connection",
"removeConfirm": "Remove \"${name}\" from recent connections?",
"validationHostRequired": "Please enter host address",
"validationHostFormat": "Format must be IP:port (e.g., 192.168.1.100:48632)",
"validationSessionIdRequired": "Please enter a session ID",
@@ -763,8 +756,7 @@
"validationPinLength": "PIN must be 6 digits",
"connectionTimedOut": "Connection timed out. Please check the session ID and PIN.",
"sessionNotFound": "Could not find the session. Please check your credentials.",
"failedToConnect": "Failed to connect: ${error}",
"failedToLoadRecent": "Failed to load recent sessions: ${error}"
"failedToConnect": "Failed to connect: ${error}"
},
"remote": {
"disconnectConfirm": "Do you want to disconnect from the remote session?",
@@ -806,7 +798,8 @@
"subtitleSync": "Subtitle Sync",
"hdr": "HDR",
"audioOutput": "Audio Output",
"performanceOverlay": "Performance Overlay"
"performanceOverlay": "Performance Overlay",
"audioPassthrough": "Audio Passthrough"
},
"externalPlayer": {
"title": "External Player",
+3 -10
View File
@@ -732,11 +732,8 @@
"minimize": "Minimizar"
},
"pairing": {
"recent": "Recientes",
"scan": "Escanear",
"manual": "Manual",
"recentConnections": "Conexiones recientes",
"quickReconnect": "Reconectar rápidamente con dispositivos emparejados anteriormente",
"pairWithDesktop": "Emparejar con escritorio",
"enterSessionDetails": "Introduce los datos de la sesión que aparecen en tu dispositivo de escritorio",
"hostAddressHint": "192.168.1.100:48632",
@@ -750,11 +747,7 @@
"cameraPermissionRequired": "Se necesita permiso de cámara para escanear códigos QR.\nPor favor, concede acceso a la cámara en los ajustes de tu dispositivo.",
"cameraError": "No se pudo iniciar la cámara: ${error}",
"scanInstruction": "Apunta tu cámara al código QR que aparece en tu escritorio",
"noRecentConnections": "No hay conexiones recientes",
"connectUsingManual": "Conéctate a un dispositivo usando la entrada manual para empezar",
"invalidQrCode": "Formato de código QR no válido",
"removeRecentConnection": "Eliminar conexión reciente",
"removeConfirm": "¿Eliminar \"${name}\" de las conexiones recientes?",
"validationHostRequired": "Por favor, introduce la dirección del host",
"validationHostFormat": "El formato debe ser IP:puerto (ej., 192.168.1.100:48632)",
"validationSessionIdRequired": "Por favor, introduce un ID de sesión",
@@ -763,8 +756,7 @@
"validationPinLength": "El PIN debe tener 6 dígitos",
"connectionTimedOut": "Tiempo de conexión agotado. Verifica el ID de sesión y el PIN.",
"sessionNotFound": "No se encontró la sesión. Verifica tus credenciales.",
"failedToConnect": "Error al conectar: ${error}",
"failedToLoadRecent": "Error al cargar sesiones recientes: ${error}"
"failedToConnect": "Error al conectar: ${error}"
},
"remote": {
"disconnectConfirm": "¿Quieres desconectarte de la sesión remota?",
@@ -806,7 +798,8 @@
"subtitleSync": "Sincronización de subtítulos",
"hdr": "HDR",
"audioOutput": "Salida de audio",
"performanceOverlay": "Indicador de rendimiento"
"performanceOverlay": "Indicador de rendimiento",
"audioPassthrough": "Audio Passthrough"
},
"externalPlayer": {
"title": "Reproductor externo",
+3 -10
View File
@@ -732,11 +732,8 @@
"minimize": "Réduire"
},
"pairing": {
"recent": "Récents",
"scan": "Scanner",
"manual": "Manuel",
"recentConnections": "Connexions récentes",
"quickReconnect": "Reconnexion rapide aux appareils précédemment jumelés",
"pairWithDesktop": "Jumeler avec un bureau",
"enterSessionDetails": "Saisissez les détails de la session affichés sur votre appareil de bureau",
"hostAddressHint": "192.168.1.100:48632",
@@ -750,11 +747,7 @@
"cameraPermissionRequired": "L'autorisation de la caméra est requise pour scanner les QR codes.\nVeuillez accorder l'accès à la caméra dans les paramètres de votre appareil.",
"cameraError": "Impossible de démarrer la caméra : ${error}",
"scanInstruction": "Pointez votre caméra vers le QR code affiché sur votre bureau",
"noRecentConnections": "Aucune connexion récente",
"connectUsingManual": "Connectez-vous à un appareil via la saisie manuelle pour commencer",
"invalidQrCode": "Format de QR code invalide",
"removeRecentConnection": "Supprimer la connexion récente",
"removeConfirm": "Supprimer \"${name}\" des connexions récentes ?",
"validationHostRequired": "Veuillez saisir l'adresse de l'hôte",
"validationHostFormat": "Le format doit être IP:port (ex : 192.168.1.100:48632)",
"validationSessionIdRequired": "Veuillez saisir un ID de session",
@@ -763,8 +756,7 @@
"validationPinLength": "Le PIN doit contenir 6 chiffres",
"connectionTimedOut": "Délai de connexion expiré. Veuillez vérifier l'ID de session et le PIN.",
"sessionNotFound": "Session introuvable. Veuillez vérifier vos identifiants.",
"failedToConnect": "Échec de la connexion : ${error}",
"failedToLoadRecent": "Échec du chargement des sessions récentes : ${error}"
"failedToConnect": "Échec de la connexion : ${error}"
},
"remote": {
"disconnectConfirm": "Voulez-vous vous déconnecter de la session distante ?",
@@ -806,7 +798,8 @@
"subtitleSync": "Synchronisation des sous-titres",
"hdr": "HDR",
"audioOutput": "Sortie audio",
"performanceOverlay": "Superposition de performance"
"performanceOverlay": "Superposition de performance",
"audioPassthrough": "Audio Pass-Through"
},
"externalPlayer": {
"title": "Lecteur externe",
+3 -10
View File
@@ -732,11 +732,8 @@
"minimize": "Riduci"
},
"pairing": {
"recent": "Recenti",
"scan": "Scansiona",
"manual": "Manuale",
"recentConnections": "Connessioni recenti",
"quickReconnect": "Riconnettiti rapidamente ai dispositivi associati in precedenza",
"pairWithDesktop": "Associa con desktop",
"enterSessionDetails": "Inserisci i dettagli della sessione mostrati sul tuo dispositivo desktop",
"hostAddressHint": "192.168.1.100:48632",
@@ -750,11 +747,7 @@
"cameraPermissionRequired": "L'autorizzazione della fotocamera è necessaria per scansionare i QR code.\nConcedi l'accesso alla fotocamera nelle impostazioni del dispositivo.",
"cameraError": "Impossibile avviare la fotocamera: ${error}",
"scanInstruction": "Punta la fotocamera verso il QR code mostrato sul tuo desktop",
"noRecentConnections": "Nessuna connessione recente",
"connectUsingManual": "Connettiti a un dispositivo tramite inserimento manuale per iniziare",
"invalidQrCode": "Formato QR code non valido",
"removeRecentConnection": "Rimuovi connessione recente",
"removeConfirm": "Rimuovere \"${name}\" dalle connessioni recenti?",
"validationHostRequired": "Inserisci l'indirizzo host",
"validationHostFormat": "Il formato deve essere IP:porta (es. 192.168.1.100:48632)",
"validationSessionIdRequired": "Inserisci un ID sessione",
@@ -763,8 +756,7 @@
"validationPinLength": "Il PIN deve essere di 6 cifre",
"connectionTimedOut": "Connessione scaduta. Verifica l'ID sessione e il PIN.",
"sessionNotFound": "Sessione non trovata. Verifica le tue credenziali.",
"failedToConnect": "Connessione fallita: ${error}",
"failedToLoadRecent": "Impossibile caricare le sessioni recenti: ${error}"
"failedToConnect": "Connessione fallita: ${error}"
},
"remote": {
"disconnectConfirm": "Vuoi disconnetterti dalla sessione remota?",
@@ -806,7 +798,8 @@
"subtitleSync": "Sincronizzazione sottotitoli",
"hdr": "HDR",
"audioOutput": "Uscita audio",
"performanceOverlay": "Overlay prestazioni"
"performanceOverlay": "Overlay prestazioni",
"audioPassthrough": "Audio Passthrough"
},
"externalPlayer": {
"title": "Lettore esterno",
+3 -10
View File
@@ -732,11 +732,8 @@
"minimize": "최소화"
},
"pairing": {
"recent": "최근",
"scan": "스캔",
"manual": "수동",
"recentConnections": "최근 연결",
"quickReconnect": "이전에 페어링한 기기에 빠르게 재연결",
"pairWithDesktop": "데스크톱과 페어링",
"enterSessionDetails": "데스크톱 기기에 표시된 세션 정보를 입력하세요",
"hostAddressHint": "192.168.1.100:48632",
@@ -750,11 +747,7 @@
"cameraPermissionRequired": "QR 코드를 스캔하려면 카메라 권한이 필요합니다.\n기기 설정에서 카메라 접근을 허용해 주세요.",
"cameraError": "카메라를 시작할 수 없습니다: ${error}",
"scanInstruction": "데스크톱에 표시된 QR 코드에 카메라를 향하세요",
"noRecentConnections": "최근 연결 없음",
"connectUsingManual": "수동 입력으로 기기에 연결하여 시작하세요",
"invalidQrCode": "유효하지 않은 QR 코드 형식",
"removeRecentConnection": "최근 연결 삭제",
"removeConfirm": "\"${name}\"을(를) 최근 연결에서 삭제하시겠습니까?",
"validationHostRequired": "호스트 주소를 입력하세요",
"validationHostFormat": "IP:포트 형식이어야 합니다 (예: 192.168.1.100:48632)",
"validationSessionIdRequired": "세션 ID를 입력하세요",
@@ -763,8 +756,7 @@
"validationPinLength": "PIN은 6자리여야 합니다",
"connectionTimedOut": "연결 시간이 초과되었습니다. 세션 ID와 PIN을 확인하세요.",
"sessionNotFound": "세션을 찾을 수 없습니다. 자격 증명을 확인하세요.",
"failedToConnect": "연결 실패: ${error}",
"failedToLoadRecent": "최근 세션 로드 실패: ${error}"
"failedToConnect": "연결 실패: ${error}"
},
"remote": {
"disconnectConfirm": "원격 세션 연결을 해제하시겠습니까?",
@@ -806,7 +798,8 @@
"subtitleSync": "자막 동기화",
"hdr": "HDR",
"audioOutput": "오디오 출력",
"performanceOverlay": "성능 오버레이"
"performanceOverlay": "성능 오버레이",
"audioPassthrough": "오디오 패스스루"
},
"externalPlayer": {
"title": "외부 플레이어",
+3 -10
View File
@@ -732,11 +732,8 @@
"minimize": "Minimaliseren"
},
"pairing": {
"recent": "Recent",
"scan": "Scannen",
"manual": "Handmatig",
"recentConnections": "Recente verbindingen",
"quickReconnect": "Snel opnieuw verbinden met eerder gekoppelde apparaten",
"pairWithDesktop": "Koppelen met desktop",
"enterSessionDetails": "Voer de sessiegegevens in die op je desktop-apparaat worden getoond",
"hostAddressHint": "192.168.1.100:48632",
@@ -750,11 +747,7 @@
"cameraPermissionRequired": "Cameratoestemming is vereist om QR-codes te scannen.\nGeef cameratoegang in je apparaatinstellingen.",
"cameraError": "Kan camera niet starten: ${error}",
"scanInstruction": "Richt je camera op de QR-code die op je desktop wordt getoond",
"noRecentConnections": "Geen recente verbindingen",
"connectUsingManual": "Verbind met een apparaat via Handmatige invoer om te beginnen",
"invalidQrCode": "Ongeldig QR-codeformaat",
"removeRecentConnection": "Recente verbinding verwijderen",
"removeConfirm": "\"${name}\" verwijderen uit recente verbindingen?",
"validationHostRequired": "Voer een hostadres in",
"validationHostFormat": "Formaat moet IP:poort zijn (bijv. 192.168.1.100:48632)",
"validationSessionIdRequired": "Voer een sessie-ID in",
@@ -763,8 +756,7 @@
"validationPinLength": "PIN moet 6 cijfers zijn",
"connectionTimedOut": "Verbinding verlopen. Controleer de sessie-ID en PIN.",
"sessionNotFound": "Kan de sessie niet vinden. Controleer je gegevens.",
"failedToConnect": "Verbinden mislukt: ${error}",
"failedToLoadRecent": "Kan recente sessies niet laden: ${error}"
"failedToConnect": "Verbinden mislukt: ${error}"
},
"remote": {
"disconnectConfirm": "Wil je de verbinding met de externe sessie verbreken?",
@@ -806,7 +798,8 @@
"subtitleSync": "Ondertitel synchronisatie",
"hdr": "HDR",
"audioOutput": "Audio-uitvoer",
"performanceOverlay": "Prestatie-overlay"
"performanceOverlay": "Prestatie-overlay",
"audioPassthrough": "Audio-doorvoer"
},
"externalPlayer": {
"title": "Externe speler",
+2 -16
View File
@@ -1018,6 +1018,7 @@ class _TranslationsVideoSettingsDe implements TranslationsVideoSettingsEn {
@override String get hdr => 'HDR';
@override String get audioOutput => 'Audioausgabe';
@override String get performanceOverlay => 'Leistungsanzeige';
@override String get audioPassthrough => 'Audio-Durchleitung';
}
// Path: externalPlayer
@@ -1213,11 +1214,8 @@ class _TranslationsCompanionRemotePairingDe implements TranslationsCompanionRemo
final TranslationsDe _root; // ignore: unused_field
// Translations
@override String get recent => 'Zuletzt';
@override String get scan => 'Scannen';
@override String get manual => 'Manuell';
@override String get recentConnections => 'Letzte Verbindungen';
@override String get quickReconnect => 'Schnell mit zuvor gekoppelten Geräten verbinden';
@override String get pairWithDesktop => 'Mit Desktop koppeln';
@override String get enterSessionDetails => 'Gib die Sitzungsdetails ein, die auf deinem Desktop-Gerät angezeigt werden';
@override String get hostAddressHint => '192.168.1.100:48632';
@@ -1231,11 +1229,7 @@ class _TranslationsCompanionRemotePairingDe implements TranslationsCompanionRemo
@override String get cameraPermissionRequired => 'Kameraberechtigung wird zum Scannen von QR-Codes benötigt.\nBitte erteile den Kamerazugriff in den Geräteeinstellungen.';
@override String cameraError({required Object error}) => 'Kamera konnte nicht gestartet werden: ${error}';
@override String get scanInstruction => 'Richte deine Kamera auf den QR-Code auf deinem Desktop';
@override String get noRecentConnections => 'Keine letzten Verbindungen';
@override String get connectUsingManual => 'Verbinde dich über die manuelle Eingabe, um loszulegen';
@override String get invalidQrCode => 'Ungültiges QR-Code-Format';
@override String get removeRecentConnection => 'Letzte Verbindung entfernen';
@override String removeConfirm({required Object name}) => '"${name}" aus den letzten Verbindungen entfernen?';
@override String get validationHostRequired => 'Bitte Host-Adresse eingeben';
@override String get validationHostFormat => 'Format muss IP:Port sein (z.B. 192.168.1.100:48632)';
@override String get validationSessionIdRequired => 'Bitte Sitzungs-ID eingeben';
@@ -1245,7 +1239,6 @@ class _TranslationsCompanionRemotePairingDe implements TranslationsCompanionRemo
@override String get connectionTimedOut => 'Zeitüberschreitung. Bitte Sitzungs-ID und PIN überprüfen.';
@override String get sessionNotFound => 'Sitzung nicht gefunden. Bitte Zugangsdaten überprüfen.';
@override String failedToConnect({required Object error}) => 'Verbindung fehlgeschlagen: ${error}';
@override String failedToLoadRecent({required Object error}) => 'Letzte Sitzungen konnten nicht geladen werden: ${error}';
}
// Path: companionRemote.remote
@@ -1949,11 +1942,8 @@ extension on TranslationsDe {
'companionRemote.session.copyToClipboard' => 'In Zwischenablage kopieren',
'companionRemote.session.newSession' => 'Neue Sitzung',
'companionRemote.session.minimize' => 'Minimieren',
'companionRemote.pairing.recent' => 'Zuletzt',
'companionRemote.pairing.scan' => 'Scannen',
'companionRemote.pairing.manual' => 'Manuell',
'companionRemote.pairing.recentConnections' => 'Letzte Verbindungen',
'companionRemote.pairing.quickReconnect' => 'Schnell mit zuvor gekoppelten Geräten verbinden',
'companionRemote.pairing.pairWithDesktop' => 'Mit Desktop koppeln',
'companionRemote.pairing.enterSessionDetails' => 'Gib die Sitzungsdetails ein, die auf deinem Desktop-Gerät angezeigt werden',
'companionRemote.pairing.hostAddressHint' => '192.168.1.100:48632',
@@ -1967,11 +1957,7 @@ extension on TranslationsDe {
'companionRemote.pairing.cameraPermissionRequired' => 'Kameraberechtigung wird zum Scannen von QR-Codes benötigt.\nBitte erteile den Kamerazugriff in den Geräteeinstellungen.',
'companionRemote.pairing.cameraError' => ({required Object error}) => 'Kamera konnte nicht gestartet werden: ${error}',
'companionRemote.pairing.scanInstruction' => 'Richte deine Kamera auf den QR-Code auf deinem Desktop',
'companionRemote.pairing.noRecentConnections' => 'Keine letzten Verbindungen',
'companionRemote.pairing.connectUsingManual' => 'Verbinde dich über die manuelle Eingabe, um loszulegen',
'companionRemote.pairing.invalidQrCode' => 'Ungültiges QR-Code-Format',
'companionRemote.pairing.removeRecentConnection' => 'Letzte Verbindung entfernen',
'companionRemote.pairing.removeConfirm' => ({required Object name}) => '"${name}" aus den letzten Verbindungen entfernen?',
'companionRemote.pairing.validationHostRequired' => 'Bitte Host-Adresse eingeben',
'companionRemote.pairing.validationHostFormat' => 'Format muss IP:Port sein (z.B. 192.168.1.100:48632)',
'companionRemote.pairing.validationSessionIdRequired' => 'Bitte Sitzungs-ID eingeben',
@@ -1981,7 +1967,6 @@ extension on TranslationsDe {
'companionRemote.pairing.connectionTimedOut' => 'Zeitüberschreitung. Bitte Sitzungs-ID und PIN überprüfen.',
'companionRemote.pairing.sessionNotFound' => 'Sitzung nicht gefunden. Bitte Zugangsdaten überprüfen.',
'companionRemote.pairing.failedToConnect' => ({required Object error}) => 'Verbindung fehlgeschlagen: ${error}',
'companionRemote.pairing.failedToLoadRecent' => ({required Object error}) => 'Letzte Sitzungen konnten nicht geladen werden: ${error}',
'companionRemote.remote.disconnectConfirm' => 'Möchtest du die Verbindung zur Fernsteuerungssitzung trennen?',
'companionRemote.remote.reconnecting' => 'Verbindung wird wiederhergestellt...',
'companionRemote.remote.attemptOf' => ({required Object current}) => 'Versuch ${current} von 5',
@@ -2019,6 +2004,7 @@ extension on TranslationsDe {
'videoSettings.hdr' => 'HDR',
'videoSettings.audioOutput' => 'Audioausgabe',
'videoSettings.performanceOverlay' => 'Leistungsanzeige',
'videoSettings.audioPassthrough' => 'Audio-Durchleitung',
'externalPlayer.title' => 'Externer Player',
'externalPlayer.useExternalPlayer' => 'Externen Player verwenden',
'externalPlayer.useExternalPlayerDescription' => 'Videos in einer externen App statt im integrierten Player öffnen',
+4 -31
View File
@@ -2249,6 +2249,9 @@ class TranslationsVideoSettingsEn {
/// en: 'Performance Overlay'
String get performanceOverlay => 'Performance Overlay';
/// en: 'Audio Passthrough'
String get audioPassthrough => 'Audio Passthrough';
}
// Path: externalPlayer
@@ -2691,21 +2694,12 @@ class TranslationsCompanionRemotePairingEn {
// Translations
/// en: 'Recent'
String get recent => 'Recent';
/// en: 'Scan'
String get scan => 'Scan';
/// en: 'Manual'
String get manual => 'Manual';
/// en: 'Recent Connections'
String get recentConnections => 'Recent Connections';
/// en: 'Quickly reconnect to previously paired devices'
String get quickReconnect => 'Quickly reconnect to previously paired devices';
/// en: 'Pair with Desktop'
String get pairWithDesktop => 'Pair with Desktop';
@@ -2745,21 +2739,9 @@ class TranslationsCompanionRemotePairingEn {
/// en: 'Point your camera at the QR code shown on your desktop'
String get scanInstruction => 'Point your camera at the QR code shown on your desktop';
/// en: 'No recent connections'
String get noRecentConnections => 'No recent connections';
/// en: 'Connect to a device using Manual entry to get started'
String get connectUsingManual => 'Connect to a device using Manual entry to get started';
/// en: 'Invalid QR code format'
String get invalidQrCode => 'Invalid QR code format';
/// en: 'Remove Recent Connection'
String get removeRecentConnection => 'Remove Recent Connection';
/// en: 'Remove "${name}" from recent connections?'
String removeConfirm({required Object name}) => 'Remove "${name}" from recent connections?';
/// en: 'Please enter host address'
String get validationHostRequired => 'Please enter host address';
@@ -2787,8 +2769,6 @@ class TranslationsCompanionRemotePairingEn {
/// en: 'Failed to connect: ${error}'
String failedToConnect({required Object error}) => 'Failed to connect: ${error}';
/// en: 'Failed to load recent sessions: ${error}'
String failedToLoadRecent({required Object error}) => 'Failed to load recent sessions: ${error}';
}
// Path: companionRemote.remote
@@ -3550,11 +3530,8 @@ extension on Translations {
'companionRemote.session.copyToClipboard' => 'Copy to clipboard',
'companionRemote.session.newSession' => 'New Session',
'companionRemote.session.minimize' => 'Minimize',
'companionRemote.pairing.recent' => 'Recent',
'companionRemote.pairing.scan' => 'Scan',
'companionRemote.pairing.manual' => 'Manual',
'companionRemote.pairing.recentConnections' => 'Recent Connections',
'companionRemote.pairing.quickReconnect' => 'Quickly reconnect to previously paired devices',
'companionRemote.pairing.pairWithDesktop' => 'Pair with Desktop',
'companionRemote.pairing.enterSessionDetails' => 'Enter the session details shown on your desktop device',
'companionRemote.pairing.hostAddressHint' => '192.168.1.100:48632',
@@ -3568,11 +3545,7 @@ extension on Translations {
'companionRemote.pairing.cameraPermissionRequired' => 'Camera permission is required to scan QR codes.\nPlease grant camera access in your device settings.',
'companionRemote.pairing.cameraError' => ({required Object error}) => 'Could not start camera: ${error}',
'companionRemote.pairing.scanInstruction' => 'Point your camera at the QR code shown on your desktop',
'companionRemote.pairing.noRecentConnections' => 'No recent connections',
'companionRemote.pairing.connectUsingManual' => 'Connect to a device using Manual entry to get started',
'companionRemote.pairing.invalidQrCode' => 'Invalid QR code format',
'companionRemote.pairing.removeRecentConnection' => 'Remove Recent Connection',
'companionRemote.pairing.removeConfirm' => ({required Object name}) => 'Remove "${name}" from recent connections?',
'companionRemote.pairing.validationHostRequired' => 'Please enter host address',
'companionRemote.pairing.validationHostFormat' => 'Format must be IP:port (e.g., 192.168.1.100:48632)',
'companionRemote.pairing.validationSessionIdRequired' => 'Please enter a session ID',
@@ -3582,7 +3555,6 @@ extension on Translations {
'companionRemote.pairing.connectionTimedOut' => 'Connection timed out. Please check the session ID and PIN.',
'companionRemote.pairing.sessionNotFound' => 'Could not find the session. Please check your credentials.',
'companionRemote.pairing.failedToConnect' => ({required Object error}) => 'Failed to connect: ${error}',
'companionRemote.pairing.failedToLoadRecent' => ({required Object error}) => 'Failed to load recent sessions: ${error}',
'companionRemote.remote.disconnectConfirm' => 'Do you want to disconnect from the remote session?',
'companionRemote.remote.reconnecting' => 'Reconnecting...',
'companionRemote.remote.attemptOf' => ({required Object current}) => 'Attempt ${current} of 5',
@@ -3620,6 +3592,7 @@ extension on Translations {
'videoSettings.hdr' => 'HDR',
'videoSettings.audioOutput' => 'Audio Output',
'videoSettings.performanceOverlay' => 'Performance Overlay',
'videoSettings.audioPassthrough' => 'Audio Passthrough',
'externalPlayer.title' => 'External Player',
'externalPlayer.useExternalPlayer' => 'Use External Player',
'externalPlayer.useExternalPlayerDescription' => 'Open videos in an external app instead of the built-in player',
+2 -16
View File
@@ -1018,6 +1018,7 @@ class _TranslationsVideoSettingsEs implements TranslationsVideoSettingsEn {
@override String get hdr => 'HDR';
@override String get audioOutput => 'Salida de audio';
@override String get performanceOverlay => 'Indicador de rendimiento';
@override String get audioPassthrough => 'Audio Passthrough';
}
// Path: externalPlayer
@@ -1213,11 +1214,8 @@ class _TranslationsCompanionRemotePairingEs implements TranslationsCompanionRemo
final TranslationsEs _root; // ignore: unused_field
// Translations
@override String get recent => 'Recientes';
@override String get scan => 'Escanear';
@override String get manual => 'Manual';
@override String get recentConnections => 'Conexiones recientes';
@override String get quickReconnect => 'Reconectar rápidamente con dispositivos emparejados anteriormente';
@override String get pairWithDesktop => 'Emparejar con escritorio';
@override String get enterSessionDetails => 'Introduce los datos de la sesión que aparecen en tu dispositivo de escritorio';
@override String get hostAddressHint => '192.168.1.100:48632';
@@ -1231,11 +1229,7 @@ class _TranslationsCompanionRemotePairingEs implements TranslationsCompanionRemo
@override String get cameraPermissionRequired => 'Se necesita permiso de cámara para escanear códigos QR.\nPor favor, concede acceso a la cámara en los ajustes de tu dispositivo.';
@override String cameraError({required Object error}) => 'No se pudo iniciar la cámara: ${error}';
@override String get scanInstruction => 'Apunta tu cámara al código QR que aparece en tu escritorio';
@override String get noRecentConnections => 'No hay conexiones recientes';
@override String get connectUsingManual => 'Conéctate a un dispositivo usando la entrada manual para empezar';
@override String get invalidQrCode => 'Formato de código QR no válido';
@override String get removeRecentConnection => 'Eliminar conexión reciente';
@override String removeConfirm({required Object name}) => '¿Eliminar "${name}" de las conexiones recientes?';
@override String get validationHostRequired => 'Por favor, introduce la dirección del host';
@override String get validationHostFormat => 'El formato debe ser IP:puerto (ej., 192.168.1.100:48632)';
@override String get validationSessionIdRequired => 'Por favor, introduce un ID de sesión';
@@ -1245,7 +1239,6 @@ class _TranslationsCompanionRemotePairingEs implements TranslationsCompanionRemo
@override String get connectionTimedOut => 'Tiempo de conexión agotado. Verifica el ID de sesión y el PIN.';
@override String get sessionNotFound => 'No se encontró la sesión. Verifica tus credenciales.';
@override String failedToConnect({required Object error}) => 'Error al conectar: ${error}';
@override String failedToLoadRecent({required Object error}) => 'Error al cargar sesiones recientes: ${error}';
}
// Path: companionRemote.remote
@@ -1949,11 +1942,8 @@ extension on TranslationsEs {
'companionRemote.session.copyToClipboard' => 'Copiar al portapapeles',
'companionRemote.session.newSession' => 'Nueva sesión',
'companionRemote.session.minimize' => 'Minimizar',
'companionRemote.pairing.recent' => 'Recientes',
'companionRemote.pairing.scan' => 'Escanear',
'companionRemote.pairing.manual' => 'Manual',
'companionRemote.pairing.recentConnections' => 'Conexiones recientes',
'companionRemote.pairing.quickReconnect' => 'Reconectar rápidamente con dispositivos emparejados anteriormente',
'companionRemote.pairing.pairWithDesktop' => 'Emparejar con escritorio',
'companionRemote.pairing.enterSessionDetails' => 'Introduce los datos de la sesión que aparecen en tu dispositivo de escritorio',
'companionRemote.pairing.hostAddressHint' => '192.168.1.100:48632',
@@ -1967,11 +1957,7 @@ extension on TranslationsEs {
'companionRemote.pairing.cameraPermissionRequired' => 'Se necesita permiso de cámara para escanear códigos QR.\nPor favor, concede acceso a la cámara en los ajustes de tu dispositivo.',
'companionRemote.pairing.cameraError' => ({required Object error}) => 'No se pudo iniciar la cámara: ${error}',
'companionRemote.pairing.scanInstruction' => 'Apunta tu cámara al código QR que aparece en tu escritorio',
'companionRemote.pairing.noRecentConnections' => 'No hay conexiones recientes',
'companionRemote.pairing.connectUsingManual' => 'Conéctate a un dispositivo usando la entrada manual para empezar',
'companionRemote.pairing.invalidQrCode' => 'Formato de código QR no válido',
'companionRemote.pairing.removeRecentConnection' => 'Eliminar conexión reciente',
'companionRemote.pairing.removeConfirm' => ({required Object name}) => '¿Eliminar "${name}" de las conexiones recientes?',
'companionRemote.pairing.validationHostRequired' => 'Por favor, introduce la dirección del host',
'companionRemote.pairing.validationHostFormat' => 'El formato debe ser IP:puerto (ej., 192.168.1.100:48632)',
'companionRemote.pairing.validationSessionIdRequired' => 'Por favor, introduce un ID de sesión',
@@ -1981,7 +1967,6 @@ extension on TranslationsEs {
'companionRemote.pairing.connectionTimedOut' => 'Tiempo de conexión agotado. Verifica el ID de sesión y el PIN.',
'companionRemote.pairing.sessionNotFound' => 'No se encontró la sesión. Verifica tus credenciales.',
'companionRemote.pairing.failedToConnect' => ({required Object error}) => 'Error al conectar: ${error}',
'companionRemote.pairing.failedToLoadRecent' => ({required Object error}) => 'Error al cargar sesiones recientes: ${error}',
'companionRemote.remote.disconnectConfirm' => '¿Quieres desconectarte de la sesión remota?',
'companionRemote.remote.reconnecting' => 'Reconectando...',
'companionRemote.remote.attemptOf' => ({required Object current}) => 'Intento ${current} de 5',
@@ -2019,6 +2004,7 @@ extension on TranslationsEs {
'videoSettings.hdr' => 'HDR',
'videoSettings.audioOutput' => 'Salida de audio',
'videoSettings.performanceOverlay' => 'Indicador de rendimiento',
'videoSettings.audioPassthrough' => 'Audio Passthrough',
'externalPlayer.title' => 'Reproductor externo',
'externalPlayer.useExternalPlayer' => 'Usar reproductor externo',
'externalPlayer.useExternalPlayerDescription' => 'Abrir vídeos en una app externa en lugar del reproductor integrado',
+2 -16
View File
@@ -1018,6 +1018,7 @@ class _TranslationsVideoSettingsFr implements TranslationsVideoSettingsEn {
@override String get hdr => 'HDR';
@override String get audioOutput => 'Sortie audio';
@override String get performanceOverlay => 'Superposition de performance';
@override String get audioPassthrough => 'Audio Pass-Through';
}
// Path: externalPlayer
@@ -1213,11 +1214,8 @@ class _TranslationsCompanionRemotePairingFr implements TranslationsCompanionRemo
final TranslationsFr _root; // ignore: unused_field
// Translations
@override String get recent => 'Récents';
@override String get scan => 'Scanner';
@override String get manual => 'Manuel';
@override String get recentConnections => 'Connexions récentes';
@override String get quickReconnect => 'Reconnexion rapide aux appareils précédemment jumelés';
@override String get pairWithDesktop => 'Jumeler avec un bureau';
@override String get enterSessionDetails => 'Saisissez les détails de la session affichés sur votre appareil de bureau';
@override String get hostAddressHint => '192.168.1.100:48632';
@@ -1231,11 +1229,7 @@ class _TranslationsCompanionRemotePairingFr implements TranslationsCompanionRemo
@override String get cameraPermissionRequired => 'L\'autorisation de la caméra est requise pour scanner les QR codes.\nVeuillez accorder l\'accès à la caméra dans les paramètres de votre appareil.';
@override String cameraError({required Object error}) => 'Impossible de démarrer la caméra : ${error}';
@override String get scanInstruction => 'Pointez votre caméra vers le QR code affiché sur votre bureau';
@override String get noRecentConnections => 'Aucune connexion récente';
@override String get connectUsingManual => 'Connectez-vous à un appareil via la saisie manuelle pour commencer';
@override String get invalidQrCode => 'Format de QR code invalide';
@override String get removeRecentConnection => 'Supprimer la connexion récente';
@override String removeConfirm({required Object name}) => 'Supprimer "${name}" des connexions récentes ?';
@override String get validationHostRequired => 'Veuillez saisir l\'adresse de l\'hôte';
@override String get validationHostFormat => 'Le format doit être IP:port (ex : 192.168.1.100:48632)';
@override String get validationSessionIdRequired => 'Veuillez saisir un ID de session';
@@ -1245,7 +1239,6 @@ class _TranslationsCompanionRemotePairingFr implements TranslationsCompanionRemo
@override String get connectionTimedOut => 'Délai de connexion expiré. Veuillez vérifier l\'ID de session et le PIN.';
@override String get sessionNotFound => 'Session introuvable. Veuillez vérifier vos identifiants.';
@override String failedToConnect({required Object error}) => 'Échec de la connexion : ${error}';
@override String failedToLoadRecent({required Object error}) => 'Échec du chargement des sessions récentes : ${error}';
}
// Path: companionRemote.remote
@@ -1949,11 +1942,8 @@ extension on TranslationsFr {
'companionRemote.session.copyToClipboard' => 'Copier dans le presse-papiers',
'companionRemote.session.newSession' => 'Nouvelle session',
'companionRemote.session.minimize' => 'Réduire',
'companionRemote.pairing.recent' => 'Récents',
'companionRemote.pairing.scan' => 'Scanner',
'companionRemote.pairing.manual' => 'Manuel',
'companionRemote.pairing.recentConnections' => 'Connexions récentes',
'companionRemote.pairing.quickReconnect' => 'Reconnexion rapide aux appareils précédemment jumelés',
'companionRemote.pairing.pairWithDesktop' => 'Jumeler avec un bureau',
'companionRemote.pairing.enterSessionDetails' => 'Saisissez les détails de la session affichés sur votre appareil de bureau',
'companionRemote.pairing.hostAddressHint' => '192.168.1.100:48632',
@@ -1967,11 +1957,7 @@ extension on TranslationsFr {
'companionRemote.pairing.cameraPermissionRequired' => 'L\'autorisation de la caméra est requise pour scanner les QR codes.\nVeuillez accorder l\'accès à la caméra dans les paramètres de votre appareil.',
'companionRemote.pairing.cameraError' => ({required Object error}) => 'Impossible de démarrer la caméra : ${error}',
'companionRemote.pairing.scanInstruction' => 'Pointez votre caméra vers le QR code affiché sur votre bureau',
'companionRemote.pairing.noRecentConnections' => 'Aucune connexion récente',
'companionRemote.pairing.connectUsingManual' => 'Connectez-vous à un appareil via la saisie manuelle pour commencer',
'companionRemote.pairing.invalidQrCode' => 'Format de QR code invalide',
'companionRemote.pairing.removeRecentConnection' => 'Supprimer la connexion récente',
'companionRemote.pairing.removeConfirm' => ({required Object name}) => 'Supprimer "${name}" des connexions récentes ?',
'companionRemote.pairing.validationHostRequired' => 'Veuillez saisir l\'adresse de l\'hôte',
'companionRemote.pairing.validationHostFormat' => 'Le format doit être IP:port (ex : 192.168.1.100:48632)',
'companionRemote.pairing.validationSessionIdRequired' => 'Veuillez saisir un ID de session',
@@ -1981,7 +1967,6 @@ extension on TranslationsFr {
'companionRemote.pairing.connectionTimedOut' => 'Délai de connexion expiré. Veuillez vérifier l\'ID de session et le PIN.',
'companionRemote.pairing.sessionNotFound' => 'Session introuvable. Veuillez vérifier vos identifiants.',
'companionRemote.pairing.failedToConnect' => ({required Object error}) => 'Échec de la connexion : ${error}',
'companionRemote.pairing.failedToLoadRecent' => ({required Object error}) => 'Échec du chargement des sessions récentes : ${error}',
'companionRemote.remote.disconnectConfirm' => 'Voulez-vous vous déconnecter de la session distante ?',
'companionRemote.remote.reconnecting' => 'Reconnexion...',
'companionRemote.remote.attemptOf' => ({required Object current}) => 'Tentative ${current} sur 5',
@@ -2019,6 +2004,7 @@ extension on TranslationsFr {
'videoSettings.hdr' => 'HDR',
'videoSettings.audioOutput' => 'Sortie audio',
'videoSettings.performanceOverlay' => 'Superposition de performance',
'videoSettings.audioPassthrough' => 'Audio Pass-Through',
'externalPlayer.title' => 'Lecteur externe',
'externalPlayer.useExternalPlayer' => 'Utiliser un lecteur externe',
'externalPlayer.useExternalPlayerDescription' => 'Ouvrir les vidéos dans une application externe au lieu du lecteur intégré',
+2 -16
View File
@@ -1018,6 +1018,7 @@ class _TranslationsVideoSettingsIt implements TranslationsVideoSettingsEn {
@override String get hdr => 'HDR';
@override String get audioOutput => 'Uscita audio';
@override String get performanceOverlay => 'Overlay prestazioni';
@override String get audioPassthrough => 'Audio Passthrough';
}
// Path: externalPlayer
@@ -1213,11 +1214,8 @@ class _TranslationsCompanionRemotePairingIt implements TranslationsCompanionRemo
final TranslationsIt _root; // ignore: unused_field
// Translations
@override String get recent => 'Recenti';
@override String get scan => 'Scansiona';
@override String get manual => 'Manuale';
@override String get recentConnections => 'Connessioni recenti';
@override String get quickReconnect => 'Riconnettiti rapidamente ai dispositivi associati in precedenza';
@override String get pairWithDesktop => 'Associa con desktop';
@override String get enterSessionDetails => 'Inserisci i dettagli della sessione mostrati sul tuo dispositivo desktop';
@override String get hostAddressHint => '192.168.1.100:48632';
@@ -1231,11 +1229,7 @@ class _TranslationsCompanionRemotePairingIt implements TranslationsCompanionRemo
@override String get cameraPermissionRequired => 'L\'autorizzazione della fotocamera è necessaria per scansionare i QR code.\nConcedi l\'accesso alla fotocamera nelle impostazioni del dispositivo.';
@override String cameraError({required Object error}) => 'Impossibile avviare la fotocamera: ${error}';
@override String get scanInstruction => 'Punta la fotocamera verso il QR code mostrato sul tuo desktop';
@override String get noRecentConnections => 'Nessuna connessione recente';
@override String get connectUsingManual => 'Connettiti a un dispositivo tramite inserimento manuale per iniziare';
@override String get invalidQrCode => 'Formato QR code non valido';
@override String get removeRecentConnection => 'Rimuovi connessione recente';
@override String removeConfirm({required Object name}) => 'Rimuovere "${name}" dalle connessioni recenti?';
@override String get validationHostRequired => 'Inserisci l\'indirizzo host';
@override String get validationHostFormat => 'Il formato deve essere IP:porta (es. 192.168.1.100:48632)';
@override String get validationSessionIdRequired => 'Inserisci un ID sessione';
@@ -1245,7 +1239,6 @@ class _TranslationsCompanionRemotePairingIt implements TranslationsCompanionRemo
@override String get connectionTimedOut => 'Connessione scaduta. Verifica l\'ID sessione e il PIN.';
@override String get sessionNotFound => 'Sessione non trovata. Verifica le tue credenziali.';
@override String failedToConnect({required Object error}) => 'Connessione fallita: ${error}';
@override String failedToLoadRecent({required Object error}) => 'Impossibile caricare le sessioni recenti: ${error}';
}
// Path: companionRemote.remote
@@ -1949,11 +1942,8 @@ extension on TranslationsIt {
'companionRemote.session.copyToClipboard' => 'Copia negli appunti',
'companionRemote.session.newSession' => 'Nuova sessione',
'companionRemote.session.minimize' => 'Riduci',
'companionRemote.pairing.recent' => 'Recenti',
'companionRemote.pairing.scan' => 'Scansiona',
'companionRemote.pairing.manual' => 'Manuale',
'companionRemote.pairing.recentConnections' => 'Connessioni recenti',
'companionRemote.pairing.quickReconnect' => 'Riconnettiti rapidamente ai dispositivi associati in precedenza',
'companionRemote.pairing.pairWithDesktop' => 'Associa con desktop',
'companionRemote.pairing.enterSessionDetails' => 'Inserisci i dettagli della sessione mostrati sul tuo dispositivo desktop',
'companionRemote.pairing.hostAddressHint' => '192.168.1.100:48632',
@@ -1967,11 +1957,7 @@ extension on TranslationsIt {
'companionRemote.pairing.cameraPermissionRequired' => 'L\'autorizzazione della fotocamera è necessaria per scansionare i QR code.\nConcedi l\'accesso alla fotocamera nelle impostazioni del dispositivo.',
'companionRemote.pairing.cameraError' => ({required Object error}) => 'Impossibile avviare la fotocamera: ${error}',
'companionRemote.pairing.scanInstruction' => 'Punta la fotocamera verso il QR code mostrato sul tuo desktop',
'companionRemote.pairing.noRecentConnections' => 'Nessuna connessione recente',
'companionRemote.pairing.connectUsingManual' => 'Connettiti a un dispositivo tramite inserimento manuale per iniziare',
'companionRemote.pairing.invalidQrCode' => 'Formato QR code non valido',
'companionRemote.pairing.removeRecentConnection' => 'Rimuovi connessione recente',
'companionRemote.pairing.removeConfirm' => ({required Object name}) => 'Rimuovere "${name}" dalle connessioni recenti?',
'companionRemote.pairing.validationHostRequired' => 'Inserisci l\'indirizzo host',
'companionRemote.pairing.validationHostFormat' => 'Il formato deve essere IP:porta (es. 192.168.1.100:48632)',
'companionRemote.pairing.validationSessionIdRequired' => 'Inserisci un ID sessione',
@@ -1981,7 +1967,6 @@ extension on TranslationsIt {
'companionRemote.pairing.connectionTimedOut' => 'Connessione scaduta. Verifica l\'ID sessione e il PIN.',
'companionRemote.pairing.sessionNotFound' => 'Sessione non trovata. Verifica le tue credenziali.',
'companionRemote.pairing.failedToConnect' => ({required Object error}) => 'Connessione fallita: ${error}',
'companionRemote.pairing.failedToLoadRecent' => ({required Object error}) => 'Impossibile caricare le sessioni recenti: ${error}',
'companionRemote.remote.disconnectConfirm' => 'Vuoi disconnetterti dalla sessione remota?',
'companionRemote.remote.reconnecting' => 'Riconnessione...',
'companionRemote.remote.attemptOf' => ({required Object current}) => 'Tentativo ${current} di 5',
@@ -2019,6 +2004,7 @@ extension on TranslationsIt {
'videoSettings.hdr' => 'HDR',
'videoSettings.audioOutput' => 'Uscita audio',
'videoSettings.performanceOverlay' => 'Overlay prestazioni',
'videoSettings.audioPassthrough' => 'Audio Passthrough',
'externalPlayer.title' => 'Lettore esterno',
'externalPlayer.useExternalPlayer' => 'Usa lettore esterno',
'externalPlayer.useExternalPlayerDescription' => 'Apri i video in un\'app esterna invece del lettore integrato',
+2 -16
View File
@@ -1018,6 +1018,7 @@ class _TranslationsVideoSettingsKo implements TranslationsVideoSettingsEn {
@override String get hdr => 'HDR';
@override String get audioOutput => '오디오 출력';
@override String get performanceOverlay => '성능 오버레이';
@override String get audioPassthrough => '오디오 패스스루';
}
// Path: externalPlayer
@@ -1213,11 +1214,8 @@ class _TranslationsCompanionRemotePairingKo implements TranslationsCompanionRemo
final TranslationsKo _root; // ignore: unused_field
// Translations
@override String get recent => '최근';
@override String get scan => '스캔';
@override String get manual => '수동';
@override String get recentConnections => '최근 연결';
@override String get quickReconnect => '이전에 페어링한 기기에 빠르게 재연결';
@override String get pairWithDesktop => '데스크톱과 페어링';
@override String get enterSessionDetails => '데스크톱 기기에 표시된 세션 정보를 입력하세요';
@override String get hostAddressHint => '192.168.1.100:48632';
@@ -1231,11 +1229,7 @@ class _TranslationsCompanionRemotePairingKo implements TranslationsCompanionRemo
@override String get cameraPermissionRequired => 'QR 코드를 스캔하려면 카메라 권한이 필요합니다.\n기기 설정에서 카메라 접근을 허용해 주세요.';
@override String cameraError({required Object error}) => '카메라를 시작할 수 없습니다: ${error}';
@override String get scanInstruction => '데스크톱에 표시된 QR 코드에 카메라를 향하세요';
@override String get noRecentConnections => '최근 연결 없음';
@override String get connectUsingManual => '수동 입력으로 기기에 연결하여 시작하세요';
@override String get invalidQrCode => '유효하지 않은 QR 코드 형식';
@override String get removeRecentConnection => '최근 연결 삭제';
@override String removeConfirm({required Object name}) => '"${name}"을(를) 최근 연결에서 삭제하시겠습니까?';
@override String get validationHostRequired => '호스트 주소를 입력하세요';
@override String get validationHostFormat => 'IP:포트 형식이어야 합니다 (예: 192.168.1.100:48632)';
@override String get validationSessionIdRequired => '세션 ID를 입력하세요';
@@ -1245,7 +1239,6 @@ class _TranslationsCompanionRemotePairingKo implements TranslationsCompanionRemo
@override String get connectionTimedOut => '연결 시간이 초과되었습니다. 세션 ID와 PIN을 확인하세요.';
@override String get sessionNotFound => '세션을 찾을 수 없습니다. 자격 증명을 확인하세요.';
@override String failedToConnect({required Object error}) => '연결 실패: ${error}';
@override String failedToLoadRecent({required Object error}) => '최근 세션 로드 실패: ${error}';
}
// Path: companionRemote.remote
@@ -1949,11 +1942,8 @@ extension on TranslationsKo {
'companionRemote.session.copyToClipboard' => '클립보드에 복사',
'companionRemote.session.newSession' => '새 세션',
'companionRemote.session.minimize' => '최소화',
'companionRemote.pairing.recent' => '최근',
'companionRemote.pairing.scan' => '스캔',
'companionRemote.pairing.manual' => '수동',
'companionRemote.pairing.recentConnections' => '최근 연결',
'companionRemote.pairing.quickReconnect' => '이전에 페어링한 기기에 빠르게 재연결',
'companionRemote.pairing.pairWithDesktop' => '데스크톱과 페어링',
'companionRemote.pairing.enterSessionDetails' => '데스크톱 기기에 표시된 세션 정보를 입력하세요',
'companionRemote.pairing.hostAddressHint' => '192.168.1.100:48632',
@@ -1967,11 +1957,7 @@ extension on TranslationsKo {
'companionRemote.pairing.cameraPermissionRequired' => 'QR 코드를 스캔하려면 카메라 권한이 필요합니다.\n기기 설정에서 카메라 접근을 허용해 주세요.',
'companionRemote.pairing.cameraError' => ({required Object error}) => '카메라를 시작할 수 없습니다: ${error}',
'companionRemote.pairing.scanInstruction' => '데스크톱에 표시된 QR 코드에 카메라를 향하세요',
'companionRemote.pairing.noRecentConnections' => '최근 연결 없음',
'companionRemote.pairing.connectUsingManual' => '수동 입력으로 기기에 연결하여 시작하세요',
'companionRemote.pairing.invalidQrCode' => '유효하지 않은 QR 코드 형식',
'companionRemote.pairing.removeRecentConnection' => '최근 연결 삭제',
'companionRemote.pairing.removeConfirm' => ({required Object name}) => '"${name}"을(를) 최근 연결에서 삭제하시겠습니까?',
'companionRemote.pairing.validationHostRequired' => '호스트 주소를 입력하세요',
'companionRemote.pairing.validationHostFormat' => 'IP:포트 형식이어야 합니다 (예: 192.168.1.100:48632)',
'companionRemote.pairing.validationSessionIdRequired' => '세션 ID를 입력하세요',
@@ -1981,7 +1967,6 @@ extension on TranslationsKo {
'companionRemote.pairing.connectionTimedOut' => '연결 시간이 초과되었습니다. 세션 ID와 PIN을 확인하세요.',
'companionRemote.pairing.sessionNotFound' => '세션을 찾을 수 없습니다. 자격 증명을 확인하세요.',
'companionRemote.pairing.failedToConnect' => ({required Object error}) => '연결 실패: ${error}',
'companionRemote.pairing.failedToLoadRecent' => ({required Object error}) => '최근 세션 로드 실패: ${error}',
'companionRemote.remote.disconnectConfirm' => '원격 세션 연결을 해제하시겠습니까?',
'companionRemote.remote.reconnecting' => '재연결 중...',
'companionRemote.remote.attemptOf' => ({required Object current}) => '${current}/5 시도 중',
@@ -2019,6 +2004,7 @@ extension on TranslationsKo {
'videoSettings.hdr' => 'HDR',
'videoSettings.audioOutput' => '오디오 출력',
'videoSettings.performanceOverlay' => '성능 오버레이',
'videoSettings.audioPassthrough' => '오디오 패스스루',
'externalPlayer.title' => '외부 플레이어',
'externalPlayer.useExternalPlayer' => '외부 플레이어 사용',
'externalPlayer.useExternalPlayerDescription' => '내장 플레이어 대신 외부 앱에서 동영상 열기',
+2 -16
View File
@@ -1018,6 +1018,7 @@ class _TranslationsVideoSettingsNl implements TranslationsVideoSettingsEn {
@override String get hdr => 'HDR';
@override String get audioOutput => 'Audio-uitvoer';
@override String get performanceOverlay => 'Prestatie-overlay';
@override String get audioPassthrough => 'Audio-doorvoer';
}
// Path: externalPlayer
@@ -1213,11 +1214,8 @@ class _TranslationsCompanionRemotePairingNl implements TranslationsCompanionRemo
final TranslationsNl _root; // ignore: unused_field
// Translations
@override String get recent => 'Recent';
@override String get scan => 'Scannen';
@override String get manual => 'Handmatig';
@override String get recentConnections => 'Recente verbindingen';
@override String get quickReconnect => 'Snel opnieuw verbinden met eerder gekoppelde apparaten';
@override String get pairWithDesktop => 'Koppelen met desktop';
@override String get enterSessionDetails => 'Voer de sessiegegevens in die op je desktop-apparaat worden getoond';
@override String get hostAddressHint => '192.168.1.100:48632';
@@ -1231,11 +1229,7 @@ class _TranslationsCompanionRemotePairingNl implements TranslationsCompanionRemo
@override String get cameraPermissionRequired => 'Cameratoestemming is vereist om QR-codes te scannen.\nGeef cameratoegang in je apparaatinstellingen.';
@override String cameraError({required Object error}) => 'Kan camera niet starten: ${error}';
@override String get scanInstruction => 'Richt je camera op de QR-code die op je desktop wordt getoond';
@override String get noRecentConnections => 'Geen recente verbindingen';
@override String get connectUsingManual => 'Verbind met een apparaat via Handmatige invoer om te beginnen';
@override String get invalidQrCode => 'Ongeldig QR-codeformaat';
@override String get removeRecentConnection => 'Recente verbinding verwijderen';
@override String removeConfirm({required Object name}) => '"${name}" verwijderen uit recente verbindingen?';
@override String get validationHostRequired => 'Voer een hostadres in';
@override String get validationHostFormat => 'Formaat moet IP:poort zijn (bijv. 192.168.1.100:48632)';
@override String get validationSessionIdRequired => 'Voer een sessie-ID in';
@@ -1245,7 +1239,6 @@ class _TranslationsCompanionRemotePairingNl implements TranslationsCompanionRemo
@override String get connectionTimedOut => 'Verbinding verlopen. Controleer de sessie-ID en PIN.';
@override String get sessionNotFound => 'Kan de sessie niet vinden. Controleer je gegevens.';
@override String failedToConnect({required Object error}) => 'Verbinden mislukt: ${error}';
@override String failedToLoadRecent({required Object error}) => 'Kan recente sessies niet laden: ${error}';
}
// Path: companionRemote.remote
@@ -1949,11 +1942,8 @@ extension on TranslationsNl {
'companionRemote.session.copyToClipboard' => 'Kopieer naar klembord',
'companionRemote.session.newSession' => 'Nieuwe sessie',
'companionRemote.session.minimize' => 'Minimaliseren',
'companionRemote.pairing.recent' => 'Recent',
'companionRemote.pairing.scan' => 'Scannen',
'companionRemote.pairing.manual' => 'Handmatig',
'companionRemote.pairing.recentConnections' => 'Recente verbindingen',
'companionRemote.pairing.quickReconnect' => 'Snel opnieuw verbinden met eerder gekoppelde apparaten',
'companionRemote.pairing.pairWithDesktop' => 'Koppelen met desktop',
'companionRemote.pairing.enterSessionDetails' => 'Voer de sessiegegevens in die op je desktop-apparaat worden getoond',
'companionRemote.pairing.hostAddressHint' => '192.168.1.100:48632',
@@ -1967,11 +1957,7 @@ extension on TranslationsNl {
'companionRemote.pairing.cameraPermissionRequired' => 'Cameratoestemming is vereist om QR-codes te scannen.\nGeef cameratoegang in je apparaatinstellingen.',
'companionRemote.pairing.cameraError' => ({required Object error}) => 'Kan camera niet starten: ${error}',
'companionRemote.pairing.scanInstruction' => 'Richt je camera op de QR-code die op je desktop wordt getoond',
'companionRemote.pairing.noRecentConnections' => 'Geen recente verbindingen',
'companionRemote.pairing.connectUsingManual' => 'Verbind met een apparaat via Handmatige invoer om te beginnen',
'companionRemote.pairing.invalidQrCode' => 'Ongeldig QR-codeformaat',
'companionRemote.pairing.removeRecentConnection' => 'Recente verbinding verwijderen',
'companionRemote.pairing.removeConfirm' => ({required Object name}) => '"${name}" verwijderen uit recente verbindingen?',
'companionRemote.pairing.validationHostRequired' => 'Voer een hostadres in',
'companionRemote.pairing.validationHostFormat' => 'Formaat moet IP:poort zijn (bijv. 192.168.1.100:48632)',
'companionRemote.pairing.validationSessionIdRequired' => 'Voer een sessie-ID in',
@@ -1981,7 +1967,6 @@ extension on TranslationsNl {
'companionRemote.pairing.connectionTimedOut' => 'Verbinding verlopen. Controleer de sessie-ID en PIN.',
'companionRemote.pairing.sessionNotFound' => 'Kan de sessie niet vinden. Controleer je gegevens.',
'companionRemote.pairing.failedToConnect' => ({required Object error}) => 'Verbinden mislukt: ${error}',
'companionRemote.pairing.failedToLoadRecent' => ({required Object error}) => 'Kan recente sessies niet laden: ${error}',
'companionRemote.remote.disconnectConfirm' => 'Wil je de verbinding met de externe sessie verbreken?',
'companionRemote.remote.reconnecting' => 'Opnieuw verbinden...',
'companionRemote.remote.attemptOf' => ({required Object current}) => 'Poging ${current} van 5',
@@ -2019,6 +2004,7 @@ extension on TranslationsNl {
'videoSettings.hdr' => 'HDR',
'videoSettings.audioOutput' => 'Audio-uitvoer',
'videoSettings.performanceOverlay' => 'Prestatie-overlay',
'videoSettings.audioPassthrough' => 'Audio-doorvoer',
'externalPlayer.title' => 'Externe speler',
'externalPlayer.useExternalPlayer' => 'Externe speler gebruiken',
'externalPlayer.useExternalPlayerDescription' => 'Open video\'s in een externe app in plaats van de ingebouwde speler',
+2 -16
View File
@@ -1018,6 +1018,7 @@ class _TranslationsVideoSettingsSv implements TranslationsVideoSettingsEn {
@override String get hdr => 'HDR';
@override String get audioOutput => 'Ljudutgång';
@override String get performanceOverlay => 'Prestandaöverlägg';
@override String get audioPassthrough => 'Ljudgenomkoppling';
}
// Path: externalPlayer
@@ -1213,11 +1214,8 @@ class _TranslationsCompanionRemotePairingSv implements TranslationsCompanionRemo
final TranslationsSv _root; // ignore: unused_field
// Translations
@override String get recent => 'Senaste';
@override String get scan => 'Skanna';
@override String get manual => 'Manuell';
@override String get recentConnections => 'Senaste anslutningar';
@override String get quickReconnect => 'Återanslut snabbt till tidigare parkopplade enheter';
@override String get pairWithDesktop => 'Parkoppla med dator';
@override String get enterSessionDetails => 'Ange sessionsuppgifterna som visas på din datorenhet';
@override String get hostAddressHint => '192.168.1.100:48632';
@@ -1231,11 +1229,7 @@ class _TranslationsCompanionRemotePairingSv implements TranslationsCompanionRemo
@override String get cameraPermissionRequired => 'Kamerabehörighet krävs för att skanna QR-koder.\nVänligen ge kameraåtkomst i enhetsinställningarna.';
@override String cameraError({required Object error}) => 'Kunde inte starta kameran: ${error}';
@override String get scanInstruction => 'Rikta kameran mot QR-koden som visas på din dator';
@override String get noRecentConnections => 'Inga senaste anslutningar';
@override String get connectUsingManual => 'Anslut till en enhet via Manuell inmatning för att komma igång';
@override String get invalidQrCode => 'Ogiltigt QR-kodformat';
@override String get removeRecentConnection => 'Ta bort senaste anslutning';
@override String removeConfirm({required Object name}) => 'Ta bort "${name}" från senaste anslutningar?';
@override String get validationHostRequired => 'Ange en värdadress';
@override String get validationHostFormat => 'Format måste vara IP:port (t.ex. 192.168.1.100:48632)';
@override String get validationSessionIdRequired => 'Ange ett sessions-ID';
@@ -1245,7 +1239,6 @@ class _TranslationsCompanionRemotePairingSv implements TranslationsCompanionRemo
@override String get connectionTimedOut => 'Anslutningen tog för lång tid. Kontrollera sessions-ID och PIN.';
@override String get sessionNotFound => 'Kunde inte hitta sessionen. Kontrollera dina uppgifter.';
@override String failedToConnect({required Object error}) => 'Kunde inte ansluta: ${error}';
@override String failedToLoadRecent({required Object error}) => 'Kunde inte ladda senaste sessioner: ${error}';
}
// Path: companionRemote.remote
@@ -1949,11 +1942,8 @@ extension on TranslationsSv {
'companionRemote.session.copyToClipboard' => 'Kopiera till urklipp',
'companionRemote.session.newSession' => 'Ny session',
'companionRemote.session.minimize' => 'Minimera',
'companionRemote.pairing.recent' => 'Senaste',
'companionRemote.pairing.scan' => 'Skanna',
'companionRemote.pairing.manual' => 'Manuell',
'companionRemote.pairing.recentConnections' => 'Senaste anslutningar',
'companionRemote.pairing.quickReconnect' => 'Återanslut snabbt till tidigare parkopplade enheter',
'companionRemote.pairing.pairWithDesktop' => 'Parkoppla med dator',
'companionRemote.pairing.enterSessionDetails' => 'Ange sessionsuppgifterna som visas på din datorenhet',
'companionRemote.pairing.hostAddressHint' => '192.168.1.100:48632',
@@ -1967,11 +1957,7 @@ extension on TranslationsSv {
'companionRemote.pairing.cameraPermissionRequired' => 'Kamerabehörighet krävs för att skanna QR-koder.\nVänligen ge kameraåtkomst i enhetsinställningarna.',
'companionRemote.pairing.cameraError' => ({required Object error}) => 'Kunde inte starta kameran: ${error}',
'companionRemote.pairing.scanInstruction' => 'Rikta kameran mot QR-koden som visas på din dator',
'companionRemote.pairing.noRecentConnections' => 'Inga senaste anslutningar',
'companionRemote.pairing.connectUsingManual' => 'Anslut till en enhet via Manuell inmatning för att komma igång',
'companionRemote.pairing.invalidQrCode' => 'Ogiltigt QR-kodformat',
'companionRemote.pairing.removeRecentConnection' => 'Ta bort senaste anslutning',
'companionRemote.pairing.removeConfirm' => ({required Object name}) => 'Ta bort "${name}" från senaste anslutningar?',
'companionRemote.pairing.validationHostRequired' => 'Ange en värdadress',
'companionRemote.pairing.validationHostFormat' => 'Format måste vara IP:port (t.ex. 192.168.1.100:48632)',
'companionRemote.pairing.validationSessionIdRequired' => 'Ange ett sessions-ID',
@@ -1981,7 +1967,6 @@ extension on TranslationsSv {
'companionRemote.pairing.connectionTimedOut' => 'Anslutningen tog för lång tid. Kontrollera sessions-ID och PIN.',
'companionRemote.pairing.sessionNotFound' => 'Kunde inte hitta sessionen. Kontrollera dina uppgifter.',
'companionRemote.pairing.failedToConnect' => ({required Object error}) => 'Kunde inte ansluta: ${error}',
'companionRemote.pairing.failedToLoadRecent' => ({required Object error}) => 'Kunde inte ladda senaste sessioner: ${error}',
'companionRemote.remote.disconnectConfirm' => 'Vill du koppla från fjärrsessionen?',
'companionRemote.remote.reconnecting' => 'Återansluter...',
'companionRemote.remote.attemptOf' => ({required Object current}) => 'Försök ${current} av 5',
@@ -2019,6 +2004,7 @@ extension on TranslationsSv {
'videoSettings.hdr' => 'HDR',
'videoSettings.audioOutput' => 'Ljudutgång',
'videoSettings.performanceOverlay' => 'Prestandaöverlägg',
'videoSettings.audioPassthrough' => 'Ljudgenomkoppling',
'externalPlayer.title' => 'Extern spelare',
'externalPlayer.useExternalPlayer' => 'Använd extern spelare',
'externalPlayer.useExternalPlayerDescription' => 'Öppna videor i en extern app istället för den inbyggda spelaren',
+2 -16
View File
@@ -1018,6 +1018,7 @@ class _TranslationsVideoSettingsZh implements TranslationsVideoSettingsEn {
@override String get hdr => 'HDR';
@override String get audioOutput => '音频输出';
@override String get performanceOverlay => '性能监控';
@override String get audioPassthrough => '音频直通';
}
// Path: externalPlayer
@@ -1213,11 +1214,8 @@ class _TranslationsCompanionRemotePairingZh implements TranslationsCompanionRemo
final TranslationsZh _root; // ignore: unused_field
// Translations
@override String get recent => '最近';
@override String get scan => '扫描';
@override String get manual => '手动';
@override String get recentConnections => '最近连接';
@override String get quickReconnect => '快速重新连接之前配对的设备';
@override String get pairWithDesktop => '与桌面配对';
@override String get enterSessionDetails => '输入桌面设备上显示的会话信息';
@override String get hostAddressHint => '192.168.1.100:48632';
@@ -1231,11 +1229,7 @@ class _TranslationsCompanionRemotePairingZh implements TranslationsCompanionRemo
@override String get cameraPermissionRequired => '扫描 QR 码需要相机权限。\n请在设备设置中授予相机访问权限。';
@override String cameraError({required Object error}) => '无法启动相机:${error}';
@override String get scanInstruction => '将相机对准桌面上显示的 QR 码';
@override String get noRecentConnections => '没有最近的连接';
@override String get connectUsingManual => '使用手动输入连接设备以开始使用';
@override String get invalidQrCode => '无效的 QR 码格式';
@override String get removeRecentConnection => '删除最近连接';
@override String removeConfirm({required Object name}) => '确定要从最近连接中删除 "${name}" 吗?';
@override String get validationHostRequired => '请输入主机地址';
@override String get validationHostFormat => '格式必须为 IP:端口(例如 192.168.1.100:48632)';
@override String get validationSessionIdRequired => '请输入会话 ID';
@@ -1245,7 +1239,6 @@ class _TranslationsCompanionRemotePairingZh implements TranslationsCompanionRemo
@override String get connectionTimedOut => '连接超时。请检查会话 ID 和 PIN。';
@override String get sessionNotFound => '找不到会话。请检查您的凭据。';
@override String failedToConnect({required Object error}) => '连接失败:${error}';
@override String failedToLoadRecent({required Object error}) => '加载最近会话失败:${error}';
}
// Path: companionRemote.remote
@@ -1949,11 +1942,8 @@ extension on TranslationsZh {
'companionRemote.session.copyToClipboard' => '复制到剪贴板',
'companionRemote.session.newSession' => '新建会话',
'companionRemote.session.minimize' => '最小化',
'companionRemote.pairing.recent' => '最近',
'companionRemote.pairing.scan' => '扫描',
'companionRemote.pairing.manual' => '手动',
'companionRemote.pairing.recentConnections' => '最近连接',
'companionRemote.pairing.quickReconnect' => '快速重新连接之前配对的设备',
'companionRemote.pairing.pairWithDesktop' => '与桌面配对',
'companionRemote.pairing.enterSessionDetails' => '输入桌面设备上显示的会话信息',
'companionRemote.pairing.hostAddressHint' => '192.168.1.100:48632',
@@ -1967,11 +1957,7 @@ extension on TranslationsZh {
'companionRemote.pairing.cameraPermissionRequired' => '扫描 QR 码需要相机权限。\n请在设备设置中授予相机访问权限。',
'companionRemote.pairing.cameraError' => ({required Object error}) => '无法启动相机:${error}',
'companionRemote.pairing.scanInstruction' => '将相机对准桌面上显示的 QR 码',
'companionRemote.pairing.noRecentConnections' => '没有最近的连接',
'companionRemote.pairing.connectUsingManual' => '使用手动输入连接设备以开始使用',
'companionRemote.pairing.invalidQrCode' => '无效的 QR 码格式',
'companionRemote.pairing.removeRecentConnection' => '删除最近连接',
'companionRemote.pairing.removeConfirm' => ({required Object name}) => '确定要从最近连接中删除 "${name}" 吗?',
'companionRemote.pairing.validationHostRequired' => '请输入主机地址',
'companionRemote.pairing.validationHostFormat' => '格式必须为 IP:端口(例如 192.168.1.100:48632)',
'companionRemote.pairing.validationSessionIdRequired' => '请输入会话 ID',
@@ -1981,7 +1967,6 @@ extension on TranslationsZh {
'companionRemote.pairing.connectionTimedOut' => '连接超时。请检查会话 ID 和 PIN。',
'companionRemote.pairing.sessionNotFound' => '找不到会话。请检查您的凭据。',
'companionRemote.pairing.failedToConnect' => ({required Object error}) => '连接失败:${error}',
'companionRemote.pairing.failedToLoadRecent' => ({required Object error}) => '加载最近会话失败:${error}',
'companionRemote.remote.disconnectConfirm' => '是否要断开远程会话的连接?',
'companionRemote.remote.reconnecting' => '重新连接中...',
'companionRemote.remote.attemptOf' => ({required Object current}) => '第 ${current} 次尝试,共 5 次',
@@ -2019,6 +2004,7 @@ extension on TranslationsZh {
'videoSettings.hdr' => 'HDR',
'videoSettings.audioOutput' => '音频输出',
'videoSettings.performanceOverlay' => '性能监控',
'videoSettings.audioPassthrough' => '音频直通',
'externalPlayer.title' => '外部播放器',
'externalPlayer.useExternalPlayer' => '使用外部播放器',
'externalPlayer.useExternalPlayerDescription' => '在外部应用中打开视频,而不是使用内置播放器',
+3 -10
View File
@@ -732,11 +732,8 @@
"minimize": "Minimera"
},
"pairing": {
"recent": "Senaste",
"scan": "Skanna",
"manual": "Manuell",
"recentConnections": "Senaste anslutningar",
"quickReconnect": "Återanslut snabbt till tidigare parkopplade enheter",
"pairWithDesktop": "Parkoppla med dator",
"enterSessionDetails": "Ange sessionsuppgifterna som visas på din datorenhet",
"hostAddressHint": "192.168.1.100:48632",
@@ -750,11 +747,7 @@
"cameraPermissionRequired": "Kamerabehörighet krävs för att skanna QR-koder.\nVänligen ge kameraåtkomst i enhetsinställningarna.",
"cameraError": "Kunde inte starta kameran: ${error}",
"scanInstruction": "Rikta kameran mot QR-koden som visas på din dator",
"noRecentConnections": "Inga senaste anslutningar",
"connectUsingManual": "Anslut till en enhet via Manuell inmatning för att komma igång",
"invalidQrCode": "Ogiltigt QR-kodformat",
"removeRecentConnection": "Ta bort senaste anslutning",
"removeConfirm": "Ta bort \"${name}\" från senaste anslutningar?",
"validationHostRequired": "Ange en värdadress",
"validationHostFormat": "Format måste vara IP:port (t.ex. 192.168.1.100:48632)",
"validationSessionIdRequired": "Ange ett sessions-ID",
@@ -763,8 +756,7 @@
"validationPinLength": "PIN måste vara 6 siffror",
"connectionTimedOut": "Anslutningen tog för lång tid. Kontrollera sessions-ID och PIN.",
"sessionNotFound": "Kunde inte hitta sessionen. Kontrollera dina uppgifter.",
"failedToConnect": "Kunde inte ansluta: ${error}",
"failedToLoadRecent": "Kunde inte ladda senaste sessioner: ${error}"
"failedToConnect": "Kunde inte ansluta: ${error}"
},
"remote": {
"disconnectConfirm": "Vill du koppla från fjärrsessionen?",
@@ -806,7 +798,8 @@
"subtitleSync": "Undertextsynkronisering",
"hdr": "HDR",
"audioOutput": "Ljudutgång",
"performanceOverlay": "Prestandaöverlägg"
"performanceOverlay": "Prestandaöverlägg",
"audioPassthrough": "Ljudgenomkoppling"
},
"externalPlayer": {
"title": "Extern spelare",
+3 -10
View File
@@ -732,11 +732,8 @@
"minimize": "最小化"
},
"pairing": {
"recent": "最近",
"scan": "扫描",
"manual": "手动",
"recentConnections": "最近连接",
"quickReconnect": "快速重新连接之前配对的设备",
"pairWithDesktop": "与桌面配对",
"enterSessionDetails": "输入桌面设备上显示的会话信息",
"hostAddressHint": "192.168.1.100:48632",
@@ -750,11 +747,7 @@
"cameraPermissionRequired": "扫描 QR 码需要相机权限。\n请在设备设置中授予相机访问权限。",
"cameraError": "无法启动相机:${error}",
"scanInstruction": "将相机对准桌面上显示的 QR 码",
"noRecentConnections": "没有最近的连接",
"connectUsingManual": "使用手动输入连接设备以开始使用",
"invalidQrCode": "无效的 QR 码格式",
"removeRecentConnection": "删除最近连接",
"removeConfirm": "确定要从最近连接中删除 \"${name}\" 吗?",
"validationHostRequired": "请输入主机地址",
"validationHostFormat": "格式必须为 IP:端口(例如 192.168.1.100:48632)",
"validationSessionIdRequired": "请输入会话 ID",
@@ -763,8 +756,7 @@
"validationPinLength": "PIN 必须为6位数字",
"connectionTimedOut": "连接超时。请检查会话 ID 和 PIN。",
"sessionNotFound": "找不到会话。请检查您的凭据。",
"failedToConnect": "连接失败:${error}",
"failedToLoadRecent": "加载最近会话失败:${error}"
"failedToConnect": "连接失败:${error}"
},
"remote": {
"disconnectConfirm": "是否要断开远程会话的连接?",
@@ -806,7 +798,8 @@
"subtitleSync": "字幕同步",
"hdr": "HDR",
"audioOutput": "音频输出",
"performanceOverlay": "性能监控"
"performanceOverlay": "性能监控",
"audioPassthrough": "音频直通"
},
"externalPlayer": {
"title": "外部播放器",
+18 -5
View File
@@ -79,7 +79,8 @@ void main() async {
await initializeDateFormatting(savedLocale.languageCode, null);
// Configure image cache for large libraries
PaintingBinding.instance.imageCache.maximumSizeBytes = 200 << 20; // 200MB
PaintingBinding.instance.imageCache.maximumSize = 2000; // default 1000
PaintingBinding.instance.imageCache.maximumSizeBytes = 300 << 20; // 300MB
// Initialize services in parallel where possible
final futures = <Future<void>>[];
@@ -377,13 +378,25 @@ class _SetupScreenState extends State<SetupScreen> {
final storage = await StorageService.getInstance();
final registry = ServerRegistry(storage);
// Check network connectivity early to fast-path airplane mode
final connectivityResult = await Connectivity().checkConnectivity();
// Check network connectivity early to fast-path airplane mode.
// Timeout guards against connectivity_plus hanging on some Android TV devices after force-close.
final connectivityResult = await Connectivity()
.checkConnectivity()
.timeout(const Duration(seconds: 3), onTimeout: () => [ConnectivityResult.other]);
final hasNetwork = !connectivityResult.contains(ConnectivityResult.none);
if (hasNetwork) {
// Refresh servers from API to get updated connection info (IPs may change)
await registry.refreshServersFromApi();
// Refresh servers from API to get updated connection info (IPs may change).
// If the stored token is invalid (e.g. after removing a Plex profile PIN),
// redirect to AuthScreen so the user can re-authenticate.
final refreshResult = await registry.refreshServersFromApi();
if (refreshResult == ServerRefreshResult.authError) {
await storage.clearCredentials();
if (mounted) {
Navigator.pushReplacement(context, MaterialPageRoute(builder: (context) => const AuthScreen()));
}
return;
}
}
// Load all configured servers
@@ -1,55 +0,0 @@
import 'package:json_annotation/json_annotation.dart';
part 'recent_remote_session.g.dart';
/// Recent Companion Remote session for quick reconnection
@JsonSerializable()
class RecentRemoteSession {
final String sessionId;
final String pin;
final String deviceName;
final String platform;
final DateTime lastConnected;
final String? hostAddress; // Format: "ip:port"
RecentRemoteSession({
required this.sessionId,
required this.pin,
required this.deviceName,
required this.platform,
required this.lastConnected,
this.hostAddress,
});
factory RecentRemoteSession.fromJson(Map<String, dynamic> json) => _$RecentRemoteSessionFromJson(json);
Map<String, dynamic> toJson() => _$RecentRemoteSessionToJson(this);
/// Create from QR code data (format: "ip1,ip2|port|sessionId|pin" or legacy "ip|port|sessionId|pin")
factory RecentRemoteSession.fromQrData(String qrData) {
final parts = qrData.split('|');
if (parts.length < 4) {
throw FormatException('Invalid QR code format - expected ip|port|sessionId|pin');
}
final ipsField = parts.first;
final port = parts[1];
final sessionId = parts[2];
final pin = parts[3];
// Use the first IP for storage (comma-separated IPs supported in QR)
final firstIp = ipsField.split(',').first;
return RecentRemoteSession(
sessionId: sessionId,
pin: pin,
deviceName: 'Unknown Device',
platform: 'unknown',
lastConnected: DateTime.now(),
hostAddress: '$firstIp:$port',
);
}
@override
String toString() => '$deviceName ($platform) - Last: ${lastConnected.toLocal()}';
}
@@ -1,25 +0,0 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'recent_remote_session.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
RecentRemoteSession _$RecentRemoteSessionFromJson(Map<String, dynamic> json) => RecentRemoteSession(
sessionId: json['sessionId'] as String,
pin: json['pin'] as String,
deviceName: json['deviceName'] as String,
platform: json['platform'] as String,
lastConnected: DateTime.parse(json['lastConnected'] as String),
hostAddress: json['hostAddress'] as String?,
);
Map<String, dynamic> _$RecentRemoteSessionToJson(RecentRemoteSession instance) => <String, dynamic>{
'sessionId': instance.sessionId,
'pin': instance.pin,
'deviceName': instance.deviceName,
'platform': instance.platform,
'lastConnected': instance.lastConnected.toIso8601String(),
'hostAddress': instance.hostAddress,
};
+1 -1
View File
@@ -173,7 +173,7 @@ class PlexMarker {
bool containsPosition(Duration position) {
final posMs = position.inMilliseconds;
return posMs >= startTimeOffset && posMs <= endTimeOffset;
return posMs >= startTimeOffset && posMs < endTimeOffset;
}
}
+4
View File
@@ -92,6 +92,7 @@ class PlexMetadata with MultiServerFields {
final int? playlistItemID; // Playlist item ID (for dumb playlists only)
final int? playQueueItemID; // Play queue item ID (unique even for duplicates)
final int? librarySectionID; // Library section ID this item belongs to
final String? librarySectionTitle; // Library section title this item belongs to
final String? ratingImage; // Rating source URI (e.g. rottentomatoes://image.rating.ripe)
final String? audienceRatingImage; // Audience rating source URI
final String? tagline;
@@ -174,6 +175,7 @@ class PlexMetadata with MultiServerFields {
this.playlistItemID,
this.playQueueItemID,
this.librarySectionID,
this.librarySectionTitle,
this.ratingImage,
this.audienceRatingImage,
this.tagline,
@@ -229,6 +231,7 @@ class PlexMetadata with MultiServerFields {
int? playlistItemID,
int? playQueueItemID,
int? librarySectionID,
String? librarySectionTitle,
String? ratingImage,
String? audienceRatingImage,
String? tagline,
@@ -282,6 +285,7 @@ class PlexMetadata with MultiServerFields {
playlistItemID: playlistItemID ?? this.playlistItemID,
playQueueItemID: playQueueItemID ?? this.playQueueItemID,
librarySectionID: librarySectionID ?? this.librarySectionID,
librarySectionTitle: librarySectionTitle ?? this.librarySectionTitle,
ratingImage: ratingImage ?? this.ratingImage,
audienceRatingImage: audienceRatingImage ?? this.audienceRatingImage,
tagline: tagline ?? this.tagline,
+2
View File
@@ -48,6 +48,7 @@ PlexMetadata _$PlexMetadataFromJson(Map<String, dynamic> json) => PlexMetadata(
playlistItemID: (json['playlistItemID'] as num?)?.toInt(),
playQueueItemID: (json['playQueueItemID'] as num?)?.toInt(),
librarySectionID: (json['librarySectionID'] as num?)?.toInt(),
librarySectionTitle: json['librarySectionTitle'] as String?,
ratingImage: json['ratingImage'] as String?,
audienceRatingImage: json['audienceRatingImage'] as String?,
tagline: json['tagline'] as String?,
@@ -100,6 +101,7 @@ Map<String, dynamic> _$PlexMetadataToJson(PlexMetadata instance) => <String, dyn
'playlistItemID': instance.playlistItemID,
'playQueueItemID': instance.playQueueItemID,
'librarySectionID': instance.librarySectionID,
'librarySectionTitle': instance.librarySectionTitle,
'ratingImage': instance.ratingImage,
'audienceRatingImage': instance.audienceRatingImage,
'tagline': instance.tagline,
+1 -91
View File
@@ -10,8 +10,6 @@ import '../models/companion_remote/remote_command_type.dart';
import '../models/companion_remote/remote_session.dart';
import '../models/companion_remote/trusted_device.dart';
import '../services/companion_remote/companion_remote_peer_service.dart';
import '../models/companion_remote/recent_remote_session.dart';
import '../services/companion_remote/companion_remote_discovery_service.dart';
import '../services/storage_service.dart';
import '../utils/app_logger.dart';
@@ -21,11 +19,9 @@ typedef DeviceApprovalCallback = Future<bool> Function(RemoteDevice device);
class CompanionRemoteProvider with ChangeNotifier {
RemoteSession? _session;
CompanionRemotePeerService? _peerService;
CompanionRemoteDiscoveryService? _discoveryService;
String _deviceName = 'Unknown Device';
String _platform = 'unknown';
final List<TrustedDevice> _trustedDevices = [];
final List<RecentRemoteSession> _recentSessions = [];
bool _isPlayerActive = false;
static const String _storageKey = 'companion_remote_trusted_devices';
@@ -46,7 +42,6 @@ class CompanionRemoteProvider with ChangeNotifier {
StreamSubscription<void>? _deviceDisconnectedSubscription;
StreamSubscription<RemotePeerError>? _errorSubscription;
StreamSubscription<RemoteSessionStatus>? _statusSubscription;
StreamSubscription<List<RecentRemoteSession>>? _recentSessionsSubscription;
CommandReceivedCallback? onCommandReceived;
DeviceApprovalCallback? onDeviceApprovalRequired;
@@ -61,7 +56,6 @@ class CompanionRemoteProvider with ChangeNotifier {
String? get pin => _session?.pin;
RemoteDevice? get connectedDevice => _session?.connectedDevice;
List<TrustedDevice> get trustedDevices => List.unmodifiable(_trustedDevices);
List<RecentRemoteSession> get recentSessions => List.unmodifiable(_recentSessions);
bool get isPlayerActive => _isPlayerActive;
CompanionRemoteProvider() {
@@ -165,7 +159,7 @@ class CompanionRemoteProvider with ChangeNotifier {
});
}
Future<void> _handleDeviceInfo(RemoteCommand command) async {
void _handleDeviceInfo(RemoteCommand command) {
if (command.data != null) {
final id = command.data!['id'] as String? ?? 'unknown';
final name = command.data!['name'] as String? ?? 'Unknown Device';
@@ -178,9 +172,6 @@ class CompanionRemoteProvider with ChangeNotifier {
_session = _session?.copyWith(connectedDevice: device);
notifyListeners();
// Save to recent sessions now that we have the remote device's real identity
await _addToRecentSessions();
}
}
@@ -470,91 +461,10 @@ class CompanionRemoteProvider with ChangeNotifier {
return storage.prefs.getString(_lastDeviceKey);
}
/// Load recent sessions
Future<void> loadRecentSessions() async {
try {
// Dispose previous discovery service and subscription to avoid leaks
_recentSessionsSubscription?.cancel();
_recentSessionsSubscription = null;
_discoveryService?.dispose();
_discoveryService = CompanionRemoteDiscoveryService();
// Listen for recent sessions updates
_recentSessionsSubscription = _discoveryService!.recentSessions.listen((sessions) {
_recentSessions.clear();
_recentSessions.addAll(sessions);
notifyListeners();
});
// Initial load happens in constructor, just notify
_recentSessions.clear();
_recentSessions.addAll(_discoveryService!.currentSessions);
notifyListeners();
appLogger.d('CompanionRemote: Loaded ${_recentSessions.length} recent sessions');
} catch (e) {
appLogger.e('CompanionRemote: Failed to load recent sessions', error: e);
}
}
/// Add current session to recent list (called after successful connection)
Future<void> _addToRecentSessions() async {
if (_session == null || _session!.sessionId.isEmpty) return;
// For mobile (remote role), save the connected desktop device
// For desktop (host role), this doesn't really apply but save connected mobile device
final deviceToSave = _session!.connectedDevice;
if (deviceToSave == null) {
appLogger.w('CompanionRemote: No connected device to save to recent sessions');
return;
}
final recentSession = RecentRemoteSession(
sessionId: _session!.sessionId,
pin: _session!.pin,
deviceName: deviceToSave.name,
platform: deviceToSave.platform,
lastConnected: DateTime.now(),
hostAddress: _peerService?.hostAddress,
);
if (_discoveryService != null) {
await _discoveryService!.addRecentSession(recentSession);
}
}
/// Connect to a recent session
Future<void> connectToRecentSession(RecentRemoteSession session) async {
if (session.hostAddress == null) {
throw const RemotePeerError(
type: RemotePeerErrorType.invalidSession,
message: 'No host address available for this session. Please scan a new QR code.',
);
}
await joinSession(session.sessionId, session.pin, session.hostAddress!);
}
/// Remove a recent session
Future<void> removeRecentSession(String sessionId) async {
if (_discoveryService != null) {
await _discoveryService!.removeRecentSession(sessionId);
}
}
/// Clear all recent sessions
Future<void> clearRecentSessions() async {
if (_discoveryService != null) {
await _discoveryService!.clearRecentSessions();
}
}
@override
void dispose() {
_reconnectTimer?.cancel();
leaveSession();
_recentSessionsSubscription?.cancel();
_discoveryService?.dispose();
super.dispose();
}
}
+10 -11
View File
@@ -656,19 +656,18 @@ class DownloadProvider extends ChangeNotifier {
}
}
// Fetch full metadata to get year, summary, clearLogo
// The metadata from getChildren() is summarized and missing these fields.
// If metadata already has summary, it's already full (e.g., from detail screen).
// Always fetch full metadata before downloading.
// Hub items may have summary but the cache at /library/metadata/$ratingKey
// won't have the full API response (with Media/Part data needed for video URL)
// unless getMetadataWithImages has been called.
PlexMetadata metadataToStore = metadata;
if (metadata.summary == null) {
try {
final fullMetadata = await client.getMetadataWithImages(metadata.ratingKey);
if (fullMetadata != null) {
metadataToStore = fullMetadata.copyWith(serverId: metadata.serverId, serverName: metadata.serverName);
}
} catch (e) {
appLogger.w('Failed to fetch full metadata for ${metadata.ratingKey}, using partial', error: e);
try {
final fullMetadata = await client.getMetadataWithImages(metadata.ratingKey);
if (fullMetadata != null) {
metadataToStore = fullMetadata.copyWith(serverId: metadata.serverId, serverName: metadata.serverName);
}
} catch (e) {
appLogger.w('Failed to fetch full metadata for ${metadata.ratingKey}, using partial', error: e);
}
// For episodes, also fetch and store show and season metadata for offline display
+3 -1
View File
@@ -28,7 +28,9 @@ class OfflineModeProvider extends ChangeNotifier {
/// Updates network and server connection flags
Future<void> _updateConnectionFlags() async {
final connectivityResult = await Connectivity().checkConnectivity();
final connectivityResult = await Connectivity()
.checkConnectivity()
.timeout(const Duration(seconds: 3), onTimeout: () => [ConnectivityResult.other]);
_hasNetworkConnection = !connectivityResult.contains(ConnectivityResult.none);
_hasServerConnection = _serverManager.onlineServerIds.isNotEmpty;
}
+20 -219
View File
@@ -5,11 +5,8 @@ import 'package:flutter/services.dart';
import 'package:mobile_scanner/mobile_scanner.dart';
import 'package:provider/provider.dart';
import '../../focus/focusable_button.dart';
import '../../i18n/strings.g.dart';
import '../../providers/companion_remote_provider.dart';
import '../../utils/formatters.dart';
import '../../models/companion_remote/recent_remote_session.dart';
import '../../utils/app_logger.dart';
class PairingScreen extends StatefulWidget {
@@ -25,8 +22,6 @@ class _PairingScreenState extends State<PairingScreen> {
final _pinController = TextEditingController();
final _formKey = GlobalKey<FormState>();
bool _isConnecting = false;
String? _connectingSessionId;
bool _isDiscovering = false;
String? _errorMessage;
int _selectedTab = 0;
@@ -36,15 +31,9 @@ class _PairingScreenState extends State<PairingScreen> {
bool get _isMobile => Platform.isAndroid || Platform.isIOS;
// Tab indices shift when scan tab is present
int get _scanTabIndex => _isMobile ? 1 : -1;
int get _manualTabIndex => _isMobile ? 2 : 1;
@override
void initState() {
super.initState();
_loadRecentSessions();
}
// Tab indices: mobile gets Scan (0) + Manual (1), desktop gets Manual (0)
int get _scanTabIndex => _isMobile ? 0 : -1;
int get _manualTabIndex => _isMobile ? 1 : 0;
@override
void dispose() {
@@ -55,51 +44,6 @@ class _PairingScreenState extends State<PairingScreen> {
super.dispose();
}
Future<void> _loadRecentSessions() async {
setState(() {
_isDiscovering = true;
_errorMessage = null;
});
try {
await context.read<CompanionRemoteProvider>().loadRecentSessions();
if (!mounted) return;
setState(() {
_isDiscovering = false;
});
} catch (e) {
appLogger.e('Failed to load recent sessions', error: e);
if (!mounted) return;
setState(() {
_isDiscovering = false;
_errorMessage = t.companionRemote.pairing.failedToLoadRecent(error: e.toString());
});
}
}
Future<void> _connectToRecentSession(RecentRemoteSession session) async {
setState(() {
_isConnecting = true;
_connectingSessionId = session.sessionId;
_errorMessage = null;
});
try {
await context.read<CompanionRemoteProvider>().connectToRecentSession(session);
if (mounted) {
Navigator.of(context).pop();
}
} catch (e) {
appLogger.e('Failed to connect to recent session', error: e);
setState(() {
_isConnecting = false;
_connectingSessionId = null;
_errorMessage = _parseErrorMessage(e.toString());
});
}
}
Future<void> _connect() async {
if (!_formKey.currentState!.validate()) {
return;
@@ -209,39 +153,30 @@ class _PairingScreenState extends State<PairingScreen> {
return Scaffold(
appBar: AppBar(
title: Text(t.companionRemote.connectToDevice),
actions: [
if (_selectedTab == 0)
IconButton(
icon: const Icon(Icons.refresh),
onPressed: _isDiscovering ? null : _loadRecentSessions,
tooltip: t.common.refresh,
),
],
),
body: Column(
children: [
SegmentedButton<int>(
segments: [
ButtonSegment(value: 0, label: Text(t.companionRemote.pairing.recent), icon: const Icon(Icons.history)),
if (_isMobile)
if (_isMobile)
SegmentedButton<int>(
segments: [
ButtonSegment(
value: _scanTabIndex,
label: Text(t.companionRemote.pairing.scan),
icon: const Icon(Icons.qr_code_scanner),
),
ButtonSegment(
value: _manualTabIndex,
label: Text(t.companionRemote.pairing.manual),
icon: const Icon(Icons.keyboard),
),
],
selected: {_selectedTab},
onSelectionChanged: (Set<int> selection) {
setState(() {
_selectedTab = selection.first;
});
},
),
ButtonSegment(
value: _manualTabIndex,
label: Text(t.companionRemote.pairing.manual),
icon: const Icon(Icons.keyboard),
),
],
selected: {_selectedTab},
onSelectionChanged: (Set<int> selection) {
setState(() {
_selectedTab = selection.first;
});
},
),
Expanded(child: _buildTabContent()),
],
),
@@ -249,8 +184,7 @@ class _PairingScreenState extends State<PairingScreen> {
}
Widget _buildTabContent() {
if (_selectedTab == 0) return _buildDiscoveryTab();
if (_selectedTab == _scanTabIndex) return _buildScanTab();
if (_selectedTab == _scanTabIndex && _isMobile) return _buildScanTab();
return _buildManualEntryTab();
}
@@ -337,139 +271,6 @@ class _PairingScreenState extends State<PairingScreen> {
);
}
Widget _buildDiscoveryTab() {
return Consumer<CompanionRemoteProvider>(
builder: (context, provider, child) {
final sessions = provider.recentSessions;
return SingleChildScrollView(
padding: const EdgeInsets.all(24.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
const Icon(Icons.history, size: 64, color: Colors.blue),
const SizedBox(height: 24),
Text(
t.companionRemote.pairing.recentConnections,
style: Theme.of(context).textTheme.headlineMedium,
textAlign: TextAlign.center,
),
const SizedBox(height: 8),
Text(
t.companionRemote.pairing.quickReconnect,
style: Theme.of(context).textTheme.bodyMedium,
textAlign: TextAlign.center,
),
const SizedBox(height: 32),
if (_isDiscovering) ...[
const Center(child: CircularProgressIndicator()),
const SizedBox(height: 16),
Text(t.common.loading, style: Theme.of(context).textTheme.bodyMedium, textAlign: TextAlign.center),
] else if (sessions.isEmpty) ...[
Card(
child: Padding(
padding: const EdgeInsets.all(24.0),
child: Column(
children: [
Icon(Icons.devices_other, size: 48, color: Theme.of(context).colorScheme.outline),
const SizedBox(height: 16),
Text(
t.companionRemote.pairing.noRecentConnections,
style: Theme.of(context).textTheme.titleMedium,
),
const SizedBox(height: 8),
Text(
t.companionRemote.pairing.connectUsingManual,
style: Theme.of(context).textTheme.bodySmall,
textAlign: TextAlign.center,
),
],
),
),
),
] else ...[
...sessions.map((session) {
final isThisConnecting = _isConnecting && _connectingSessionId == session.sessionId;
return Card(
margin: const EdgeInsets.only(bottom: 8),
child: ListTile(
leading: const Icon(Icons.computer, size: 40),
title: Text(session.deviceName),
subtitle: Text(
'${session.platform}\n'
'Session: ${session.sessionId}\n'
'Last used: ${_formatDate(session.lastConnected)}',
),
isThreeLine: true,
trailing: isThisConnecting
? const SizedBox(width: 24, height: 24, child: CircularProgressIndicator(strokeWidth: 2))
: const Icon(Icons.arrow_forward),
onTap: _isConnecting ? null : () => _connectToRecentSession(session),
onLongPress: () => _showRemoveSessionDialog(session),
),
);
}),
],
if (_errorMessage != null) ...[
const SizedBox(height: 16),
Card(
color: Theme.of(context).colorScheme.errorContainer,
child: Padding(
padding: const EdgeInsets.all(16.0),
child: Row(
children: [
Icon(Icons.error_outline, color: Theme.of(context).colorScheme.onErrorContainer),
const SizedBox(width: 12),
Expanded(
child: Text(
_errorMessage!,
style: TextStyle(color: Theme.of(context).colorScheme.onErrorContainer),
),
),
],
),
),
),
],
],
),
);
},
);
}
String _formatDate(DateTime date) {
return formatRelativeTime(date);
}
Future<void> _showRemoveSessionDialog(RecentRemoteSession session) async {
final confirmed = await showDialog<bool>(
context: context,
builder: (context) => AlertDialog(
title: Text(t.companionRemote.pairing.removeRecentConnection),
content: Text(t.companionRemote.pairing.removeConfirm(name: session.deviceName)),
actions: [
FocusableButton(
autofocus: true,
onPressed: () => Navigator.pop(context, false),
child: TextButton(
onPressed: () => Navigator.pop(context, false),
child: Text(t.common.cancel),
),
),
FocusableButton(
onPressed: () => Navigator.pop(context, true),
child: TextButton(onPressed: () => Navigator.pop(context, true), child: Text(t.common.remove)),
),
],
),
);
if (confirmed == true && mounted) {
await context.read<CompanionRemoteProvider>().removeRecentSession(session.sessionId);
}
}
Widget _buildManualEntryTab() {
return SingleChildScrollView(
padding: const EdgeInsets.all(24.0),
+2 -2
View File
@@ -524,7 +524,7 @@ class _LibrariesScreenState extends State<LibrariesScreen>
) async {
while (_hasMoreItems && requestId == _requestId) {
try {
final items = await client.getLibraryContent(
final result = await client.getLibraryContent(
library.key,
start: _currentPage * _pageSize,
size: _pageSize,
@@ -533,7 +533,7 @@ class _LibrariesScreenState extends State<LibrariesScreen>
);
// Tag items with server info for multi-server support
final taggedItems = items
final taggedItems = result.items
.map((item) => item.copyWith(serverId: library.serverId, serverName: library.serverName))
.toList();
@@ -76,7 +76,8 @@ abstract class BaseLibraryTabState<T, W extends BaseLibraryTab<T>> extends State
// Focus management
bool _hasLoadedData = false;
bool _hasFocused = false;
@protected
bool hasFocused = false;
// Getters for subclasses
List<T> get items => _items;
@@ -122,7 +123,7 @@ abstract class BaseLibraryTabState<T, W extends BaseLibraryTab<T>> extends State
// Reload if library changed
if (oldWidget.library.globalKey != widget.library.globalKey) {
// Reset focus state for new library
_hasFocused = false;
hasFocused = false;
_hasLoadedData = false;
// Immediately clear stale data before async load
_items = [];
@@ -164,8 +165,8 @@ abstract class BaseLibraryTabState<T, W extends BaseLibraryTab<T>> extends State
// Don't auto-focus if suppressed (e.g., when navigating via tab bar)
if (widget.suppressAutoFocus) return;
if (widget.isActive && _hasLoadedData && !_hasFocused && _items.isNotEmpty) {
_hasFocused = true;
if (widget.isActive && _hasLoadedData && !hasFocused && _items.isNotEmpty) {
hasFocused = true;
WidgetsBinding.instance.addPostFrameCallback((_) {
if (mounted) {
focusFirstItem();
+299 -115
View File
@@ -18,6 +18,7 @@ import '../../../widgets/alpha_jump_bar.dart';
import '../../../widgets/alpha_jump_helper.dart';
import '../../../widgets/alpha_scroll_handle.dart';
import '../../../widgets/focusable_media_card.dart';
import '../../../widgets/media_card.dart';
import '../../../widgets/focusable_filter_chip.dart';
import '../../../widgets/media_grid_delegate.dart';
import '../../../widgets/overlay_sheet.dart';
@@ -68,14 +69,14 @@ class _LibraryBrowseTabState extends BaseLibraryTabState<PlexMetadata, LibraryBr
String? get deletionServerId => widget.library.serverId;
@override
Set<String>? get deletionRatingKeys => items.map((e) => e.ratingKey).toSet();
Set<String>? get deletionRatingKeys => _loadedItems.values.map((e) => e.ratingKey).toSet();
@override
Set<String>? get deletionGlobalKeys {
if (items.isEmpty) return <String>{};
if (_loadedItems.isEmpty) return <String>{};
final keys = <String>{};
for (final item in items) {
for (final item in _loadedItems.values) {
final serverId = item.serverId ?? widget.library.serverId;
if (serverId == null) return null;
keys.add(_toGlobalKey(item.ratingKey, serverId: serverId));
@@ -85,30 +86,30 @@ class _LibraryBrowseTabState extends BaseLibraryTabState<PlexMetadata, LibraryBr
@override
void onDeletionEvent(DeletionEvent event) {
// If we have an item that matches the rating key exactly, then remove it from our list
final index = items.indexWhere((e) => e.ratingKey == event.ratingKey);
if (index != -1) {
// If we have an item that matches the rating key exactly, remove it and rebuild indices
final matchEntry = _loadedItems.entries.where((e) => e.value.ratingKey == event.ratingKey).firstOrNull;
if (matchEntry != null) {
setState(() {
items.removeAt(index);
_removeLoadedItemAndShift(matchEntry.key);
});
return;
}
// If a child item was delete, then update our list to reflect that.
// If a child item was deleted, update our item to reflect that.
// If all children were deleted, remove our item.
// Otherwise, just update the counts.
for (final parentKey in event.parentChain) {
final parentIndex = items.indexWhere((e) => e.ratingKey == parentKey);
if (parentIndex != -1) {
final item = items[parentIndex];
final parentEntry = _loadedItems.entries.where((e) => e.value.ratingKey == parentKey).firstOrNull;
if (parentEntry != null) {
final item = parentEntry.value;
final newLeafCount = (item.leafCount ?? 1) - event.leafCount;
if (newLeafCount <= 0) {
setState(() {
items.removeAt(parentIndex);
_removeLoadedItemAndShift(parentEntry.key);
});
} else {
setState(() {
items[parentIndex] = item.copyWith(leafCount: newLeafCount);
_loadedItems[parentEntry.key] = item.copyWith(leafCount: newLeafCount);
});
}
return;
@@ -116,18 +117,37 @@ class _LibraryBrowseTabState extends BaseLibraryTabState<PlexMetadata, LibraryBr
}
}
/// Remove an item at [index] and shift all higher indices down by 1
void _removeLoadedItemAndShift(int index) {
_loadedItems.remove(index);
// Rebuild map with shifted indices for items above the removed one
final shifted = <int, PlexMetadata>{};
for (final entry in _loadedItems.entries) {
if (entry.key < index) {
shifted[entry.key] = entry.value;
} else {
shifted[entry.key - 1] = entry.value;
}
}
_loadedItems.clear();
_loadedItems.addAll(shifted);
_totalSize = (_totalSize - 1).clamp(0, _totalSize);
}
@override
String get focusNodeDebugLabel => 'browse_first_item';
@override
int get itemCount => items.length;
int get itemCount => _totalSize;
@override
void updateItemInLists(String ratingKey, PlexMetadata updatedMetadata) {
setState(() {
final index = items.indexWhere((item) => item.ratingKey == ratingKey);
if (index != -1) {
items[index] = updatedMetadata;
for (final entry in _loadedItems.entries) {
if (entry.value.ratingKey == ratingKey) {
_loadedItems[entry.key] = updatedMetadata;
break;
}
}
});
}
@@ -162,11 +182,13 @@ class _LibraryBrowseTabState extends BaseLibraryTabState<PlexMetadata, LibraryBr
Timer? _scrollActivityTimer;
// Pagination state
int _currentPage = 0;
bool _hasMoreItems = true;
int _totalSize = 0;
final Map<int, PlexMetadata> _loadedItems = {};
final Set<int> _loadingRanges = {};
CancelToken? _cancelToken;
int _requestId = 0;
static const int _pageSize = 500;
static const int _fetchSize = 200;
Timer? _scrollIdleTimer;
// Focus nodes for filter chips
final FocusNode _groupingChipFocusNode = FocusNode(debugLabel: 'grouping_chip');
@@ -186,6 +208,7 @@ class _LibraryBrowseTabState extends BaseLibraryTabState<PlexMetadata, LibraryBr
void dispose() {
_cancelToken?.cancel();
_scrollActivityTimer?.cancel();
_scrollIdleTimer?.cancel();
_scrollController.removeListener(_onScrollChanged);
_scrollController.dispose();
_groupingChipFocusNode.dispose();
@@ -196,6 +219,18 @@ class _LibraryBrowseTabState extends BaseLibraryTabState<PlexMetadata, LibraryBr
super.dispose();
}
// Override tryFocus to use _loadedItems instead of base class items list
@override
void tryFocus() {
if (widget.suppressAutoFocus) return;
if (widget.isActive && hasLoadedData && !hasFocused && _loadedItems.isNotEmpty) {
hasFocused = true;
WidgetsBinding.instance.addPostFrameCallback((_) {
if (mounted) focusFirstItem();
});
}
}
// Override loadData to use our custom _loadContent
@override
Future<List<PlexMetadata>> loadData() async {
@@ -240,11 +275,11 @@ class _LibraryBrowseTabState extends BaseLibraryTabState<PlexMetadata, LibraryBr
return;
}
if (items.isNotEmpty) {
if (_loadedItems.isNotEmpty) {
// Request immediately, then once more on the next frame to handle cases
// where the grid/list attaches after the initial focus attempt.
void request() {
if (mounted && items.isNotEmpty && !firstItemFocusNode.hasFocus) {
if (mounted && _loadedItems.isNotEmpty && !firstItemFocusNode.hasFocus) {
firstItemFocusNode.requestFocus();
}
}
@@ -268,7 +303,8 @@ class _LibraryBrowseTabState extends BaseLibraryTabState<PlexMetadata, LibraryBr
// Cancel any pending request
_cancelToken?.cancel();
_cancelToken = CancelToken();
final currentRequestId = ++_requestId;
// Use a generation counter for the filter/sort loading phase
final generation = ++_requestId;
// Extract context dependencies before async gap - use server-specific client
final client = getClientForLibrary();
@@ -277,8 +313,9 @@ class _LibraryBrowseTabState extends BaseLibraryTabState<PlexMetadata, LibraryBr
isLoading = true;
errorMessage = null;
items = [];
_currentPage = 0;
_hasMoreItems = true;
_totalSize = 0;
_loadedItems.clear();
_loadingRanges.clear();
// Clear filter/sort state while loading to prevent showing stale options
_filters = [];
_sortOptions = [];
@@ -303,8 +340,8 @@ class _LibraryBrowseTabState extends BaseLibraryTabState<PlexMetadata, LibraryBr
final savedSort = storage.getLibrarySort(widget.library.globalKey);
final savedGrouping = storage.getLibraryGrouping(widget.library.globalKey);
// Check if request was cancelled
if (currentRequestId != _requestId) return;
// Check if request was superseded
if (generation != _requestId) return;
if (!mounted) return;
setState(() {
@@ -327,62 +364,64 @@ class _LibraryBrowseTabState extends BaseLibraryTabState<PlexMetadata, LibraryBr
});
// Load items and first characters in parallel
// _loadItems manages its own requestId internally
await Future.wait([_loadItems(), _loadFirstCharacters()]);
} catch (e) {
_handleLoadError(e, currentRequestId);
if (!mounted) return;
setState(() {
errorMessage = _getErrorMessage(e);
isLoading = false;
});
}
}
Future<void> _loadItems({bool loadMore = false}) async {
if (loadMore && isLoading) return;
/// Build the filter params map for API calls
Map<String, String> _buildFilterParams() {
final filterParams = Map<String, String>.from(_selectedFilters);
if (!loadMore) {
_currentPage = 0;
_hasMoreItems = true;
// Add grouping type filter (but not for 'all' or 'folders')
if (_selectedGrouping != 'all' && _selectedGrouping != 'folders') {
final typeId = _getGroupingTypeId();
if (typeId.isNotEmpty) {
filterParams['type'] = typeId;
}
}
if (!_hasMoreItems) return;
// Add sort
if (_selectedSort != null) {
filterParams['sort'] = _selectedSort!.getSortKey(descending: _isSortDescending);
}
final currentRequestId = _requestId;
return filterParams;
}
Future<void> _loadItems() async {
final currentRequestId = ++_requestId;
_cancelToken?.cancel();
_cancelToken = CancelToken();
setState(() {
isLoading = true;
if (!loadMore) {
items = [];
// Increment content version when loading fresh content
// This invalidates the last focused index
gridContentVersion++;
cleanupGridFocusNodes(items.length);
}
items = [];
_totalSize = 0;
_loadedItems.clear();
_loadingRanges.clear();
// Increment content version when loading fresh content
// This invalidates the last focused index
gridContentVersion++;
cleanupGridFocusNodes(0);
});
try {
// Use server-specific client for this library
final client = getClientForLibrary();
// Build filter params
final filterParams = Map<String, String>.from(_selectedFilters);
// Add grouping type filter (but not for 'all' or 'folders')
if (_selectedGrouping != 'all' && _selectedGrouping != 'folders') {
final typeId = _getGroupingTypeId();
if (typeId.isNotEmpty) {
filterParams['type'] = typeId;
}
}
// Add sort
if (_selectedSort != null) {
filterParams['sort'] = _selectedSort!.getSortKey(descending: _isSortDescending);
}
final filterParams = _buildFilterParams();
// Items are automatically tagged with server info by PlexClient
final loadedItems = await client.getLibraryContent(
final result = await client.getLibraryContent(
widget.library.key,
start: _currentPage * _pageSize,
size: _pageSize,
start: 0,
size: _fetchSize,
filters: filterParams,
cancelToken: _cancelToken,
);
@@ -391,33 +430,81 @@ class _LibraryBrowseTabState extends BaseLibraryTabState<PlexMetadata, LibraryBr
if (!mounted) return;
setState(() {
if (loadMore) {
items.addAll(loadedItems);
} else {
items = loadedItems;
_totalSize = result.totalSize;
for (var i = 0; i < result.items.length; i++) {
_loadedItems[i] = result.items[i];
}
_hasMoreItems = loadedItems.length >= _pageSize;
_currentPage++;
isLoading = false;
});
// On initial load (not pagination), mark data as loaded and try to focus
if (!loadMore) {
hasLoadedData = true;
tryFocus();
hasLoadedData = true;
tryFocus();
// Notify parent
if (widget.onDataLoaded != null) {
WidgetsBinding.instance.addPostFrameCallback((_) {
widget.onDataLoaded!();
});
}
// Notify parent
if (widget.onDataLoaded != null) {
WidgetsBinding.instance.addPostFrameCallback((_) {
widget.onDataLoaded!();
});
}
} catch (e) {
_handleLoadError(e, currentRequestId);
}
}
/// Fetch a range of items from the API and store them in the sparse map.
/// After a successful fetch, re-checks for remaining gaps in the visible range.
Future<void> _fetchRange(int start, int size) async {
// Clamp to totalSize
if (start >= _totalSize) return;
final clampedSize = size.clamp(0, _totalSize - start);
if (clampedSize == 0) return;
// Deduplicate: track every index in-flight to prevent overlapping fetches
final indices = List.generate(clampedSize, (i) => start + i);
if (indices.every((i) => _loadingRanges.contains(i) || _loadedItems.containsKey(i))) return;
_loadingRanges.addAll(indices);
final currentRequestId = _requestId;
try {
final client = getClientForLibrary();
final filterParams = _buildFilterParams();
final result = await client.getLibraryContent(
widget.library.key,
start: start,
size: clampedSize,
filters: filterParams,
cancelToken: _cancelToken,
);
if (currentRequestId != _requestId || !mounted) return;
setState(() {
for (var i = 0; i < result.items.length; i++) {
_loadedItems[start + i] = result.items[i];
}
// Update totalSize in case it changed (e.g., items added/removed on server)
if (result.totalSize != _totalSize) {
_totalSize = result.totalSize;
}
});
// Re-check for remaining gaps in the visible range after this fetch
WidgetsBinding.instance.addPostFrameCallback((_) {
if (mounted && currentRequestId == _requestId) {
_loadVisibleRange();
}
});
} catch (e) {
// Silently ignore fetch errors for background range loads
// (the initial load handles errors with UI feedback)
if (e is DioException && e.type == DioExceptionType.cancel) return;
} finally {
_loadingRanges.removeAll(indices);
}
}
void _handleLoadError(dynamic error, int currentRequestId) {
if (currentRequestId != _requestId) return;
@@ -617,9 +704,9 @@ class _LibraryBrowseTabState extends BaseLibraryTabState<PlexMetadata, LibraryBr
return;
}
if (items.isEmpty) return;
if (_totalSize == 0) return;
final targetIndex = shouldRestoreGridFocus && lastFocusedGridIndex! < items.length ? lastFocusedGridIndex! : 0;
final targetIndex = shouldRestoreGridFocus && lastFocusedGridIndex! < _totalSize && _loadedItems.containsKey(lastFocusedGridIndex!) ? lastFocusedGridIndex! : 0;
// Use firstItemFocusNode for index 0 (matches _buildMediaCardItem)
if (targetIndex == 0) {
@@ -634,10 +721,33 @@ class _LibraryBrowseTabState extends BaseLibraryTabState<PlexMetadata, LibraryBr
/// FocusNode detached), so we target the last-column item in the first
/// visible row — the grid cell closest to the alpha bar.
void _navigateToGridNearScroll() {
if (items.isEmpty || _currentColumnCount < 1) return;
if (_totalSize == 0 || _currentColumnCount < 1) return;
final row = _currentFirstVisibleIndex ~/ _currentColumnCount;
final targetIndex = ((row + 1) * _currentColumnCount - 1).clamp(0, items.length - 1);
var targetIndex = ((row + 1) * _currentColumnCount - 1).clamp(0, _totalSize - 1);
// Find nearest loaded item — skeleton cards have no FocusNode
if (!_loadedItems.containsKey(targetIndex)) {
// Search backwards first (items above are more likely visible)
int? found;
for (var i = targetIndex - 1; i >= 0; i--) {
if (_loadedItems.containsKey(i)) {
found = i;
break;
}
}
// Then search forwards
if (found == null) {
for (var i = targetIndex + 1; i < _totalSize; i++) {
if (_loadedItems.containsKey(i)) {
found = i;
break;
}
}
}
if (found == null) return;
targetIndex = found;
}
if (targetIndex == 0) {
firstItemFocusNode.requestFocus();
@@ -710,11 +820,17 @@ class _LibraryBrowseTabState extends BaseLibraryTabState<PlexMetadata, LibraryBr
}
}
/// Track scroll position to highlight the current letter in the jump bar
/// Track scroll position and trigger debounced range loading.
void _onScrollChanged() {
// Debounced scroll-idle handler: load visible range when scrolling settles
_scrollIdleTimer?.cancel();
_scrollIdleTimer = Timer(const Duration(milliseconds: 200), () {
if (mounted) _loadVisibleRange();
});
if (!_shouldShowAlphaJumpBar || _currentColumnCount < 1) return;
// During a jump animation, skip all processing to avoid flashing.
// During a jump animation, skip alpha bar processing to avoid flashing.
if (_isJumpScrolling) return;
// If pinned from a completed jump, the next scroll event must be
@@ -733,7 +849,8 @@ class _LibraryBrowseTabState extends BaseLibraryTabState<PlexMetadata, LibraryBr
final firstInRow = _itemIndexFromScrollOffset(offset);
// Use the last item in the first visible row so the highlighted letter
// updates as soon as items with a new letter appear in that row.
final lastInRow = (firstInRow + _currentColumnCount - 1).clamp(0, items.length - 1);
final maxIndex = _totalSize > 0 ? _totalSize - 1 : 0;
final lastInRow = (firstInRow + _currentColumnCount - 1).clamp(0, maxIndex);
if (lastInRow != _currentFirstVisibleIndex) {
setState(() => _currentFirstVisibleIndex = lastInRow);
}
@@ -754,7 +871,8 @@ class _LibraryBrowseTabState extends BaseLibraryTabState<PlexMetadata, LibraryBr
// First visible row = (offset + chipsBarHeight - effectiveTopPadding) / rowHeight
final contentOffset = (offset + _chipsBarHeight - _effectiveTopPadding).clamp(0.0, double.infinity);
final row = (contentOffset / rowHeight).floor();
return (row * _currentColumnCount).clamp(0, items.length - 1);
final maxIndex = _totalSize > 0 ? _totalSize - 1 : 0;
return (row * _currentColumnCount).clamp(0, maxIndex);
}
/// Scroll to the item at [targetIndex], loading more pages if necessary.
@@ -766,13 +884,10 @@ class _LibraryBrowseTabState extends BaseLibraryTabState<PlexMetadata, LibraryBr
_isJumpScrolling = true;
_hasJumpPin = true;
setState(() => _currentFirstVisibleIndex = targetIndex);
final clamped = targetIndex.clamp(0, _totalSize > 0 ? _totalSize - 1 : 0);
setState(() => _currentFirstVisibleIndex = clamped);
if (targetIndex < items.length) {
_scrollToItemIndex(targetIndex);
} else {
_loadUntilIndex(targetIndex);
}
_scrollToItemIndex(clamped);
}
/// Scroll the grid so that [index] is visible just below the chips bar
@@ -809,16 +924,6 @@ class _LibraryBrowseTabState extends BaseLibraryTabState<PlexMetadata, LibraryBr
});
}
/// Load pages until [targetIndex] is loaded, then scroll to it
Future<void> _loadUntilIndex(int targetIndex) async {
while (items.length <= targetIndex && _hasMoreItems) {
await _loadItems(loadMore: true);
}
if (mounted) {
_scrollToItemIndex(targetIndex.clamp(0, items.length - 1));
}
}
@override
Widget build(BuildContext context) {
super.build(context); // Required for AutomaticKeepAliveClientMixin
@@ -876,13 +981,10 @@ class _LibraryBrowseTabState extends BaseLibraryTabState<PlexMetadata, LibraryBr
);
}
/// Builds the scrollable content (grid/list) with pagination support
/// Builds the scrollable content (grid/list) with scroll-idle loading
Widget _buildScrollableContent() {
return NotificationListener<ScrollNotification>(
onNotification: (notification) {
if (notification.metrics.pixels >= notification.metrics.maxScrollExtent - 300 && _hasMoreItems && !isLoading) {
_loadItems(loadMore: true);
}
// Track scroll activity for phone scroll handle
if (notification is ScrollStartNotification) {
if (!_isScrollActive) setState(() => _isScrollActive = true);
@@ -904,6 +1006,48 @@ class _LibraryBrowseTabState extends BaseLibraryTabState<PlexMetadata, LibraryBr
);
}
/// Determine the visible range and fetch any unloaded items within it.
/// Covers the full visible area plus a buffer of _fetchSize/2 on each side,
/// then finds the first unloaded contiguous block and fetches it.
void _loadVisibleRange() {
if (_totalSize == 0 || _currentColumnCount < 1 || !_scrollController.hasClients) return;
if (_lastCrossAxisExtent <= 0) return;
final offset = _scrollController.offset;
final viewportHeight = _scrollController.position.viewportDimension;
final firstIndex = _itemIndexFromScrollOffset(offset);
// Calculate how many items fit in the viewport
final itemWidth = _lastCrossAxisExtent / _currentColumnCount;
final itemHeight = itemWidth / GridLayoutConstants.posterAspectRatio;
final rowHeight = itemHeight + GridLayoutConstants.mainAxisSpacing;
if (rowHeight <= 0) return;
final visibleRows = (viewportHeight / rowHeight).ceil() + 1;
final visibleCount = visibleRows * _currentColumnCount;
// Expand the visible range by a buffer on each side
final buffer = _fetchSize ~/ 2;
final rangeStart = (firstIndex - buffer).clamp(0, _totalSize);
final rangeEnd = (firstIndex + visibleCount + buffer).clamp(0, _totalSize);
// Find the first and last unloaded indices in the range
int? fetchStart;
int? fetchEnd;
for (var i = rangeStart; i < rangeEnd; i++) {
if (!_loadedItems.containsKey(i) && !_loadingRanges.contains(i)) {
fetchStart ??= i;
fetchEnd = i + 1;
}
}
if (fetchStart == null || fetchEnd == null) return;
final fetchSize = fetchEnd - fetchStart;
if (fetchSize <= 0) return;
_fetchRange(fetchStart, fetchSize);
}
/// Whether the filters chip is visible
bool get _isFiltersChipVisible => _filters.isNotEmpty && _selectedGrouping != 'folders';
@@ -976,11 +1120,11 @@ class _LibraryBrowseTabState extends BaseLibraryTabState<PlexMetadata, LibraryBr
/// Builds content as slivers for the CustomScrollView
List<Widget> _buildContentSlivers() {
if (isLoading && items.isEmpty) {
if (isLoading && _totalSize == 0 && _loadedItems.isEmpty) {
return [const SliverFillRemaining(child: Center(child: CircularProgressIndicator()))];
}
if (errorMessage != null && items.isEmpty) {
if (errorMessage != null && _loadedItems.isEmpty) {
return [
SliverFillRemaining(
child: ErrorStateWidget(
@@ -993,7 +1137,7 @@ class _LibraryBrowseTabState extends BaseLibraryTabState<PlexMetadata, LibraryBr
];
}
if (items.isEmpty) {
if (_totalSize == 0 && !isLoading) {
return [
SliverFillRemaining(
child: EmptyStateWidget(message: t.libraries.thisLibraryIsEmpty, icon: Symbols.folder_open_rounded),
@@ -1021,7 +1165,7 @@ class _LibraryBrowseTabState extends BaseLibraryTabState<PlexMetadata, LibraryBr
/// Builds either a sliver list or sliver grid based on the view mode
Widget _buildItemsSliver(BuildContext context, SettingsProvider settingsProvider) {
final itemCount = items.length + (_hasMoreItems && isLoading ? 1 : 0);
final itemCount = _totalSize;
final isPhone = _isPhone(context);
final topPadding = isPhone ? _gridTopPaddingPhone : _gridTopPadding;
_effectiveTopPadding = topPadding;
@@ -1080,13 +1224,12 @@ class _LibraryBrowseTabState extends BaseLibraryTabState<PlexMetadata, LibraryBr
required bool isFirstColumn,
bool isLastColumn = false,
}) {
if (index >= items.length) {
return const Padding(
padding: EdgeInsets.all(16.0),
child: Center(child: CircularProgressIndicator()),
);
final item = _loadedItems[index];
// Show skeleton placeholder for unloaded items
if (item == null) {
return const _SkeletonCard();
}
final item = items[index];
// Use firstItemFocusNode for index 0 to maintain compatibility with base class
// All other items get managed focus nodes for restoration
@@ -1106,3 +1249,44 @@ class _LibraryBrowseTabState extends BaseLibraryTabState<PlexMetadata, LibraryBr
);
}
}
/// Skeleton placeholder card that matches the poster + title layout of a real media card.
/// Not focusable — dpad focus skips over these.
class _SkeletonCard extends StatelessWidget {
const _SkeletonCard();
@override
Widget build(BuildContext context) {
return Padding(
padding: const EdgeInsets.all(8),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
// Poster area — matches the Expanded poster in _buildGridCard
Expanded(
child: ClipRRect(
borderRadius: BorderRadius.circular(8),
child: const SkeletonLoader(child: SizedBox.expand()),
),
),
const SizedBox(height: 4),
// Title bar
SkeletonLoader(
borderRadius: BorderRadius.circular(4),
child: const SizedBox(height: 13, width: double.infinity),
),
const SizedBox(height: 3),
// Subtitle bar
FractionallySizedBox(
alignment: Alignment.centerLeft,
widthFactor: 0.6,
child: SkeletonLoader(
borderRadius: BorderRadius.circular(4),
child: const SizedBox(height: 11),
),
),
],
),
);
}
}
+7
View File
@@ -433,6 +433,13 @@ class VideoPlayerScreenState extends State<VideoPlayerScreen> with WidgetsBindin
await player!.setProperty('audio-exclusive', 'yes');
}
// Audio passthrough (desktop only - sends bitstream to receiver)
if (Platform.isWindows || Platform.isMacOS || Platform.isLinux) {
if (settingsService.getAudioPassthrough()) {
await player!.setAudioPassthrough(true);
}
}
// HDR is controlled via custom hdr-enabled property on iOS/macOS/Windows
if (Platform.isIOS || Platform.isMacOS || Platform.isWindows) {
final enableHDR = settingsService.getEnableHDR();
@@ -1,95 +0,0 @@
import 'dart:async';
import 'dart:convert';
import '../../models/companion_remote/recent_remote_session.dart';
import '../../services/storage_service.dart';
import '../../utils/app_logger.dart';
/// Service for managing recent Companion Remote sessions
class CompanionRemoteDiscoveryService {
static const String _storageKey = 'companion_remote_recent_sessions';
static const int _maxRecentSessions = 5;
final _recentSessions = <RecentRemoteSession>[];
final _recentSessionsController = StreamController<List<RecentRemoteSession>>.broadcast();
/// Stream of recent sessions
Stream<List<RecentRemoteSession>> get recentSessions => _recentSessionsController.stream;
/// Get current list of recent sessions
List<RecentRemoteSession> get currentSessions => List.unmodifiable(_recentSessions);
CompanionRemoteDiscoveryService() {
_loadRecentSessions();
}
/// Load recent sessions from storage
Future<void> _loadRecentSessions() async {
try {
final storage = await StorageService.getInstance();
final json = storage.prefs.getString(_storageKey);
if (json != null) {
final List<dynamic> list = jsonDecode(json);
_recentSessions.clear();
_recentSessions.addAll(list.map((e) => RecentRemoteSession.fromJson(e as Map<String, dynamic>)));
// Sort by last connected (most recent first)
_recentSessions.sort((a, b) => b.lastConnected.compareTo(a.lastConnected));
_recentSessionsController.add(currentSessions);
appLogger.d('Loaded ${_recentSessions.length} recent remote sessions');
}
} catch (e) {
appLogger.e('Failed to load recent sessions', error: e);
}
}
/// Save recent sessions to storage
Future<void> _saveRecentSessions() async {
try {
final storage = await StorageService.getInstance();
final json = jsonEncode(_recentSessions.map((e) => e.toJson()).toList());
await storage.prefs.setString(_storageKey, json);
appLogger.d('Saved ${_recentSessions.length} recent remote sessions');
} catch (e) {
appLogger.e('Failed to save recent sessions', error: e);
}
}
/// Add a session to recent list
Future<void> addRecentSession(RecentRemoteSession session) async {
// Remove existing entry for this session ID
_recentSessions.removeWhere((s) => s.sessionId == session.sessionId);
// Add new entry at the beginning
_recentSessions.insert(0, session);
// Limit to max sessions
if (_recentSessions.length > _maxRecentSessions) {
_recentSessions.removeRange(_maxRecentSessions, _recentSessions.length);
}
await _saveRecentSessions();
_recentSessionsController.add(currentSessions);
}
/// Remove a session from recent list
Future<void> removeRecentSession(String sessionId) async {
_recentSessions.removeWhere((s) => s.sessionId == sessionId);
await _saveRecentSessions();
_recentSessionsController.add(currentSessions);
}
/// Clear all recent sessions
Future<void> clearRecentSessions() async {
_recentSessions.clear();
await _saveRecentSessions();
_recentSessionsController.add(currentSessions);
}
/// Dispose resources
Future<void> dispose() async {
await _recentSessionsController.close();
}
}
+107 -2
View File
@@ -84,8 +84,13 @@ class DataAggregationService {
return [];
}
// For global hubs, fetch libraries to split "Recently Added" hubs by library
final libraries = useGlobalHubs
? (librariesByServer ?? groupLibrariesByServer(await getLibrariesFromAllServers()))
: librariesByServer;
return useGlobalHubs
? _fetchGlobalHubs(clients, limit: limit, hiddenLibraryKeys: hiddenLibraryKeys)
? _fetchGlobalHubs(clients, limit: limit, hiddenLibraryKeys: hiddenLibraryKeys, librariesByServer: libraries)
: _fetchLibraryHubs(
clients,
limit: limit,
@@ -99,6 +104,7 @@ class DataAggregationService {
Map<String, PlexClient> clients, {
int? limit,
Set<String>? hiddenLibraryKeys,
Map<String, List<PlexLibrary>>? librariesByServer,
}) async {
appLogger.d('Fetching global hubs from ${clients.length} servers');
@@ -150,7 +156,9 @@ class DataAggregationService {
});
final results = await Future.wait(hubFutures);
final result = _collectAndLimitResults(results, limit);
// Split "Recently Added" hubs that combine items from multiple libraries
final splitResults = results.map((hubs) => _splitRecentlyAddedHubs(hubs, librariesByServer)).toList();
final result = _collectAndLimitResults(splitResults, limit);
appLogger.i('Fetched ${result.length} global hubs from all servers');
@@ -300,6 +308,103 @@ class DataAggregationService {
return limit != null && limit < all.length ? all.sublist(0, limit) : all;
}
/// Split "Recently Added" hubs that contain items from multiple libraries
/// into separate per-library hubs, matching the official Plex client behavior.
List<PlexHub> _splitRecentlyAddedHubs(
List<PlexHub> hubs,
Map<String, List<PlexLibrary>>? librariesByServer,
) {
final result = <PlexHub>[];
for (final hub in hubs) {
final hubId = hub.hubIdentifier?.toLowerCase() ?? '';
if (!hubId.contains('.recent')) {
result.add(hub);
continue;
}
// Group items by librarySectionID
final groups = <int, List<PlexMetadata>>{};
final ungrouped = <PlexMetadata>[];
for (final item in hub.items) {
final sectionId = item.librarySectionID;
if (sectionId == null) {
ungrouped.add(item);
} else {
groups.putIfAbsent(sectionId, () => []).add(item);
}
}
// Single library (or no groupable items) — keep hub unchanged
if (groups.length <= 1) {
result.add(hub);
continue;
}
// Multiple libraries — create one hub per library
for (final entry in groups.entries) {
final items = entry.value;
final libraryName = _resolveLibraryName(items.first, librariesByServer);
final title = libraryName != null ? 'Recently Added in $libraryName' : hub.title;
result.add(PlexHub(
hubKey: hub.hubKey,
title: title,
type: hub.type,
hubIdentifier: '${hub.hubIdentifier}_${entry.key}',
size: items.length,
more: hub.more,
items: items,
serverId: hub.serverId,
serverName: hub.serverName,
));
}
// Keep ungrouped items in a hub with the original title
if (ungrouped.isNotEmpty) {
result.add(PlexHub(
hubKey: hub.hubKey,
title: hub.title,
type: hub.type,
hubIdentifier: hub.hubIdentifier,
size: ungrouped.length,
more: hub.more,
items: ungrouped,
serverId: hub.serverId,
serverName: hub.serverName,
));
}
}
return result;
}
/// Resolve library name from item metadata or library lookup map.
String? _resolveLibraryName(
PlexMetadata item,
Map<String, List<PlexLibrary>>? librariesByServer,
) {
// Try librarySectionTitle from the item itself (Plex API often includes it)
if (item.librarySectionTitle != null && item.librarySectionTitle!.isNotEmpty) {
return item.librarySectionTitle;
}
// Fall back to library lookup
if (librariesByServer != null && item.serverId != null && item.librarySectionID != null) {
final serverLibraries = librariesByServer[item.serverId];
if (serverLibraries != null) {
for (final lib in serverLibraries) {
if (lib.key == item.librarySectionID.toString()) {
return lib.title;
}
}
}
}
return null;
}
/// Base helper for per-server fan-out operations
///
/// Returns raw results as (serverId, result) tuples.
+33 -7
View File
@@ -451,9 +451,15 @@ class DownloadManagerService {
status: DownloadStatus.queued.index,
);
// Pin the already-cached API response for offline use
// (getMetadataWithImages was already called by download_provider, which cached with chapters/markers)
await _apiCache.pinForOffline(metadata.serverId!, metadata.ratingKey);
// Ensure metadata is in cache before pinning.
// Normally getMetadataWithImages already cached the full API response (with chapters/markers),
// but if the network failed during the provider's fetch, the cache entry may not exist.
final cached = await _apiCache.get(metadata.serverId!, '/library/metadata/${metadata.ratingKey}');
if (cached == null) {
await _cacheMetadataForOffline(metadata.serverId!, metadata.ratingKey, metadata);
} else {
await _apiCache.pinForOffline(metadata.serverId!, metadata.ratingKey);
}
// Add to queue
await _database.addToQueue(
@@ -501,11 +507,31 @@ class DownloadManagerService {
final serverId = parsed.serverId;
final ratingKey = parsed.ratingKey;
final metadata = await _apiCache.getMetadata(serverId, ratingKey);
if (metadata == null) throw Exception('Metadata not found in cache for $globalKey');
var metadata = await _apiCache.getMetadata(serverId, ratingKey);
if (metadata == null) {
// Cache miss — try re-fetching from server (cache may have been cleared between queue and prepare)
appLogger.w('Cache miss for $globalKey, attempting network re-fetch');
try {
final fetched = await client.getMetadataWithImages(ratingKey);
if (fetched != null) metadata = fetched.copyWith(serverId: serverId);
} catch (e) {
appLogger.w('Network re-fetch failed for $globalKey', error: e);
}
if (metadata == null) {
throw Exception('Metadata not found in cache and could not be fetched for $globalKey');
}
}
final playbackData = await client.getVideoPlaybackData(metadata.ratingKey);
if (playbackData.videoUrl == null) throw Exception('Could not get video URL');
var playbackData = await client.getVideoPlaybackData(metadata.ratingKey);
if (playbackData.videoUrl == null) {
// Cache may contain a synthetic entry (from _cacheMetadataForOffline) without
// Media/Part data. Force a fresh network fetch to populate the cache properly.
appLogger.w('No video URL from cache for $globalKey, retrying via network');
final fetched = await client.getMetadataWithImages(ratingKey);
if (fetched != null) metadata = fetched.copyWith(serverId: serverId);
playbackData = await client.getVideoPlaybackData(metadata.ratingKey);
if (playbackData.videoUrl == null) throw Exception('Could not get video URL for $globalKey');
}
final ext = _getExtensionFromUrl(playbackData.videoUrl!) ?? 'mp4';
+5 -1
View File
@@ -222,7 +222,11 @@ class DownloadStorageService {
String _sanitizeFileName(String name) {
// Remove invalid filesystem characters: < > : " / \ | ? *
// Also remove leading/trailing whitespace and dots
return name.replaceAll(RegExp(r'[<>:"/\\|?*]'), '').replaceAll(RegExp(r'^\.+|\.+$'), '').trim();
return name
.replaceAll(RegExp(r'[<>:"/\\|?*]'), '')
.replaceAll(RegExp(r'^\.+|\.+$'), '')
.replaceAll('.', '_')
.trim();
}
/// Ensure a directory exists, creating it if necessary
+29
View File
@@ -0,0 +1,29 @@
import 'dart:io';
import 'package:flutter_cache_manager/flutter_cache_manager.dart';
import 'package:http/io_client.dart';
/// Custom cache manager for Plex image transcoding with connection limiting.
///
/// Limits concurrent HTTP connections to 6 per host (matching browser HTTP/1.1
/// behavior) to prevent overwhelming the Plex server's transcode pipeline when
/// many posters are visible simultaneously.
class PlexImageCacheManager extends CacheManager with ImageCacheManager {
static const _key = 'plexImageCache';
static final PlexImageCacheManager instance = PlexImageCacheManager._();
PlexImageCacheManager._()
: super(
Config(
_key,
stalePeriod: const Duration(days: 30),
maxNrOfCacheObjects: 5000,
fileService: HttpFileService(
httpClient: IOClient(
HttpClient()..maxConnectionsPerHost = 6,
),
),
),
);
}
+7 -8
View File
@@ -288,7 +288,9 @@ class MultiServerManager {
}
}
/// Test connection health for all servers
/// Test connection health for all servers.
/// Uses [PlexClient.isHealthy] which checks for HTTP 200, so servers with
/// invalid tokens (401) are correctly reported as offline.
Future<void> checkServerHealth() async {
appLogger.d('Checking health for ${_clients.length} servers');
@@ -296,13 +298,10 @@ class MultiServerManager {
final serverId = entry.key;
final client = entry.value;
try {
// Simple ping by fetching server identity
await client.getServerIdentity();
updateServerStatus(serverId, true);
} catch (e) {
appLogger.w('Server $serverId health check failed: $e');
updateServerStatus(serverId, false);
final healthy = await client.isHealthy();
updateServerStatus(serverId, healthy);
if (!healthy) {
appLogger.w('Server $serverId health check failed');
}
});
+25 -3
View File
@@ -32,6 +32,13 @@ import '../utils/plex_url_helper.dart';
import '../utils/watch_state_notifier.dart';
import 'plex_api_cache.dart';
/// Result of a paginated library content fetch
class LibraryContentResult {
final List<PlexMetadata> items;
final int totalSize;
const LibraryContentResult({required this.items, required this.totalSize});
}
/// Process hub JSON response in an isolate.
/// Top-level function so it can be passed to [Isolate.run].
List<PlexHub> _processHubResponse(String jsonStr, String serverId, String? serverName) {
@@ -226,7 +233,7 @@ class PlexClient {
final response = await dio.get('/', options: Options(headers: {'X-Plex-Token': token}));
stopwatch.stop();
final success = response.statusCode == 200 || response.statusCode == 401;
final success = response.statusCode == 200;
return ConnectionTestResult(
success: success,
@@ -364,6 +371,17 @@ class PlexClient {
return response.data;
}
/// Check if the server connection is healthy (reachable AND authenticated).
/// Returns true only if the server responds with HTTP 200.
Future<bool> isHealthy() async {
try {
final response = await _dio.get('/identity');
return response.statusCode == 200;
} catch (e) {
return false;
}
}
/// Get library sections
/// Returns libraries automatically tagged with this client's serverId and serverName
Future<List<PlexLibrary>> getLibraries() async {
@@ -372,7 +390,7 @@ class PlexClient {
}
/// Get library content by section ID
Future<List<PlexMetadata>> getLibraryContent(
Future<LibraryContentResult> getLibraryContent(
String sectionId, {
int? start,
int? size,
@@ -394,7 +412,11 @@ class PlexClient {
cancelToken: cancelToken,
);
return _extractMetadataList(response);
final items = _extractMetadataList(response);
final container = _getMediaContainer(response);
final totalSize = container?['totalSize'] as int? ?? container?['size'] as int? ?? items.length;
return LibraryContentResult(items: items, totalSize: totalSize);
}
/// Parse list of PlexMetadata from a cached response
+20 -6
View File
@@ -1,9 +1,13 @@
import 'dart:convert';
import 'package:dio/dio.dart';
import '../utils/app_logger.dart';
import 'plex_auth_service.dart';
import 'storage_service.dart';
enum ServerRefreshResult { success, networkError, authError, noToken }
/// Centralized server configuration registry
/// Manages which servers are available and their configurations
class ServerRegistry {
@@ -95,13 +99,15 @@ class ServerRegistry {
appLogger.i('Cleared all servers from registry');
}
/// Refresh servers from Plex API and update storage
/// This updates connection info (IPs, ports) that may have changed
Future<void> refreshServersFromApi() async {
/// Refresh servers from Plex API and update storage.
/// This updates connection info (IPs, ports) that may have changed.
/// Returns [ServerRefreshResult.authError] when the stored token is rejected
/// (e.g. after removing a Plex profile PIN), so the caller can redirect to re-auth.
Future<ServerRefreshResult> refreshServersFromApi() async {
final token = _storage.getPlexToken();
if (token == null || token.isEmpty) {
appLogger.d('No Plex token available, skipping server refresh');
return;
return ServerRefreshResult.noToken;
}
try {
@@ -111,7 +117,7 @@ class ServerRegistry {
if (freshServers.isEmpty) {
appLogger.w('API returned no servers, keeping existing data');
return;
return ServerRefreshResult.success;
}
// Get existing servers to preserve any local-only data
@@ -133,9 +139,17 @@ class ServerRegistry {
await saveServers(updatedServers);
appLogger.i('Refreshed ${updatedServers.length} servers from API');
return ServerRefreshResult.success;
} on DioException catch (e) {
if (e.response?.statusCode == 401) {
appLogger.w('Plex token is invalid (401), re-authentication required');
return ServerRefreshResult.authError;
}
appLogger.w('Failed to refresh servers from API, using cached data', error: e);
return ServerRefreshResult.networkError;
} catch (e, stackTrace) {
appLogger.w('Failed to refresh servers from API, using cached data', error: e, stackTrace: stackTrace);
// Don't rethrow - we can continue with cached servers
return ServerRefreshResult.networkError;
}
}
}
+11
View File
@@ -77,6 +77,7 @@ class SettingsService extends BaseSharedPreferencesService {
static const String _keyCustomExternalPlayers = 'custom_external_players';
static const String _keyConfirmExitOnBack = 'confirm_exit_on_back';
static const String _keyAmbientLighting = 'ambient_lighting';
static const String _keyAudioPassthrough = 'audio_passthrough';
SettingsService._();
@@ -1129,6 +1130,15 @@ class SettingsService extends BaseSharedPreferencesService {
return prefs.getBool(_keyAmbientLighting) ?? false;
}
// Audio Passthrough
Future<void> setAudioPassthrough(bool enabled) async {
await prefs.setBool(_keyAudioPassthrough, enabled);
}
bool getAudioPassthrough() {
return prefs.getBool(_keyAudioPassthrough) ?? false;
}
// Reset all settings to defaults
Future<void> resetAllSettings() async {
await Future.wait([
@@ -1184,6 +1194,7 @@ class SettingsService extends BaseSharedPreferencesService {
prefs.remove(_keyCustomExternalPlayers),
prefs.remove(_keyConfirmExitOnBack),
prefs.remove(_keyAmbientLighting),
prefs.remove(_keyAudioPassthrough),
prefs.remove(_keyBufferSizeMigratedToAuto),
]);
}
-37
View File
@@ -185,43 +185,6 @@ String formatFinishTime(Duration remaining, {double rate = 1.0}) {
return formatter.format(finishTime);
}
/// Formats a DateTime as a relative time string (e.g., "just now", "5m", "3h", "2d", or a full date).
/// Uses the `duration` package for localized unit names.
///
/// Used for: recent connections timestamps.
String formatRelativeTime(DateTime date) {
final now = DateTime.now();
final difference = now.difference(date);
if (difference.inMinutes < 1) {
return prettyDuration(
Duration.zero,
abbreviated: true,
locale: _getDurationLocale(),
tersity: DurationTersity.minute,
upperTersity: DurationTersity.minute,
);
} else if (difference.inDays < 7) {
return prettyDuration(
difference,
abbreviated: true,
locale: _getDurationLocale(),
delimiter: ' ',
spacer: '',
tersity: DurationTersity.minute,
upperTersity: () {
if (difference.inDays >= 1) return DurationTersity.day;
if (difference.inHours >= 1) return DurationTersity.hour;
return DurationTersity.minute;
}(),
maxUnits: 1,
);
} else {
final formatter = DateFormat.yMd(LocaleSettings.currentLocale.languageCode);
return formatter.format(date);
}
}
/// Takes a list of strings and returns one long string with each item in the list concatenated by a bullet
String toBulletedString(List<String> parts) {
return parts.join(' · ');
+1 -1
View File
@@ -828,7 +828,7 @@ class _SkeletonLoaderState extends State<SkeletonLoader> with SingleTickerProvid
identifier: "skeleton-loader",
child: Container(
decoration: BoxDecoration(
color: Theme.of(context).colorScheme.surfaceContainerHighest.withValues(alpha: _animation.value),
color: Theme.of(context).colorScheme.onSurface.withValues(alpha: _animation.value * 0.15),
borderRadius: widget.borderRadius ?? BorderRadius.circular(tokens(context).radiusSm),
),
child: widget.child,
+39 -11
View File
@@ -48,14 +48,18 @@ class OverlaySheetController {
/// Whether a sheet is currently showing (including while animating closed).
bool get isOpen => _state._isOpen;
/// Show a bottom sheet with [builder] content. Returns a Future that completes
/// Show a sheet with [builder] content. Returns a Future that completes
/// when the sheet is closed (with an optional result).
///
/// [alignment] controls where the sheet appears. Defaults to
/// [Alignment.bottomCenter]. Use [Alignment.topCenter] to anchor at the top.
Future<T?> show<T>({
required WidgetBuilder builder,
BoxConstraints? constraints,
Color? backgroundColor,
bool barrierDismissible = true,
FocusNode? initialFocusNode,
Alignment alignment = Alignment.bottomCenter,
}) {
return _state._show<T>(
builder: builder,
@@ -63,6 +67,7 @@ class OverlaySheetController {
backgroundColor: backgroundColor,
barrierDismissible: barrierDismissible,
initialFocusNode: initialFocusNode,
alignment: alignment,
);
}
@@ -98,6 +103,7 @@ class OverlaySheetController {
bool barrierDismissible = true,
bool isScrollControlled = false,
FocusNode? initialFocusNode,
Alignment alignment = Alignment.bottomCenter,
}) {
final controller = maybeOf(context);
if (controller != null) {
@@ -107,6 +113,7 @@ class OverlaySheetController {
backgroundColor: backgroundColor,
barrierDismissible: barrierDismissible,
initialFocusNode: initialFocusNode,
alignment: alignment,
);
}
return showModalBottomSheet<T>(
@@ -176,7 +183,7 @@ class OverlaySheetHost extends StatefulWidget {
class _OverlaySheetHostState extends State<OverlaySheetHost> with SingleTickerProviderStateMixin {
late final AnimationController _animationController;
late final Animation<Offset> _slideAnimation;
late final CurvedAnimation _slideCurve;
late final Animation<double> _barrierAnimation;
late final OverlaySheetController _controller;
@@ -188,6 +195,7 @@ class _OverlaySheetHostState extends State<OverlaySheetHost> with SingleTickerPr
bool _barrierDismissible = true;
BoxConstraints? _constraints;
Color? _explicitBackgroundColor;
Alignment _alignment = Alignment.bottomCenter;
// Drag-to-dismiss state
double _dragOffset = 0;
@@ -200,8 +208,10 @@ class _OverlaySheetHostState extends State<OverlaySheetHost> with SingleTickerPr
_animationController = AnimationController(duration: const Duration(milliseconds: 250), vsync: this);
_slideAnimation = Tween<Offset>(begin: const Offset(0, 1), end: Offset.zero).animate(
CurvedAnimation(parent: _animationController, curve: Curves.easeOutCubic, reverseCurve: Curves.easeInCubic),
_slideCurve = CurvedAnimation(
parent: _animationController,
curve: Curves.easeOutCubic,
reverseCurve: Curves.easeInCubic,
);
_barrierAnimation = Tween<double>(
@@ -218,6 +228,7 @@ class _OverlaySheetHostState extends State<OverlaySheetHost> with SingleTickerPr
}
}
_sheetFocusScopeNode.dispose();
_slideCurve.dispose();
_animationController.dispose();
super.dispose();
}
@@ -228,6 +239,7 @@ class _OverlaySheetHostState extends State<OverlaySheetHost> with SingleTickerPr
Color? backgroundColor,
bool barrierDismissible = true,
FocusNode? initialFocusNode,
Alignment alignment = Alignment.bottomCenter,
}) {
// If already open, close first (instant)
if (_isOpen) {
@@ -250,6 +262,7 @@ class _OverlaySheetHostState extends State<OverlaySheetHost> with SingleTickerPr
_barrierDismissible = barrierDismissible;
_constraints = constraints;
_explicitBackgroundColor = backgroundColor;
_alignment = alignment;
_dragOffset = 0;
_isDragging = false;
});
@@ -448,29 +461,44 @@ class _OverlaySheetHostState extends State<OverlaySheetHost> with SingleTickerPr
Widget _buildSheet(BuildContext context) {
final size = MediaQuery.of(context).size;
final isDesktop = size.width > 600;
final isTop = _alignment.y < 0;
final effectiveConstraints =
_constraints ??
BoxConstraints(maxWidth: isDesktop ? 700 : double.infinity, maxHeight: isDesktop ? 400 : size.height * 0.75);
// Slide direction depends on alignment: bottom sheets slide up, top sheets slide down.
final slideBegin = isTop ? const Offset(0, -1) : const Offset(0, 1);
final borderRadius = isTop
? const BorderRadius.vertical(bottom: Radius.circular(16))
: const BorderRadius.vertical(top: Radius.circular(16));
Widget sheet = FocusScope(
node: _sheetFocusScopeNode,
child: Focus(
canRequestFocus: false,
skipTraversal: true,
onKeyEvent: _handleKeyEvent,
child: SlideTransition(
position: _slideAnimation,
child: AnimatedBuilder(
animation: _slideCurve,
builder: (context, child) {
final slideOffset = Offset.lerp(slideBegin, Offset.zero, _slideCurve.value)!;
return FractionalTranslation(
translation: slideOffset,
child: child,
);
},
child: Align(
alignment: Alignment.bottomCenter,
alignment: _alignment,
child: Transform.translate(
offset: Offset(0, _dragOffset.clamp(0, double.infinity)),
child: Material(
color: _explicitBackgroundColor ?? Theme.of(context).colorScheme.surface,
borderRadius: const BorderRadius.vertical(top: Radius.circular(16)),
borderRadius: borderRadius,
clipBehavior: Clip.antiAlias,
child: SafeArea(
top: false,
top: !isTop,
bottom: isTop,
child: ConstrainedBox(
constraints: effectiveConstraints,
child: _pageStack.isNotEmpty ? _pageStack.last.builder(context) : const SizedBox.shrink(),
@@ -483,8 +511,8 @@ class _OverlaySheetHostState extends State<OverlaySheetHost> with SingleTickerPr
),
);
// Swipe-down-to-dismiss (skip on TV where there's no touchscreen)
if (!PlatformDetector.isTV()) {
// Swipe-down-to-dismiss (skip on TV and for top-aligned sheets)
if (!PlatformDetector.isTV() && !isTop) {
sheet = GestureDetector(
onVerticalDragStart: (_) {
_isDragging = true;
+2
View File
@@ -4,6 +4,7 @@ import 'package:flutter/material.dart';
import 'package:plezy/widgets/app_icon.dart';
import 'package:material_symbols_icons/symbols.dart';
import 'package:cached_network_image/cached_network_image.dart';
import '../services/image_cache_service.dart';
import '../../services/plex_client.dart';
import '../utils/plex_image_helper.dart';
import 'media_card.dart';
@@ -338,6 +339,7 @@ class PlexOptimizedImage extends StatelessWidget {
image: CachedNetworkImageProvider(
imageUrl,
cacheKey: effectiveCacheKey,
cacheManager: PlexImageCacheManager.instance,
headers: const {'User-Agent': 'Plezy'},
maxHeight: memHeight,
),
@@ -68,6 +68,7 @@ class DesktopVideoControls extends StatefulWidget {
final VoidCallback? onLoadSeekTimes;
final VoidCallback? onCancelAutoHide;
final VoidCallback? onStartAutoHide;
final void Function(String propertyName, int offset)? onSyncOffsetChanged;
final String serverId;
final VoidCallback? onBack;
@@ -138,6 +139,7 @@ class DesktopVideoControls extends StatefulWidget {
this.onLoadSeekTimes,
this.onCancelAutoHide,
this.onStartAutoHide,
this.onSyncOffsetChanged,
this.serverId = '',
this.onBack,
this.canControl = true,
@@ -689,6 +691,7 @@ class DesktopVideoControlsState extends State<DesktopVideoControls> {
onLoadSeekTimes: widget.onLoadSeekTimes,
onCancelAutoHide: widget.onCancelAutoHide,
onStartAutoHide: widget.onStartAutoHide,
onSyncOffsetChanged: widget.onSyncOffsetChanged,
focusNodes: _trackControlFocusNodes,
onFocusChange: _onFocusChange,
onNavigateLeft: navigateFromTrackToVolume,
@@ -12,6 +12,7 @@ import '../../../providers/shader_provider.dart';
import '../../../services/settings_service.dart';
import '../../../services/shader_service.dart';
import '../../../services/sleep_timer_service.dart';
import '../../../focus/focusable_wrapper.dart';
import '../../../utils/formatters.dart';
import '../../../utils/platform_detector.dart';
import '../../../theme/mono_tokens.dart';
@@ -91,6 +92,15 @@ class VideoSettingsSheet extends StatefulWidget {
/// Called to toggle ambient lighting on/off (null if unsupported)
final VoidCallback? onToggleAmbientLighting;
/// Called to cancel the video controls auto-hide timer.
final VoidCallback? onCancelAutoHide;
/// Called to restart the video controls auto-hide timer.
final VoidCallback? onStartAutoHide;
/// Called when a sync offset changes (so the parent can update its state).
final void Function(String propertyName, int offset)? onSyncOffsetChanged;
const VideoSettingsSheet({
super.key,
required this.player,
@@ -102,6 +112,9 @@ class VideoSettingsSheet extends StatefulWidget {
this.onShaderChanged,
this.isAmbientLightingEnabled = false,
this.onToggleAmbientLighting,
this.onCancelAutoHide,
this.onStartAutoHide,
this.onSyncOffsetChanged,
});
@override
@@ -115,6 +128,7 @@ class _VideoSettingsSheetState extends State<VideoSettingsSheet> {
bool _enableHDR = true;
bool _showPerformanceOverlay = false;
bool _autoPlayNextEpisode = true;
bool _audioPassthrough = false;
@override
void initState() {
@@ -131,6 +145,7 @@ class _VideoSettingsSheetState extends State<VideoSettingsSheet> {
_enableHDR = settings.getEnableHDR();
_showPerformanceOverlay = settings.getShowPerformanceOverlay();
_autoPlayNextEpisode = settings.getAutoPlayNextEpisode();
_audioPassthrough = settings.getAudioPassthrough();
});
}
@@ -166,13 +181,77 @@ class _VideoSettingsSheetState extends State<VideoSettingsSheet> {
});
}
Future<void> _toggleAudioPassthrough() async {
final newValue = !_audioPassthrough;
final settings = await SettingsService.getInstance();
await settings.setAudioPassthrough(newValue);
if (!mounted) return;
setState(() {
_audioPassthrough = newValue;
});
await widget.player.setAudioPassthrough(newValue);
}
void _navigateTo(_SettingsView view) {
// Sync views open as a compact top bar instead of a sub-view
if (view == _SettingsView.audioSync || view == _SettingsView.subtitleSync) {
_openSyncBar(view);
return;
}
setState(() {
_currentView = view;
});
OverlaySheetController.maybeOf(context)?.refocus();
}
void _openSyncBar(_SettingsView view) {
final controller = OverlaySheetController.maybeOf(context);
if (controller == null) return;
final isSubtitle = view == _SettingsView.subtitleSync;
final title = isSubtitle ? t.videoSettings.subtitleSync : t.videoSettings.audioSync;
final icon = isSubtitle ? Symbols.subtitles_rounded : Symbols.sync_rounded;
final propertyName = isSubtitle ? 'sub-delay' : 'audio-delay';
final initialOffset = isSubtitle ? _subtitleSyncOffset : _audioSyncOffset;
// Created here so we can pass it as initialFocusNode to the overlay sheet,
// ensuring the slider gets focus when the bar opens. Disposed by _CompactSyncBar.
final sliderFocusNode = FocusNode(debugLabel: 'SyncSlider');
// show() with new alignment replaces the current sheet (completing the
// settings sheet future, which restarts the auto-hide timer via
// whenComplete in track_chapter_controls). Cancel it again here.
controller.show(
alignment: Alignment.topCenter,
constraints: const BoxConstraints(maxHeight: 80, maxWidth: 900),
initialFocusNode: sliderFocusNode,
builder: (_) => _CompactSyncBar(
title: title,
icon: icon,
player: widget.player,
propertyName: propertyName,
initialOffset: initialOffset,
sliderFocusNode: sliderFocusNode,
onOffsetChanged: (offset) async {
final settings = await SettingsService.getInstance();
if (isSubtitle) {
await settings.setSubtitleSyncOffset(offset);
} else {
await settings.setAudioSyncOffset(offset);
}
widget.onSyncOffsetChanged?.call(propertyName, offset);
},
),
).whenComplete(() {
widget.onStartAutoHide?.call();
});
// Cancel auto-hide after show() — the previous sheet's whenComplete
// fires as a microtask and restarts the timer, so schedule our cancel
// to run after that microtask.
Future.microtask(() => widget.onCancelAutoHide?.call());
}
void _navigateBack() {
setState(() {
_currentView = _SettingsView.menu;
@@ -331,6 +410,23 @@ class _VideoSettingsSheetState extends State<VideoSettingsSheet> {
},
),
// Audio Passthrough (Desktop only)
if (isDesktop)
ListTile(
leading: AppIcon(
Symbols.surround_sound_rounded,
fill: 1,
color: _audioPassthrough ? Colors.amber : tokens(context).textMuted,
),
title: Text(t.videoSettings.audioPassthrough),
trailing: Switch(
value: _audioPassthrough,
onChanged: (_) => _toggleAudioPassthrough(),
activeThumbColor: Colors.amber,
),
onTap: _toggleAudioPassthrough,
),
// Shader Preset (MPV only)
if (widget.shaderService != null && widget.shaderService!.isSupported)
_SettingsMenuItem(
@@ -423,39 +519,7 @@ class _VideoSettingsSheetState extends State<VideoSettingsSheet> {
return SleepTimerContent(player: widget.player, sleepTimer: sleepTimer, onCancel: () => OverlaySheetController.of(context).close());
}
Widget _buildAudioSyncView() {
return SyncOffsetControl(
player: widget.player,
propertyName: 'audio-delay',
initialOffset: _audioSyncOffset,
labelText: t.videoControls.audioLabel,
onOffsetChanged: (offset) async {
final settings = await SettingsService.getInstance();
await settings.setAudioSyncOffset(offset);
if (!mounted) return;
setState(() {
_audioSyncOffset = offset;
});
},
);
}
Widget _buildSubtitleSyncView() {
return SyncOffsetControl(
player: widget.player,
propertyName: 'sub-delay',
initialOffset: _subtitleSyncOffset,
labelText: t.videoControls.subtitlesLabel,
onOffsetChanged: (offset) async {
final settings = await SettingsService.getInstance();
await settings.setSubtitleSyncOffset(offset);
if (!mounted) return;
setState(() {
_subtitleSyncOffset = offset;
});
},
);
}
// Audio/subtitle sync views are now opened as compact top bars via _openSyncBar()
/// Extract the audio backend name from a device name (e.g. "coreaudio" from "coreaudio/BuiltIn").
static String _audioBackend(String name) {
@@ -638,9 +702,8 @@ class _VideoSettingsSheetState extends State<VideoSettingsSheet> {
case _SettingsView.sleep:
return _buildSleepView();
case _SettingsView.audioSync:
return _buildAudioSyncView();
case _SettingsView.subtitleSync:
return _buildSubtitleSyncView();
return _buildMenuView(); // Sync views open as top bars, fallback to menu
case _SettingsView.audioDevice:
return _buildAudioDeviceView();
case _SettingsView.shader:
@@ -650,3 +713,84 @@ class _VideoSettingsSheetState extends State<VideoSettingsSheet> {
);
}
}
/// Compact sync bar shown at the top of the screen so subtitles remain visible.
class _CompactSyncBar extends StatefulWidget {
final String title;
final IconData icon;
final Player player;
final String propertyName;
final int initialOffset;
final Future<void> Function(int offset) onOffsetChanged;
final FocusNode sliderFocusNode;
const _CompactSyncBar({
required this.title,
required this.icon,
required this.player,
required this.propertyName,
required this.initialOffset,
required this.onOffsetChanged,
required this.sliderFocusNode,
});
@override
State<_CompactSyncBar> createState() => _CompactSyncBarState();
}
class _CompactSyncBarState extends State<_CompactSyncBar> {
final _resetFocusNode = FocusNode(debugLabel: 'SyncResetButton');
final _closeFocusNode = FocusNode(debugLabel: 'SyncCloseButton');
@override
void dispose() {
widget.sliderFocusNode.dispose();
_resetFocusNode.dispose();
_closeFocusNode.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
return Row(
children: [
const SizedBox(width: 16),
AppIcon(widget.icon, fill: 1, color: tokens(context).textMuted, size: 20),
const SizedBox(width: 8),
Text(widget.title, style: const TextStyle(fontWeight: FontWeight.w600, fontSize: 14)),
Expanded(
child: SyncOffsetControl(
player: widget.player,
propertyName: widget.propertyName,
initialOffset: widget.initialOffset,
labelText: widget.title,
onOffsetChanged: widget.onOffsetChanged,
compact: true,
sliderFocusNode: widget.sliderFocusNode,
resetFocusNode: _resetFocusNode,
closeFocusNode: _closeFocusNode,
),
),
const SizedBox(width: 8),
FocusableWrapper(
focusNode: _closeFocusNode,
onSelect: () => OverlaySheetController.of(context).close(),
onNavigateLeft: () => _resetFocusNode.requestFocus(),
borderRadius: 18,
autoScroll: false,
useBackgroundFocus: true,
child: GestureDetector(
onTap: () => OverlaySheetController.of(context).close(),
child: Container(
width: 36,
height: 36,
alignment: Alignment.center,
child: AppIcon(Symbols.close_rounded, fill: 1, color: tokens(context).textMuted, size: 22),
),
),
),
const SizedBox(width: 12),
],
);
}
}
+33 -8
View File
@@ -406,6 +406,9 @@ class _PlexVideoControlsState extends State<PlexVideoControls> with WindowListen
void _skipMarker() {
if (_currentMarker != null) {
final endTime = _currentMarker!.endTime;
setState(() {
_currentMarker = null;
});
widget.player.seek(endTime);
widget.onSeekCompleted?.call(endTime);
}
@@ -654,16 +657,20 @@ class _PlexVideoControlsState extends State<PlexVideoControls> with WindowListen
if (Platform.isMacOS) {
_updateTrafficLightVisibility();
}
// Immediately try to reclaim focus (important for TV where global handler
// won't fire if _focusNode lost focus)
if (!_focusNode.hasFocus) {
_focusNode.requestFocus();
}
WidgetsBinding.instance.addPostFrameCallback((_) {
if (mounted && !_focusNode.hasFocus) {
// Reclaim focus so the global key handler stays active for TV dpad,
// but skip if an overlay sheet owns focus — stealing it would break
// sheet navigation (e.g. the compact sync bar).
final sheetOpen = OverlaySheetController.maybeOf(context)?.isOpen ?? false;
if (!sheetOpen) {
if (!_focusNode.hasFocus) {
_focusNode.requestFocus();
}
});
WidgetsBinding.instance.addPostFrameCallback((_) {
if (mounted && !_focusNode.hasFocus) {
_focusNode.requestFocus();
}
});
}
}
void _startHideTimer() {
@@ -919,6 +926,15 @@ class _PlexVideoControlsState extends State<PlexVideoControls> with WindowListen
},
onCancelAutoHide: () => _hideTimer?.cancel(),
onStartAutoHide: _startHideTimer,
onSyncOffsetChanged: (propertyName, offset) {
setState(() {
if (propertyName == 'sub-delay') {
_subtitleSyncOffset = offset;
} else {
_audioSyncOffset = offset;
}
});
},
serverId: widget.metadata.serverId ?? '',
canControl: widget.canControl,
isLive: widget.isLive,
@@ -1944,6 +1960,15 @@ class _PlexVideoControlsState extends State<PlexVideoControls> with WindowListen
},
onCancelAutoHide: () => _hideTimer?.cancel(),
onStartAutoHide: _startHideTimer,
onSyncOffsetChanged: (propertyName, offset) {
setState(() {
if (propertyName == 'sub-delay') {
_subtitleSyncOffset = offset;
} else {
_audioSyncOffset = offset;
}
});
},
serverId: widget.metadata.serverId ?? '',
onBack: widget.onBack,
canControl: widget.canControl,
@@ -1,9 +1,12 @@
import 'dart:async';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:plezy/widgets/app_icon.dart';
import 'package:material_symbols_icons/symbols.dart';
import '../../../focus/dpad_navigator.dart';
import '../../../focus/focusable_wrapper.dart';
import '../../../mpv/mpv.dart';
import '../../../i18n/strings.g.dart';
import '../../../theme/mono_tokens.dart';
@@ -17,6 +20,21 @@ class SyncOffsetControl extends StatefulWidget {
final String labelText; // 'Audio' or 'Subtitles'
final Future<void> Function(int offset) onOffsetChanged;
/// When true, renders as a compact single-row layout for use in a top bar.
final bool compact;
/// Focus node for the reset button (compact mode). When provided from the
/// parent, allows the close button's left-press to focus the reset button.
final FocusNode? resetFocusNode;
/// Focus node for the close button (compact mode). When provided, pressing
/// select/enter on the slider moves focus here.
final FocusNode? closeFocusNode;
/// Focus node for the slider (compact mode). When provided, allows the
/// parent to auto-focus the slider when the bar opens.
final FocusNode? sliderFocusNode;
const SyncOffsetControl({
super.key,
required this.player,
@@ -24,6 +42,10 @@ class SyncOffsetControl extends StatefulWidget {
required this.initialOffset,
required this.labelText,
required this.onOffsetChanged,
this.compact = false,
this.resetFocusNode,
this.closeFocusNode,
this.sliderFocusNode,
});
@override
@@ -138,6 +160,8 @@ class _SyncOffsetControlState extends State<SyncOffsetControl> {
required IconData icon,
required VoidCallback onTap,
required VoidCallback onLongPressStart,
double size = 48,
double iconSize = 28,
}) {
return GestureDetector(
onTap: onTap,
@@ -145,16 +169,128 @@ class _SyncOffsetControlState extends State<SyncOffsetControl> {
onLongPressEnd: (_) => _stopLongPress(),
onLongPressCancel: _stopLongPress,
child: Container(
width: 48,
height: 48,
width: size,
height: size,
decoration: BoxDecoration(color: Theme.of(context).colorScheme.surfaceContainerHighest, borderRadius: const BorderRadius.all(Radius.circular(8))),
child: Icon(icon, color: tokens(context).text, size: 28),
child: Icon(icon, color: tokens(context).text, size: iconSize),
),
);
}
@override
Widget build(BuildContext context) {
return widget.compact ? _buildCompact(context) : _buildFull(context);
}
Widget _buildCompactStepButton({
required IconData icon,
required VoidCallback onTap,
required VoidCallback onLongPressStart,
}) {
return FocusableWrapper(
onSelect: onTap,
borderRadius: 18,
autoScroll: false,
useBackgroundFocus: true,
child: GestureDetector(
onTap: onTap,
onLongPressStart: (_) => onLongPressStart(),
onLongPressEnd: (_) => _stopLongPress(),
onLongPressCancel: _stopLongPress,
child: Container(
width: 36,
height: 36,
decoration: BoxDecoration(color: Theme.of(context).colorScheme.surfaceContainerHighest, borderRadius: const BorderRadius.all(Radius.circular(8))),
child: Icon(icon, color: tokens(context).text, size: 22),
),
),
);
}
Widget _buildCompact(BuildContext context) {
final sliderValue = _currentOffset.clamp(_sliderMin, _sliderMax);
return Padding(
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8),
child: Row(
children: [
_buildCompactStepButton(
icon: Symbols.remove_rounded,
onTap: _decrementOffset,
onLongPressStart: _startLongPressDecrement,
),
Expanded(
child: Focus(
onKeyEvent: (node, event) {
// Select/enter on the slider jumps focus to the close button
if (event.logicalKey.isSelectKey && event is KeyDownEvent) {
widget.closeFocusNode?.requestFocus();
return KeyEventResult.handled;
}
return KeyEventResult.ignored;
},
canRequestFocus: false,
child: Slider(
focusNode: widget.sliderFocusNode,
value: sliderValue,
min: _sliderMin,
max: _sliderMax,
divisions: _sliderDivisions,
activeColor: Colors.blue,
inactiveColor: Theme.of(context).colorScheme.outlineVariant,
onChanged: (value) {
setState(() {
_currentOffset = value;
});
},
onChangeEnd: (value) {
_applyOffset(value);
},
),
),
),
_buildCompactStepButton(
icon: Symbols.add_rounded,
onTap: _incrementOffset,
onLongPressStart: _startLongPressIncrement,
),
const SizedBox(width: 12),
SizedBox(
width: 80,
child: Text(
formatSyncOffset(_currentOffset),
style: const TextStyle(fontSize: 16, fontWeight: FontWeight.bold),
textAlign: TextAlign.center,
),
),
const SizedBox(width: 8),
FocusableWrapper(
focusNode: widget.resetFocusNode,
onSelect: _currentOffset != 0 ? _resetOffset : null,
borderRadius: 18,
autoScroll: false,
useBackgroundFocus: true,
child: GestureDetector(
onTap: _currentOffset != 0 ? _resetOffset : null,
child: Container(
width: 36,
height: 36,
alignment: Alignment.center,
child: AppIcon(
Symbols.restart_alt_rounded,
fill: 1,
color: _currentOffset != 0 ? tokens(context).text : tokens(context).textMuted,
size: 22,
),
),
),
),
],
),
);
}
Widget _buildFull(BuildContext context) {
// Clamp the slider value to its range, but display the actual offset
final sliderValue = _currentOffset.clamp(_sliderMin, _sliderMax);
@@ -47,6 +47,7 @@ class TrackChapterControls extends StatelessWidget {
final VoidCallback? onLoadSeekTimes;
final VoidCallback? onCancelAutoHide;
final VoidCallback? onStartAutoHide;
final void Function(String propertyName, int offset)? onSyncOffsetChanged;
final String serverId;
final ShaderService? shaderService;
final VoidCallback? onShaderChanged;
@@ -103,6 +104,7 @@ class TrackChapterControls extends StatelessWidget {
this.onLoadSeekTimes,
this.onCancelAutoHide,
this.onStartAutoHide,
this.onSyncOffsetChanged,
this.focusNodes,
this.onFocusChange,
this.onNavigateLeft,
@@ -221,6 +223,9 @@ class TrackChapterControls extends StatelessWidget {
onShaderChanged: onShaderChanged,
isAmbientLightingEnabled: isAmbientLightingEnabled,
onToggleAmbientLighting: onToggleAmbientLighting,
onCancelAutoHide: onCancelAutoHide,
onStartAutoHide: onStartAutoHide,
onSyncOffsetChanged: onSyncOffsetChanged,
),
).whenComplete(() {
onStartAutoHide?.call();
+2
View File
@@ -10,5 +10,7 @@
<true/>
<key>com.apple.security.network.client</key>
<true/>
<key>com.apple.security.files.user-selected.read-write</key>
<true/>
</dict>
</plist>
+2
View File
@@ -6,5 +6,7 @@
<false/>
<key>com.apple.security.network.client</key>
<true/>
<key>com.apple.security.files.user-selected.read-write</key>
<true/>
</dict>
</plist>
+8 -8
View File
@@ -215,10 +215,10 @@ packages:
dependency: transitive
description:
name: characters
sha256: f71061c654a3380576a52b451dd5532377954cf9dbd272a78fc8479606670803
sha256: faf38497bda5ead2a8c7615f4f7939df04333478bf32e4173fcb06d428b5716b
url: "https://pub.dev"
source: hosted
version: "1.4.0"
version: "1.4.1"
charcode:
dependency: transitive
description:
@@ -699,18 +699,18 @@ packages:
dependency: transitive
description:
name: matcher
sha256: dc58c723c3c24bf8d3e2d3ad3f2f9d7bd9cf43ec6feaa64181775e60190153f2
sha256: "12956d0ad8390bbcc63ca2e1469c0619946ccb52809807067a7020d57e647aa6"
url: "https://pub.dev"
source: hosted
version: "0.12.17"
version: "0.12.18"
material_color_utilities:
dependency: transitive
description:
name: material_color_utilities
sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec
sha256: "9c337007e82b1889149c82ed242ed1cb24a66044e30979c44912381e9be4c48b"
url: "https://pub.dev"
source: hosted
version: "0.11.1"
version: "0.13.0"
material_symbols_icons:
dependency: "direct main"
description:
@@ -1281,10 +1281,10 @@ packages:
dependency: transitive
description:
name: test_api
sha256: ab2726c1a94d3176a45960b6234466ec367179b87dd74f1611adb1f3b5fb9d55
sha256: "93167629bfc610f71560ab9312acdda4959de4df6fac7492c89ff0d3886f6636"
url: "https://pub.dev"
source: hosted
version: "0.7.7"
version: "0.7.9"
timing:
dependency: transitive
description:
+1 -1
View File
@@ -1,7 +1,7 @@
name: plezy
description: "A beautiful Plex client for Flutter"
publish_to: "none"
version: 1.21.2+47
version: 1.21.3+48
environment:
sdk: ^3.8.1