Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9efdd5a17d | ||
|
|
dd11e8d3b2 | ||
|
|
cde6e99a17 | ||
|
|
045e68ca10 | ||
|
|
4f736c555b | ||
|
|
642c49b1ea | ||
|
|
e13b16f13c | ||
|
|
1f9fa9ba4f | ||
|
|
849ef6efe5 | ||
|
|
e968a20f4c | ||
|
|
7a6b866c28 | ||
|
|
6ccbaed3fd | ||
|
|
d01628a262 | ||
|
|
675ac84486 | ||
|
|
e84dc93910 | ||
|
|
3d30ea1342 | ||
|
|
efd28d3ca3 | ||
|
|
8a28a2c398 | ||
|
|
c6fa6afa9b | ||
|
|
912ebc2f90 | ||
|
|
f04b49e260 | ||
|
|
a17458ff9b | ||
|
|
c062dd944e | ||
|
|
1a4516bdd1 | ||
|
|
5538e0627b | ||
|
|
7febfa9771 | ||
|
|
160be52f02 | ||
|
|
828d57af24 | ||
|
|
1f7fb2201c | ||
|
|
32ae51142f | ||
|
|
7014df7a0e | ||
|
|
cb0ed15c0c | ||
|
|
d4e9364d29 | ||
|
|
4681d60850 | ||
|
|
78052dc07f | ||
|
|
67c66ff0c1 | ||
|
|
d1bb99635a | ||
|
|
69092e3656 | ||
|
|
98138a4f35 | ||
|
|
25c7f325b6 | ||
|
|
5dbaf961b7 | ||
|
|
b4471fab49 | ||
|
|
307fd354d6 | ||
|
|
a3b5557185 | ||
|
|
3c491be690 | ||
|
|
580c1d82e5 | ||
|
|
4cc83006ec | ||
|
|
4954c9c569 | ||
|
|
8f1b40d143 |
@@ -5,6 +5,7 @@ on:
|
||||
|
||||
env:
|
||||
SENTRY_DART_DEFINE: ${{ github.repository == 'edde746/plezy' && '--dart-define=ENABLE_SENTRY=true' || '' }}
|
||||
GIT_COMMIT_DART_DEFINE: --dart-define=GIT_COMMIT=${{ github.sha }}
|
||||
|
||||
jobs:
|
||||
build-android:
|
||||
@@ -61,7 +62,7 @@ jobs:
|
||||
EOF
|
||||
|
||||
- name: Build APKs
|
||||
run: flutter build apk --release --split-per-abi --dart-define=ENABLE_UPDATE_CHECK=true ${{ env.SENTRY_DART_DEFINE }}
|
||||
run: flutter build apk --release --split-per-abi --dart-define=ENABLE_UPDATE_CHECK=true ${{ env.SENTRY_DART_DEFINE }} ${{ env.GIT_COMMIT_DART_DEFINE }}
|
||||
|
||||
- name: Clean up keystore
|
||||
if: always()
|
||||
@@ -129,7 +130,7 @@ jobs:
|
||||
run: flutter pub get
|
||||
|
||||
- name: Build iOS (no codesign)
|
||||
run: flutter build ios --release --no-codesign --dart-define=ENABLE_UPDATE_CHECK=true ${{ env.SENTRY_DART_DEFINE }}
|
||||
run: flutter build ios --release --no-codesign --dart-define=ENABLE_UPDATE_CHECK=true ${{ env.SENTRY_DART_DEFINE }} ${{ env.GIT_COMMIT_DART_DEFINE }}
|
||||
|
||||
- name: Create IPA
|
||||
run: |
|
||||
@@ -187,7 +188,7 @@ jobs:
|
||||
run: flutter pub get
|
||||
|
||||
- name: Build macOS
|
||||
run: flutter build macos --release --dart-define=ENABLE_UPDATE_CHECK=true ${{ env.SENTRY_DART_DEFINE }}
|
||||
run: flutter build macos --release --dart-define=ENABLE_UPDATE_CHECK=true ${{ env.SENTRY_DART_DEFINE }} ${{ env.GIT_COMMIT_DART_DEFINE }}
|
||||
|
||||
- name: Import Code Signing Certificate
|
||||
env:
|
||||
@@ -338,7 +339,7 @@ jobs:
|
||||
run: flutter pub get
|
||||
|
||||
- name: Build Windows x64
|
||||
run: flutter build windows --release --dart-define=ENABLE_UPDATE_CHECK=true ${{ env.SENTRY_DART_DEFINE }}
|
||||
run: flutter build windows --release --dart-define=ENABLE_UPDATE_CHECK=true ${{ env.SENTRY_DART_DEFINE }} ${{ env.GIT_COMMIT_DART_DEFINE }}
|
||||
|
||||
- name: Upload x64 build
|
||||
uses: actions/upload-artifact@v4
|
||||
@@ -375,7 +376,7 @@ jobs:
|
||||
run: flutter pub get
|
||||
|
||||
- name: Build Windows arm64
|
||||
run: flutter build windows --release --dart-define=ENABLE_UPDATE_CHECK=true ${{ env.SENTRY_DART_DEFINE }}
|
||||
run: flutter build windows --release --dart-define=ENABLE_UPDATE_CHECK=true ${{ env.SENTRY_DART_DEFINE }} ${{ env.GIT_COMMIT_DART_DEFINE }}
|
||||
|
||||
- name: Upload arm64 build
|
||||
uses: actions/upload-artifact@v4
|
||||
@@ -519,7 +520,7 @@ jobs:
|
||||
run: flutter pub get
|
||||
|
||||
- name: Build Linux x64
|
||||
run: flutter build linux --release --dart-define=ENABLE_UPDATE_CHECK=true ${{ env.SENTRY_DART_DEFINE }}
|
||||
run: flutter build linux --release --dart-define=ENABLE_UPDATE_CHECK=true ${{ env.SENTRY_DART_DEFINE }} ${{ env.GIT_COMMIT_DART_DEFINE }}
|
||||
env:
|
||||
PKG_CONFIG_PATH: ${{ github.workspace }}/libmpv-prefix/lib/pkgconfig:${{ github.workspace }}/libmpv-prefix/lib/x86_64-linux-gnu/pkgconfig
|
||||
|
||||
@@ -627,7 +628,7 @@ jobs:
|
||||
run: flutter pub get
|
||||
|
||||
- name: Build Linux arm64
|
||||
run: flutter build linux --release --dart-define=ENABLE_UPDATE_CHECK=true ${{ env.SENTRY_DART_DEFINE }}
|
||||
run: flutter build linux --release --dart-define=ENABLE_UPDATE_CHECK=true ${{ env.SENTRY_DART_DEFINE }} ${{ env.GIT_COMMIT_DART_DEFINE }}
|
||||
env:
|
||||
PKG_CONFIG_PATH: ${{ github.workspace }}/libmpv-prefix/lib/pkgconfig:${{ github.workspace }}/libmpv-prefix/lib/aarch64-linux-gnu/pkgconfig
|
||||
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
cask "plezy" do
|
||||
version "1.25.1"
|
||||
sha256 "213d75905ab81ce6ae9142771bd3ce130499612c52ede15b5af65f609f43bd65"
|
||||
version "1.27.0"
|
||||
sha256 "39baaece57637889946ef847e678f33817c0b900ae52a626f5db69415a60fb7b"
|
||||
|
||||
url "https://github.com/edde746/plezy/releases/download/#{version}/plezy-macos.dmg"
|
||||
name "Plezy"
|
||||
|
||||
@@ -26,6 +26,10 @@ A modern Plex client for desktop and mobile. Built with Flutter for native perfo
|
||||
brew tap edde746/plezy https://github.com/edde746/plezy
|
||||
brew install --cask plezy
|
||||
```
|
||||
- [AUR](https://aur.archlinux.org/packages/plezy-bin) (Arch Linux) - Community maintained by [@jianglai](https://github.com/jianglai):
|
||||
```bash
|
||||
yay -S plezy-bin
|
||||
```
|
||||
- **WinGet** (Windows):
|
||||
```bash
|
||||
winget install edde746.plezy
|
||||
|
||||
@@ -138,6 +138,10 @@ dependencies {
|
||||
implementation("androidx.media3:media3-ui:1.9.2")
|
||||
implementation("androidx.media3:media3-common:1.9.2")
|
||||
|
||||
// OkHttp for connection pooling (prevents TCP reconnect stutter at high bitrates)
|
||||
implementation("com.squareup.okhttp3:okhttp:4.12.0")
|
||||
implementation("androidx.media3:media3-datasource-okhttp:1.9.2")
|
||||
|
||||
// FFmpeg audio decoder for unsupported codecs (ALAC, DTS, TrueHD, etc.)
|
||||
implementation("org.jellyfin.media3:media3-ffmpeg-decoder:1.9.0+1")
|
||||
|
||||
|
||||
@@ -265,11 +265,11 @@ class MainActivity : FlutterActivity() {
|
||||
|
||||
override fun onPictureInPictureModeChanged(isInPictureInPictureMode: Boolean,newConfig: Configuration) {
|
||||
super.onPictureInPictureModeChanged(isInPictureInPictureMode, newConfig)
|
||||
MethodChannel( flutterEngine!!.dartExecutor.binaryMessenger, PIP_CHANNEL ).invokeMethod( "onPipChanged" , isInPictureInPictureMode)
|
||||
|
||||
// Notify ExoPlayer plugin to resize video surface for PiP
|
||||
flutterEngine?.plugins?.get(ExoPlayerPlugin::class.java)?.let { plugin ->
|
||||
(plugin as? ExoPlayerPlugin)?.onPipModeChanged(isInPictureInPictureMode)
|
||||
flutterEngine?.let { engine ->
|
||||
MethodChannel(engine.dartExecutor.binaryMessenger, PIP_CHANNEL).invokeMethod("onPipChanged", isInPictureInPictureMode)
|
||||
engine.plugins.get(ExoPlayerPlugin::class.java)?.let { plugin ->
|
||||
(plugin as? ExoPlayerPlugin)?.onPipModeChanged(isInPictureInPictureMode)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ import androidx.media3.extractor.TrackOutput
|
||||
/**
|
||||
* ExtractorOutput wrapper that intercepts video track creation
|
||||
* to insert DoviConvertingTrackOutput for DV processing.
|
||||
* Shared by DoviExtractorWrapper (MP4) and DoviMatroskaExtractor (MKV).
|
||||
* Shared by DoviExtractorWrapper for both MP4 and MKV containers.
|
||||
*/
|
||||
class DoviExtractorOutputWrapper(
|
||||
private val delegate: ExtractorOutput,
|
||||
|
||||
@@ -1,149 +0,0 @@
|
||||
package com.edde746.plezy.exoplayer
|
||||
|
||||
import android.util.Log
|
||||
import androidx.media3.extractor.ExtractorInput
|
||||
import androidx.media3.extractor.ExtractorOutput
|
||||
import androidx.media3.extractor.mkv.MatroskaExtractor
|
||||
import androidx.media3.extractor.text.SubtitleParser
|
||||
import io.github.peerless2012.ass.media.AssHandler
|
||||
|
||||
/**
|
||||
* MatroskaExtractor subclass that adds:
|
||||
* 1. ASS subtitle support (font extraction from MKV attachments, video size reporting)
|
||||
* 2. Dolby Vision Profile 7 → 8.1 conversion (RPU capture from BlockAdditions)
|
||||
*
|
||||
* Replaces both AssMatroskaExtractor and adds DV handling on top.
|
||||
* Font extraction and video size reporting are replicated from AssMatroskaExtractor
|
||||
* since that class is final and cannot be extended.
|
||||
*/
|
||||
class DoviMatroskaExtractor(
|
||||
subtitleParserFactory: SubtitleParser.Factory,
|
||||
private val assHandler: AssHandler,
|
||||
private val dvMode: DvConversionMode = DvConversionMode.HEVC_STRIP,
|
||||
) : MatroskaExtractor(subtitleParserFactory) {
|
||||
|
||||
companion object {
|
||||
private const val TAG = "DoviMkvExtractor"
|
||||
|
||||
// Matroska element IDs for attachments
|
||||
private const val ID_ATTACHMENTS = 0x1941A469
|
||||
private const val ID_ATTACHED_FILE = 0x61A7
|
||||
private const val ID_FILE_NAME = 0x466E
|
||||
private const val ID_FILE_MIME_TYPE = 0x4660
|
||||
private const val ID_FILE_DATA = 0x465C
|
||||
|
||||
// Track video element
|
||||
private const val ID_VIDEO = 0xE0
|
||||
|
||||
// EBML header - hook point for output wrapping
|
||||
private const val ID_EBML = 0x1A45DFA3
|
||||
|
||||
// MKV element type constants (matching MatroskaExtractor internals)
|
||||
private const val TYPE_MASTER = 1
|
||||
private const val TYPE_STRING = 3
|
||||
private const val TYPE_BINARY = 4
|
||||
|
||||
private val FONT_MIME_TYPES = setOf(
|
||||
"application/x-truetype-font",
|
||||
"application/x-font-truetype",
|
||||
"application/vnd.ms-opentype",
|
||||
"font/sfnt",
|
||||
"font/ttf",
|
||||
"font/otf",
|
||||
"font/collection",
|
||||
)
|
||||
|
||||
private val extractorOutputField by lazy {
|
||||
try {
|
||||
MatroskaExtractor::class.java.getDeclaredField("extractorOutput").apply {
|
||||
isAccessible = true
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
Log.w(TAG, "Cannot access extractorOutput field: ${e.message}")
|
||||
null
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ASS font attachment state
|
||||
private var currentAttachmentName: String? = null
|
||||
private var currentAttachmentMime: String? = null
|
||||
|
||||
// DV conversion state
|
||||
@Volatile var doviTrackOutput: DoviConvertingTrackOutput? = null
|
||||
internal set
|
||||
|
||||
// ===== Matroska element overrides =====
|
||||
|
||||
override fun getElementType(id: Int): Int = when (id) {
|
||||
ID_ATTACHMENTS, ID_ATTACHED_FILE -> TYPE_MASTER
|
||||
ID_FILE_NAME, ID_FILE_MIME_TYPE -> TYPE_STRING
|
||||
ID_FILE_DATA -> TYPE_BINARY
|
||||
else -> super.getElementType(id)
|
||||
}
|
||||
|
||||
override fun isLevel1Element(id: Int): Boolean =
|
||||
super.isLevel1Element(id) || id == ID_ATTACHMENTS
|
||||
|
||||
override fun startMasterElement(id: Int, contentPosition: Long, contentSize: Long) {
|
||||
when (id) {
|
||||
ID_EBML -> {
|
||||
wrapExtractorOutput()
|
||||
super.startMasterElement(id, contentPosition, contentSize)
|
||||
}
|
||||
ID_ATTACHED_FILE -> clearAttachment()
|
||||
else -> super.startMasterElement(id, contentPosition, contentSize)
|
||||
}
|
||||
}
|
||||
|
||||
override fun endMasterElement(id: Int) {
|
||||
when (id) {
|
||||
ID_VIDEO -> {
|
||||
val track = getCurrentTrack(id)
|
||||
assHandler.setVideoSize(track.width, track.height)
|
||||
super.endMasterElement(id)
|
||||
}
|
||||
ID_ATTACHED_FILE -> clearAttachment()
|
||||
else -> super.endMasterElement(id)
|
||||
}
|
||||
}
|
||||
|
||||
override fun stringElement(id: Int, value: String) {
|
||||
when (id) {
|
||||
ID_FILE_NAME -> currentAttachmentName = value
|
||||
ID_FILE_MIME_TYPE -> currentAttachmentMime = value
|
||||
else -> super.stringElement(id, value)
|
||||
}
|
||||
}
|
||||
|
||||
override fun binaryElement(id: Int, size: Int, input: ExtractorInput) {
|
||||
if (id == ID_FILE_DATA) {
|
||||
val mime = currentAttachmentMime
|
||||
val name = currentAttachmentName
|
||||
if (mime != null && name != null && mime in FONT_MIME_TYPES) {
|
||||
val data = ByteArray(size)
|
||||
input.readFully(data, 0, size)
|
||||
assHandler.addFont(name, data)
|
||||
} else {
|
||||
input.skipFully(size)
|
||||
}
|
||||
clearAttachment()
|
||||
} else {
|
||||
super.binaryElement(id, size, input)
|
||||
}
|
||||
}
|
||||
|
||||
// ===== ExtractorOutput wrapping =====
|
||||
|
||||
private fun wrapExtractorOutput() {
|
||||
val field = extractorOutputField ?: return
|
||||
val output = field.get(this) as? ExtractorOutput ?: return
|
||||
if (output is DoviExtractorOutputWrapper) return
|
||||
field.set(this, DoviExtractorOutputWrapper(output, dvMode) { doviTrackOutput = it })
|
||||
}
|
||||
|
||||
private fun clearAttachment() {
|
||||
currentAttachmentName = null
|
||||
currentAttachmentMime = null
|
||||
}
|
||||
}
|
||||
@@ -9,7 +9,6 @@ import android.net.Uri
|
||||
import android.os.Build
|
||||
import android.os.Handler
|
||||
import android.os.Looper
|
||||
import android.os.SystemClock
|
||||
import android.util.Log
|
||||
import android.view.Gravity
|
||||
import android.view.SurfaceView
|
||||
@@ -32,6 +31,9 @@ import androidx.media3.common.VideoSize
|
||||
import androidx.media3.common.util.UnstableApi
|
||||
import androidx.media3.exoplayer.analytics.AnalyticsListener
|
||||
import androidx.media3.datasource.DefaultDataSource
|
||||
import androidx.media3.datasource.okhttp.OkHttpDataSource
|
||||
import okhttp3.OkHttpClient
|
||||
import java.util.concurrent.TimeUnit
|
||||
import androidx.media3.exoplayer.DefaultLoadControl
|
||||
import androidx.media3.exoplayer.DefaultRenderersFactory
|
||||
import androidx.media3.exoplayer.mediacodec.MediaCodecSelector
|
||||
@@ -73,16 +75,6 @@ interface ExoPlayerDelegate : com.edde746.plezy.shared.PlayerDelegate {
|
||||
@OptIn(UnstableApi::class)
|
||||
class ExoPlayerCore(private val activity: Activity) : Player.Listener {
|
||||
|
||||
private data class SubtitleStyleState(
|
||||
val fontSize: Float,
|
||||
val textColor: String,
|
||||
val borderSize: Float,
|
||||
val borderColor: String,
|
||||
val bgColor: String,
|
||||
val bgOpacity: Int,
|
||||
val subtitlePosition: Int,
|
||||
)
|
||||
|
||||
companion object {
|
||||
private const val TAG = "ExoPlayerCore"
|
||||
|
||||
@@ -95,6 +87,16 @@ class ExoPlayerCore(private val activity: Activity) : Player.Listener {
|
||||
private val tunneledPlaybackCache = HashMap<String, Boolean>()
|
||||
|
||||
private var assGlCrashHandlerInstalled = false
|
||||
|
||||
// Process-wide OkHttp client with connection pooling — reuses TCP connections
|
||||
// on buffer refill to prevent reconnect-induced frame drops at high bitrates
|
||||
private val okHttpClient: OkHttpClient by lazy {
|
||||
OkHttpClient.Builder()
|
||||
.connectTimeout(15, TimeUnit.SECONDS)
|
||||
.readTimeout(30, TimeUnit.SECONDS)
|
||||
.writeTimeout(15, TimeUnit.SECONDS)
|
||||
.build()
|
||||
}
|
||||
}
|
||||
|
||||
private var surfaceView: SurfaceView? = null
|
||||
@@ -104,6 +106,8 @@ class ExoPlayerCore(private val activity: Activity) : Player.Listener {
|
||||
private var overlayLayoutListener: ViewTreeObserver.OnGlobalLayoutListener? = null
|
||||
private var lastVideoSize: VideoSize? = null
|
||||
private var exoPlayer: ExoPlayer? = null
|
||||
private var httpDataSourceFactory: OkHttpDataSource.Factory? = null
|
||||
private var dataSourceFactory: DefaultDataSource.Factory? = null
|
||||
private var trackSelector: DefaultTrackSelector? = null
|
||||
private var tunnelingUserEnabled: Boolean = true
|
||||
private var tunnelingDisabledForAudioCodec: Boolean = false
|
||||
@@ -111,12 +115,7 @@ class ExoPlayerCore(private val activity: Activity) : Player.Listener {
|
||||
private val tunnelingDisabledForCodec: Boolean
|
||||
get() = tunnelingDisabledForAudioCodec || tunnelingDisabledForVideoCodec
|
||||
private var currentTunneledPlayback: Boolean = false
|
||||
private var tunnelingCorrectionInProgress: Boolean = false
|
||||
private var pendingRestoredAudioTrackId: String? = null
|
||||
private var pendingRestoredSubtitleTrackId: String? = null
|
||||
private var lastSeekable: Boolean? = null
|
||||
private var lastTunnelingCorrectionTarget: Boolean? = null
|
||||
private var lastTunnelingCorrectionAtMs: Long = 0L
|
||||
@Volatile private var disposing: Boolean = false
|
||||
private var pendingStartPositionMs: Long = 0L
|
||||
|
||||
@@ -155,8 +154,6 @@ class ExoPlayerCore(private val activity: Activity) : Player.Listener {
|
||||
private var selectedAudioTrackId: String? = null
|
||||
private var selectedSubtitleTrackId: String? = null
|
||||
private var selectedExternalSubtitleIndex: Int? = null
|
||||
private var subtitleStyleState: SubtitleStyleState? = null
|
||||
private var reapplySubtitleStyleOnNextReady: Boolean = false
|
||||
|
||||
private fun emitLog(level: String, prefix: String, message: String) {
|
||||
when (level) {
|
||||
@@ -222,7 +219,7 @@ class ExoPlayerCore(private val activity: Activity) : Player.Listener {
|
||||
// DV conversion state
|
||||
private var dvMode: DvConversionMode = DvConversionMode.DISABLED
|
||||
private var dv7RetryAttempted = false
|
||||
@Volatile private var activeDoviMkvExtractor: DoviMatroskaExtractor? = null
|
||||
@Volatile private var activeDoviMkvWrapper: DoviExtractorWrapper? = null
|
||||
@Volatile private var activeDoviMp4Wrapper: DoviExtractorWrapper? = null
|
||||
|
||||
fun initialize(bufferSizeBytes: Int? = null, tunnelingEnabled: Boolean = true): Boolean {
|
||||
@@ -323,7 +320,7 @@ class ExoPlayerCore(private val activity: Activity) : Player.Listener {
|
||||
trackSelector = DefaultTrackSelector(activity).apply {
|
||||
setParameters(
|
||||
buildUponParameters()
|
||||
.setTunnelingEnabled(false)
|
||||
.setTunnelingEnabled(tunnelingUserEnabled)
|
||||
.setTrackTypeDisabled(C.TRACK_TYPE_TEXT, false)
|
||||
.setPreferredTextLanguage("en")
|
||||
)
|
||||
@@ -352,8 +349,9 @@ class ExoPlayerCore(private val activity: Activity) : Player.Listener {
|
||||
}
|
||||
}
|
||||
|
||||
// Create factories for buildWithAssSupport (like AndroidTV-FireTV)
|
||||
val dataSourceFactory = DefaultDataSource.Factory(activity)
|
||||
// OkHttp DataSource for TCP connection pooling — prevents reconnect stutter at high bitrates
|
||||
httpDataSourceFactory = OkHttpDataSource.Factory(okHttpClient)
|
||||
dataSourceFactory = DefaultDataSource.Factory(activity, httpDataSourceFactory!!)
|
||||
val extractorsFactory = DefaultExtractorsFactory()
|
||||
|
||||
// Inline buildWithAssSupport to retain AssHandler reference for font scale control.
|
||||
@@ -377,12 +375,13 @@ class ExoPlayerCore(private val activity: Activity) : Player.Listener {
|
||||
extractorsFactory.createExtractors().map { extractor ->
|
||||
when {
|
||||
extractor is MatroskaExtractor -> {
|
||||
val assExtractor = AssMatroskaExtractor(assParserFactory, handler)
|
||||
if (doviEnabled) {
|
||||
DoviMatroskaExtractor(assParserFactory, handler, currentDvMode).also {
|
||||
activeDoviMkvExtractor = it
|
||||
DoviExtractorWrapper(assExtractor, currentDvMode).also {
|
||||
activeDoviMkvWrapper = it
|
||||
}
|
||||
} else {
|
||||
AssMatroskaExtractor(assParserFactory, handler)
|
||||
assExtractor
|
||||
}
|
||||
}
|
||||
doviEnabled && (extractor is Mp4Extractor || extractor is FragmentedMp4Extractor) -> {
|
||||
@@ -395,7 +394,7 @@ class ExoPlayerCore(private val activity: Activity) : Player.Listener {
|
||||
}.toTypedArray()
|
||||
}
|
||||
|
||||
val mediaSourceFactory = DefaultMediaSourceFactory(dataSourceFactory, wrappedExtractorsFactory)
|
||||
val mediaSourceFactory = DefaultMediaSourceFactory(dataSourceFactory!!, wrappedExtractorsFactory)
|
||||
.setSubtitleParserFactory(assParserFactory)
|
||||
|
||||
val wrappedRenderersFactory = AssRenderersFactory(handler, renderersFactory)
|
||||
@@ -409,12 +408,13 @@ class ExoPlayerCore(private val activity: Activity) : Player.Listener {
|
||||
val targetBufferBytes = if (bufferSizeBytes != null && bufferSizeBytes > 0) {
|
||||
bufferSizeBytes
|
||||
} else {
|
||||
// Scale buffer to available memory to reduce hardware decoder pressure
|
||||
// Scale buffer to available memory to reduce hardware decoder pressure.
|
||||
// Larger buffers reduce oscillation frequency at high bitrates (50-100Mbps).
|
||||
when {
|
||||
availableMB <= 512 -> 30 * 1024 * 1024
|
||||
availableMB <= 1024 -> 50 * 1024 * 1024
|
||||
availableMB <= 2048 -> 60 * 1024 * 1024
|
||||
else -> 130 * 1024 * 1024
|
||||
availableMB <= 1024 -> 80 * 1024 * 1024
|
||||
availableMB <= 2048 -> 120 * 1024 * 1024
|
||||
else -> 200 * 1024 * 1024
|
||||
}
|
||||
}
|
||||
|
||||
@@ -427,7 +427,7 @@ class ExoPlayerCore(private val activity: Activity) : Player.Listener {
|
||||
setBufferDurationsMs(30_000, 60_000, 2_500, 5_000)
|
||||
}
|
||||
}.build()
|
||||
emitLog("info", "init", "Buffer: ${targetBufferBytes / 1024 / 1024}MB limit, available=${availableMB}MB, tunneling=${tunnelingUserEnabled}")
|
||||
emitLog("info", "init", "Buffer: ${targetBufferBytes / 1024 / 1024}MB limit, available=${availableMB}MB, tunneling=${tunnelingUserEnabled}, dataSource=OkHttp")
|
||||
|
||||
exoPlayer = ExoPlayer.Builder(activity)
|
||||
.setTrackSelector(trackSelector!!)
|
||||
@@ -602,7 +602,6 @@ class ExoPlayerCore(private val activity: Activity) : Player.Listener {
|
||||
}
|
||||
delegate?.onPropertyChange("paused-for-cache", false)
|
||||
delegate?.onEvent("playback-restart", null)
|
||||
applyStoredSubtitleStyleIfNeeded()
|
||||
emitTrackList()
|
||||
|
||||
// Start frame watchdog to detect black screen (HDR tunneling issue)
|
||||
@@ -651,11 +650,6 @@ class ExoPlayerCore(private val activity: Activity) : Player.Listener {
|
||||
|
||||
evaluateAudioCodecForTunneling()
|
||||
evaluateVideoCodecForTunneling()
|
||||
captureSelectedTrackIds(tracks)
|
||||
if (maybeRestoreTrackSelectionsAfterReopen()) {
|
||||
emitTrackList()
|
||||
return
|
||||
}
|
||||
updateTunnelingState("tracks changed")
|
||||
emitTrackList()
|
||||
}
|
||||
@@ -976,11 +970,15 @@ class ExoPlayerCore(private val activity: Activity) : Player.Listener {
|
||||
}
|
||||
|
||||
private fun updateTunnelingState(reason: String) {
|
||||
val selector = trackSelector ?: return
|
||||
val player = exoPlayer ?: return
|
||||
val desiredTunneling = desiredTunnelingMode(player)
|
||||
if (desiredTunneling == currentTunneledPlayback) return
|
||||
emitLog("info", "tunneling", "Mode mismatch current=$currentTunneledPlayback desired=$desiredTunneling (reason=$reason, user=$tunnelingUserEnabled, speed=${player.playbackParameters.speed}, audioCodecDisabled=$tunnelingDisabledForAudioCodec, videoCodecDisabled=$tunnelingDisabledForVideoCodec)")
|
||||
requestTunnelingCorrectionReopen(desiredTunneling, reason)
|
||||
val shouldTunnel = tunnelingUserEnabled && (player.playbackParameters.speed == 1f) && !tunnelingDisabledForCodec
|
||||
if (shouldTunnel == currentTunneledPlayback) return
|
||||
currentTunneledPlayback = shouldTunnel
|
||||
emitLog("info", "tunneling", "Toggling tunneling=$shouldTunnel (reason=$reason, user=$tunnelingUserEnabled, speed=${player.playbackParameters.speed}, audioCodecDisabled=$tunnelingDisabledForAudioCodec, videoCodecDisabled=$tunnelingDisabledForVideoCodec)")
|
||||
selector.setParameters(
|
||||
selector.buildUponParameters().setTunnelingEnabled(shouldTunnel)
|
||||
)
|
||||
}
|
||||
|
||||
private fun evaluateAudioCodecForTunneling() {
|
||||
@@ -999,165 +997,6 @@ class ExoPlayerCore(private val activity: Activity) : Player.Listener {
|
||||
}
|
||||
}
|
||||
|
||||
private fun desiredTunnelingMode(player: ExoPlayer): Boolean {
|
||||
if (!tunnelingUserEnabled) return false
|
||||
if (player.playbackParameters.speed != 1f) return false
|
||||
|
||||
val selectedVideoGroup = player.currentTracks.groups.firstOrNull {
|
||||
it.type == C.TRACK_TYPE_VIDEO && it.isSelected
|
||||
} ?: return false
|
||||
val selectedAudioGroup = player.currentTracks.groups.firstOrNull {
|
||||
it.type == C.TRACK_TYPE_AUDIO && it.isSelected
|
||||
} ?: return false
|
||||
|
||||
val videoMimeType = selectedVideoGroup.mediaTrackGroup.getFormat(0).sampleMimeType ?: return false
|
||||
val audioMimeType = selectedAudioGroup.mediaTrackGroup.getFormat(0).sampleMimeType ?: return false
|
||||
|
||||
return videoCodecSupportsTunneledPlayback(videoMimeType) && hasHardwareAudioDecoder(audioMimeType)
|
||||
}
|
||||
|
||||
private fun requestTunnelingCorrectionReopen(targetTunneledPlayback: Boolean, reason: String) {
|
||||
val uri = currentMediaUri ?: return
|
||||
val player = exoPlayer ?: return
|
||||
|
||||
if (tunnelingCorrectionInProgress) {
|
||||
emitLog("debug", "tunneling", "Skipping reopen to $targetTunneledPlayback while correction is already in progress")
|
||||
return
|
||||
}
|
||||
|
||||
val now = SystemClock.elapsedRealtime()
|
||||
if (lastTunnelingCorrectionTarget == targetTunneledPlayback &&
|
||||
now - lastTunnelingCorrectionAtMs < 3000L) {
|
||||
emitLog("warn", "tunneling", "Skipping reopen to $targetTunneledPlayback to avoid correction loop")
|
||||
return
|
||||
}
|
||||
|
||||
val shouldResume = player.playWhenReady
|
||||
tunnelingCorrectionInProgress = true
|
||||
pendingRestoredAudioTrackId = selectedAudioTrackId
|
||||
pendingRestoredSubtitleTrackId = selectedSubtitleTrackId
|
||||
lastTunnelingCorrectionTarget = targetTunneledPlayback
|
||||
lastTunnelingCorrectionAtMs = now
|
||||
currentTunneledPlayback = targetTunneledPlayback
|
||||
tunnelingDisabledForAudioCodec = false
|
||||
tunnelingDisabledForVideoCodec = false
|
||||
pendingStartPositionMs = player.currentPosition
|
||||
reapplySubtitleStyleOnNextReady = true
|
||||
applyTunnelingMode(targetTunneledPlayback)
|
||||
|
||||
emitLog(
|
||||
"info",
|
||||
"tunneling",
|
||||
"Reopening playback with tunneling=$targetTunneledPlayback (reason=$reason, position=${pendingStartPositionMs}ms, audio=$pendingRestoredAudioTrackId, subtitle=$pendingRestoredSubtitleTrackId)"
|
||||
)
|
||||
|
||||
if (currentMediaIsLive) {
|
||||
val reopenHeaders = currentHeaders
|
||||
val dataSourceFactory = if (!reopenHeaders.isNullOrEmpty()) {
|
||||
DefaultDataSource.Factory(activity,
|
||||
androidx.media3.datasource.DefaultHttpDataSource.Factory()
|
||||
.setDefaultRequestProperties(reopenHeaders))
|
||||
} else {
|
||||
DefaultDataSource.Factory(activity)
|
||||
}
|
||||
|
||||
val extractorsFactory = androidx.media3.extractor.ExtractorsFactory {
|
||||
arrayOf(MatroskaExtractor(MatroskaExtractor.FLAG_DISABLE_SEEK_FOR_CUES))
|
||||
}
|
||||
|
||||
val mediaSource = ProgressiveMediaSource.Factory(dataSourceFactory, extractorsFactory)
|
||||
.createMediaSource(MediaItem.fromUri(uri))
|
||||
|
||||
player.setMediaSource(mediaSource, pendingStartPositionMs)
|
||||
player.prepare()
|
||||
player.playWhenReady = shouldResume
|
||||
setVisible(currentVisible)
|
||||
return
|
||||
}
|
||||
|
||||
player.setMediaItem(buildMediaItem(uri), pendingStartPositionMs)
|
||||
player.prepare()
|
||||
player.playWhenReady = shouldResume
|
||||
setVisible(currentVisible)
|
||||
}
|
||||
|
||||
private fun captureSelectedTrackIds(tracks: Tracks) {
|
||||
val audioGroups = tracks.groups.filter { it.type == C.TRACK_TYPE_AUDIO }
|
||||
val textGroups = tracks.groups.filter { it.type == C.TRACK_TYPE_TEXT }
|
||||
val selectedAudioIndex = audioGroups.indexOfFirst { it.isSelected }
|
||||
val selectedSubtitleIndex = textGroups.indexOfFirst { it.isSelected }
|
||||
|
||||
selectedAudioTrackId = selectedAudioIndex.takeIf { it >= 0 }?.let { "${C.TRACK_TYPE_AUDIO}_$it" }
|
||||
selectedSubtitleTrackId = when {
|
||||
selectedExternalSubtitleIndex != null -> "ext_sub_$selectedExternalSubtitleIndex"
|
||||
selectedSubtitleIndex >= 0 -> "${C.TRACK_TYPE_TEXT}_$selectedSubtitleIndex"
|
||||
textGroups.isNotEmpty() || externalSubtitles.isNotEmpty() -> "no"
|
||||
else -> null
|
||||
}
|
||||
}
|
||||
|
||||
private fun maybeRestoreTrackSelectionsAfterReopen(): Boolean {
|
||||
if (!tunnelingCorrectionInProgress) return false
|
||||
|
||||
val audioToRestore = pendingRestoredAudioTrackId
|
||||
if (audioToRestore != null && audioToRestore != selectedAudioTrackId) {
|
||||
val audioIndex = audioToRestore.substringAfter('_', "").toIntOrNull()
|
||||
val player = exoPlayer
|
||||
if (player != null && audioIndex != null) {
|
||||
val audioGroups = player.currentTracks.groups.filter { it.type == C.TRACK_TYPE_AUDIO }
|
||||
if (audioIndex in audioGroups.indices) {
|
||||
emitLog("info", "tunneling", "Restoring audio track $audioToRestore after reopen")
|
||||
selectAudioTrack(audioToRestore)
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
val subtitleToRestore = pendingRestoredSubtitleTrackId
|
||||
if (subtitleToRestore != null && subtitleToRestore != selectedSubtitleTrackId) {
|
||||
when {
|
||||
subtitleToRestore == "no" -> {
|
||||
emitLog("info", "tunneling", "Restoring subtitles off after reopen")
|
||||
selectSubtitleTrack("no")
|
||||
return true
|
||||
}
|
||||
subtitleToRestore.startsWith("ext_sub_") -> {
|
||||
val externalIndex = subtitleToRestore.removePrefix("ext_sub_").toIntOrNull()
|
||||
if (externalIndex != null && selectedExternalSubtitleIndex != externalIndex && externalIndex in externalSubtitles.indices) {
|
||||
emitLog("info", "tunneling", "Restoring external subtitle $subtitleToRestore after reopen")
|
||||
selectSubtitleTrack(subtitleToRestore)
|
||||
return true
|
||||
}
|
||||
}
|
||||
else -> {
|
||||
val subtitleIndex = subtitleToRestore.substringAfter('_', "").toIntOrNull()
|
||||
val player = exoPlayer
|
||||
if (player != null && subtitleIndex != null) {
|
||||
val textGroups = player.currentTracks.groups.filter { it.type == C.TRACK_TYPE_TEXT }
|
||||
if (subtitleIndex in textGroups.indices) {
|
||||
emitLog("info", "tunneling", "Restoring subtitle track $subtitleToRestore after reopen")
|
||||
selectSubtitleTrack(subtitleToRestore)
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pendingRestoredAudioTrackId = null
|
||||
pendingRestoredSubtitleTrackId = null
|
||||
tunnelingCorrectionInProgress = false
|
||||
emitLog("info", "tunneling", "Tunneling correction reopen completed")
|
||||
return false
|
||||
}
|
||||
|
||||
private fun applyTunnelingMode(enabled: Boolean) {
|
||||
val selector = trackSelector ?: return
|
||||
selector.parameters = selector.buildUponParameters()
|
||||
.setTunnelingEnabled(enabled)
|
||||
.build()
|
||||
}
|
||||
|
||||
private fun buildMediaItem(uri: String): MediaItem {
|
||||
val mediaItemBuilder = MediaItem.Builder()
|
||||
.setUri(uri)
|
||||
@@ -1169,23 +1008,6 @@ class ExoPlayerCore(private val activity: Activity) : Player.Listener {
|
||||
return mediaItemBuilder.build()
|
||||
}
|
||||
|
||||
private fun applyStoredSubtitleStyleIfNeeded() {
|
||||
if (!reapplySubtitleStyleOnNextReady) return
|
||||
reapplySubtitleStyleOnNextReady = false
|
||||
|
||||
subtitleStyleState?.let {
|
||||
setSubtitleStyle(
|
||||
fontSize = it.fontSize,
|
||||
textColor = it.textColor,
|
||||
borderSize = it.borderSize,
|
||||
borderColor = it.borderColor,
|
||||
bgColor = it.bgColor,
|
||||
bgOpacity = it.bgOpacity,
|
||||
subtitlePosition = it.subtitlePosition,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
// Decoder hang detection via AnalyticsListener:
|
||||
// Tracks the gap between onVideoDecoderInitialized and onRenderedFirstFrame.
|
||||
// If the decoder is initialized and fed input but never produces output, it's hung
|
||||
@@ -1342,40 +1164,35 @@ class ExoPlayerCore(private val activity: Activity) : Player.Listener {
|
||||
currentMediaUri = uri
|
||||
currentHeaders = headers
|
||||
currentMediaIsLive = isLive
|
||||
|
||||
// Apply auth/custom headers to the OkHttp DataSource for this session
|
||||
httpDataSourceFactory?.setDefaultRequestProperties(
|
||||
if (!headers.isNullOrEmpty()) headers else emptyMap()
|
||||
)
|
||||
|
||||
externalSubtitles.clear()
|
||||
selectedExternalSubtitleIndex = null
|
||||
selectedAudioTrackId = null
|
||||
selectedSubtitleTrackId = null
|
||||
pendingRestoredAudioTrackId = null
|
||||
pendingRestoredSubtitleTrackId = null
|
||||
tunnelingCorrectionInProgress = false
|
||||
lastTunnelingCorrectionTarget = null
|
||||
lastTunnelingCorrectionAtMs = 0L
|
||||
reapplySubtitleStyleOnNextReady = false
|
||||
tunnelingDisabledForAudioCodec = false
|
||||
tunnelingDisabledForVideoCodec = false
|
||||
currentTunneledPlayback = false
|
||||
currentTunneledPlayback = tunnelingUserEnabled
|
||||
pendingStartPositionMs = startPositionMs
|
||||
applyTunnelingMode(false)
|
||||
trackSelector?.setParameters(
|
||||
trackSelector!!.buildUponParameters().setTunnelingEnabled(tunnelingUserEnabled)
|
||||
)
|
||||
emitSeekable(false, force = true)
|
||||
|
||||
if (isLive) {
|
||||
// Live MKV streams lack Cues (seek index). FLAG_DISABLE_SEEK_FOR_CUES tells
|
||||
// MatroskaExtractor to not seek for them, treating the stream as unseekable
|
||||
// so data flows immediately without hanging.
|
||||
val dataSourceFactory = if (!headers.isNullOrEmpty()) {
|
||||
DefaultDataSource.Factory(activity,
|
||||
androidx.media3.datasource.DefaultHttpDataSource.Factory()
|
||||
.setDefaultRequestProperties(headers))
|
||||
} else {
|
||||
DefaultDataSource.Factory(activity)
|
||||
}
|
||||
|
||||
// Headers already applied to httpDataSourceFactory above.
|
||||
val extractorsFactory = androidx.media3.extractor.ExtractorsFactory {
|
||||
arrayOf(MatroskaExtractor(MatroskaExtractor.FLAG_DISABLE_SEEK_FOR_CUES))
|
||||
}
|
||||
|
||||
val mediaSource = ProgressiveMediaSource.Factory(dataSourceFactory, extractorsFactory)
|
||||
val mediaSource = ProgressiveMediaSource.Factory(dataSourceFactory!!, extractorsFactory)
|
||||
.createMediaSource(MediaItem.fromUri(uri))
|
||||
|
||||
exoPlayer?.apply {
|
||||
@@ -1567,15 +1384,6 @@ class ExoPlayerCore(private val activity: Activity) : Player.Listener {
|
||||
bgOpacity: Int,
|
||||
subtitlePosition: Int = 100
|
||||
) {
|
||||
subtitleStyleState = SubtitleStyleState(
|
||||
fontSize = fontSize,
|
||||
textColor = textColor,
|
||||
borderSize = borderSize,
|
||||
borderColor = borderColor,
|
||||
bgColor = bgColor,
|
||||
bgOpacity = bgOpacity,
|
||||
subtitlePosition = subtitlePosition,
|
||||
)
|
||||
activity.runOnUiThread {
|
||||
// 1. Non-ASS subtitles: CaptionStyleCompat on SubtitleView
|
||||
val fgColor = Color.parseColor(textColor)
|
||||
@@ -1711,7 +1519,7 @@ class ExoPlayerCore(private val activity: Activity) : Player.Listener {
|
||||
"isPlaying" to player.isPlaying,
|
||||
"playbackState" to player.playbackState,
|
||||
// DV conversion (query extractor's track output, which is set during extraction)
|
||||
*(activeDoviMkvExtractor?.doviTrackOutput
|
||||
*(activeDoviMkvWrapper?.doviTrackOutput
|
||||
?: activeDoviMp4Wrapper?.doviTrackOutput).let { dovi ->
|
||||
arrayOf(
|
||||
"dvConversionActive" to (dovi?.conversionActive == true),
|
||||
@@ -1779,11 +1587,6 @@ class ExoPlayerCore(private val activity: Activity) : Player.Listener {
|
||||
tunnelingDisabledForAudioCodec = false
|
||||
tunnelingDisabledForVideoCodec = false
|
||||
currentTunneledPlayback = false
|
||||
tunnelingCorrectionInProgress = false
|
||||
pendingRestoredAudioTrackId = null
|
||||
pendingRestoredSubtitleTrackId = null
|
||||
lastTunnelingCorrectionTarget = null
|
||||
lastTunnelingCorrectionAtMs = 0L
|
||||
pendingStartPositionMs = 0L
|
||||
currentMediaIsLive = false
|
||||
currentVisible = false
|
||||
@@ -1791,12 +1594,13 @@ class ExoPlayerCore(private val activity: Activity) : Player.Listener {
|
||||
selectedAudioTrackId = null
|
||||
selectedSubtitleTrackId = null
|
||||
selectedExternalSubtitleIndex = null
|
||||
reapplySubtitleStyleOnNextReady = false
|
||||
exoPlayer?.clearVideoSurface()
|
||||
exoPlayer?.removeListener(this)
|
||||
exoPlayer?.release()
|
||||
exoPlayer = null
|
||||
trackSelector = null
|
||||
httpDataSourceFactory = null
|
||||
dataSourceFactory = null
|
||||
assHandler = null
|
||||
|
||||
val cb = surfaceCallback
|
||||
|
||||
@@ -224,7 +224,9 @@ class ExoPlayerPlugin : FlutterPlugin, MethodChannel.MethodCallHandler,
|
||||
val optionsStr = options.joinToString(",")
|
||||
// Convert content:// URIs to fdclose:// for MPV (SAF SD card downloads)
|
||||
val mpvUri = openContentFd(uri)?.let { "fdclose://$it" } ?: uri
|
||||
mpvCore?.command(arrayOf("loadfile", mpvUri, "replace", "-1", optionsStr))
|
||||
mpvCore?.runOnExecutor {
|
||||
mpvCore?.command(arrayOf("loadfile", mpvUri, "replace", "-1", optionsStr))
|
||||
}
|
||||
} else {
|
||||
playerCore?.open(uri, headers, startPositionMs, autoPlay, isLive)
|
||||
}
|
||||
@@ -235,7 +237,7 @@ class ExoPlayerPlugin : FlutterPlugin, MethodChannel.MethodCallHandler,
|
||||
private fun handlePlay(result: MethodChannel.Result) {
|
||||
activity?.runOnUiThread {
|
||||
if (usingMpvFallback) {
|
||||
mpvCore?.setProperty("pause", "no")
|
||||
mpvCore?.runOnExecutor { mpvCore?.setProperty("pause", "no") }
|
||||
} else {
|
||||
playerCore?.play()
|
||||
}
|
||||
@@ -246,7 +248,7 @@ class ExoPlayerPlugin : FlutterPlugin, MethodChannel.MethodCallHandler,
|
||||
private fun handlePause(result: MethodChannel.Result) {
|
||||
activity?.runOnUiThread {
|
||||
if (usingMpvFallback) {
|
||||
mpvCore?.setProperty("pause", "yes")
|
||||
mpvCore?.runOnExecutor { mpvCore?.setProperty("pause", "yes") }
|
||||
} else {
|
||||
playerCore?.pause()
|
||||
}
|
||||
@@ -257,8 +259,10 @@ class ExoPlayerPlugin : FlutterPlugin, MethodChannel.MethodCallHandler,
|
||||
private fun handleStop(result: MethodChannel.Result) {
|
||||
activity?.runOnUiThread {
|
||||
if (usingMpvFallback) {
|
||||
mpvCore?.command(arrayOf("stop"))
|
||||
mpvCore?.setVisible(false)
|
||||
mpvCore?.runOnExecutor {
|
||||
mpvCore?.command(arrayOf("stop"))
|
||||
mpvCore?.setVisible(false)
|
||||
}
|
||||
} else {
|
||||
playerCore?.stop()
|
||||
}
|
||||
@@ -277,7 +281,9 @@ class ExoPlayerPlugin : FlutterPlugin, MethodChannel.MethodCallHandler,
|
||||
activity?.runOnUiThread {
|
||||
if (usingMpvFallback) {
|
||||
val positionSeconds = positionMs / 1000.0
|
||||
mpvCore?.command(arrayOf("seek", positionSeconds.toString(), "absolute"))
|
||||
mpvCore?.runOnExecutor {
|
||||
mpvCore?.command(arrayOf("seek", positionSeconds.toString(), "absolute"))
|
||||
}
|
||||
} else {
|
||||
playerCore?.seekTo(positionMs)
|
||||
}
|
||||
@@ -295,7 +301,7 @@ class ExoPlayerPlugin : FlutterPlugin, MethodChannel.MethodCallHandler,
|
||||
|
||||
activity?.runOnUiThread {
|
||||
if (usingMpvFallback) {
|
||||
mpvCore?.setProperty("volume", volume.toString())
|
||||
mpvCore?.runOnExecutor { mpvCore?.setProperty("volume", volume.toString()) }
|
||||
} else {
|
||||
playerCore?.setVolume(volume / 100f) // Convert 0-100 to 0-1
|
||||
}
|
||||
@@ -313,7 +319,7 @@ class ExoPlayerPlugin : FlutterPlugin, MethodChannel.MethodCallHandler,
|
||||
|
||||
activity?.runOnUiThread {
|
||||
if (usingMpvFallback) {
|
||||
mpvCore?.setProperty("speed", rate.toString())
|
||||
mpvCore?.runOnExecutor { mpvCore?.setProperty("speed", rate.toString()) }
|
||||
} else {
|
||||
playerCore?.setPlaybackSpeed(rate)
|
||||
}
|
||||
@@ -333,7 +339,7 @@ class ExoPlayerPlugin : FlutterPlugin, MethodChannel.MethodCallHandler,
|
||||
if (usingMpvFallback) {
|
||||
// MPV uses numeric track IDs - extract from string format
|
||||
val numericId = trackId.split("_").lastOrNull()?.toIntOrNull() ?: 1
|
||||
mpvCore?.setProperty("aid", numericId.toString())
|
||||
mpvCore?.runOnExecutor { mpvCore?.setProperty("aid", numericId.toString()) }
|
||||
} else {
|
||||
playerCore?.selectAudioTrack(trackId)
|
||||
}
|
||||
@@ -347,11 +353,13 @@ class ExoPlayerPlugin : FlutterPlugin, MethodChannel.MethodCallHandler,
|
||||
// trackId can be null or "no" to disable subtitles
|
||||
activity?.runOnUiThread {
|
||||
if (usingMpvFallback) {
|
||||
if (trackId == null || trackId == "no") {
|
||||
mpvCore?.setProperty("sid", "no")
|
||||
} else {
|
||||
val numericId = trackId.split("_").lastOrNull()?.toIntOrNull() ?: 1
|
||||
mpvCore?.setProperty("sid", numericId.toString())
|
||||
mpvCore?.runOnExecutor {
|
||||
if (trackId == null || trackId == "no") {
|
||||
mpvCore?.setProperty("sid", "no")
|
||||
} else {
|
||||
val numericId = trackId.split("_").lastOrNull()?.toIntOrNull() ?: 1
|
||||
mpvCore?.setProperty("sid", numericId.toString())
|
||||
}
|
||||
}
|
||||
} else {
|
||||
playerCore?.selectSubtitleTrack(trackId)
|
||||
@@ -375,7 +383,9 @@ class ExoPlayerPlugin : FlutterPlugin, MethodChannel.MethodCallHandler,
|
||||
activity?.runOnUiThread {
|
||||
if (usingMpvFallback) {
|
||||
val selectFlag = if (select) "select" else "auto"
|
||||
mpvCore?.command(arrayOf("sub-add", uri, selectFlag, title ?: "External"))
|
||||
mpvCore?.runOnExecutor {
|
||||
mpvCore?.command(arrayOf("sub-add", uri, selectFlag, title ?: "External"))
|
||||
}
|
||||
} else {
|
||||
playerCore?.addSubtitleTrack(uri, title, language, mimeType, select)
|
||||
}
|
||||
@@ -484,7 +494,7 @@ class ExoPlayerPlugin : FlutterPlugin, MethodChannel.MethodCallHandler,
|
||||
}
|
||||
|
||||
if (usingMpvFallback) {
|
||||
mpvCore?.setProperty(name, value)
|
||||
mpvCore?.runOnExecutor { mpvCore?.setProperty(name, value) }
|
||||
} else {
|
||||
// Store for later application if ExoPlayer falls back to MPV
|
||||
pendingMpvProperties.add(Pair(name, value))
|
||||
@@ -493,16 +503,17 @@ class ExoPlayerPlugin : FlutterPlugin, MethodChannel.MethodCallHandler,
|
||||
}
|
||||
|
||||
private fun handleGetStats(result: MethodChannel.Result) {
|
||||
activity?.runOnUiThread {
|
||||
val stats = if (usingMpvFallback) {
|
||||
// For MPV fallback, query MPV properties directly
|
||||
getMpvStats()
|
||||
} else {
|
||||
if (usingMpvFallback) {
|
||||
mpvCore?.runOnExecutor {
|
||||
val stats = getMpvStats()
|
||||
activity?.runOnUiThread { result.success(stats) }
|
||||
} ?: result.success(mapOf("playerType" to "mpv"))
|
||||
} else {
|
||||
activity?.runOnUiThread {
|
||||
val coreStats = playerCore?.getStats() ?: emptyMap()
|
||||
coreStats + mapOf("playerType" to "exoplayer")
|
||||
}
|
||||
result.success(stats)
|
||||
} ?: result.success(mapOf("playerType" to "unknown"))
|
||||
result.success(coreStats + mapOf("playerType" to "exoplayer"))
|
||||
} ?: result.success(mapOf("playerType" to "unknown"))
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -652,71 +663,80 @@ class ExoPlayerPlugin : FlutterPlugin, MethodChannel.MethodCallHandler,
|
||||
usingMpvFallback = true
|
||||
fallbackInProgress = false
|
||||
|
||||
// Configure basic MPV properties for Plex playback
|
||||
mpvCore?.setProperty("hwdec", "mediacodec,mediacodec-copy")
|
||||
mpvCore?.setProperty("vo", "gpu")
|
||||
mpvCore?.setProperty("ao", "audiotrack")
|
||||
|
||||
// Forward user's buffer config to MPV fallback
|
||||
configuredBufferSizeBytes?.let { bytes ->
|
||||
if (bytes > 0) {
|
||||
mpvCore?.setProperty("demuxer-max-bytes", bytes.toString())
|
||||
}
|
||||
}
|
||||
|
||||
// Apply any pending MPV properties from Dart
|
||||
for ((propName, propValue) in pendingMpvProperties) {
|
||||
mpvCore?.setProperty(propName, propValue)
|
||||
}
|
||||
// Snapshot pending properties on main thread before clearing
|
||||
val pendingProps = pendingMpvProperties.toList()
|
||||
pendingMpvProperties.clear()
|
||||
|
||||
// Setup property observers
|
||||
mpvCore?.observeProperty("time-pos", "double")
|
||||
mpvCore?.observeProperty("duration", "double")
|
||||
mpvCore?.observeProperty("seekable", "flag")
|
||||
mpvCore?.observeProperty("pause", "flag")
|
||||
mpvCore?.observeProperty("paused-for-cache", "flag")
|
||||
mpvCore?.observeProperty("demuxer-cache-time", "double")
|
||||
mpvCore?.observeProperty("eof-reached", "flag")
|
||||
mpvCore?.observeProperty("track-list", "string")
|
||||
mpvCore?.observeProperty("aid", "string")
|
||||
mpvCore?.observeProperty("sid", "string")
|
||||
mpvCore?.observeProperty("volume", "double")
|
||||
mpvCore?.observeProperty("speed", "double")
|
||||
|
||||
// Show the MPV surface
|
||||
mpvCore?.setVisible(true)
|
||||
|
||||
// Load media at the same position
|
||||
val startSeconds = positionMs / 1000.0
|
||||
val options = mutableListOf<String>()
|
||||
options.add("start=$startSeconds")
|
||||
headers?.forEach { (key, value) ->
|
||||
options.add("http-header-fields-append=$key: $value")
|
||||
}
|
||||
val optionsStr = options.joinToString(",")
|
||||
// Convert content:// URIs to fdclose:// for MPV (SAF SD card downloads)
|
||||
// Compute content FD on main thread (needs contentResolver)
|
||||
val mpvUri = openContentFd(uri)?.let { "fdclose://$it" } ?: uri
|
||||
mpvCore?.command(arrayOf("loadfile", mpvUri, "replace", "-1", optionsStr))
|
||||
|
||||
// On GPUs without compute shaders, MPV can't do dynamic peak detection
|
||||
// and spline tone-mapping produces dim/washed-out results with extreme
|
||||
// static HDR peak metadata. Use reinhard which handles this better.
|
||||
val peakDetection = mpvCore?.getProperty("hdr-compute-peak")
|
||||
if (peakDetection == "no") {
|
||||
Log.i(TAG, "No compute shaders — overriding tone-mapping to reinhard")
|
||||
mpvCore?.setProperty("tone-mapping", "reinhard")
|
||||
mpvCore?.setProperty("tone-mapping-param", "0.7")
|
||||
mpvCore?.setProperty("tone-mapping-mode", "luma")
|
||||
// Buffer size for closure
|
||||
val bufferSize = configuredBufferSizeBytes
|
||||
|
||||
mpvCore?.runOnExecutor {
|
||||
// Configure basic MPV properties for Plex playback
|
||||
mpvCore?.setProperty("hwdec", "mediacodec,mediacodec-copy")
|
||||
mpvCore?.setProperty("vo", "gpu")
|
||||
mpvCore?.setProperty("ao", "audiotrack")
|
||||
|
||||
// Forward user's buffer config to MPV fallback
|
||||
if (bufferSize != null && bufferSize > 0) {
|
||||
mpvCore?.setProperty("demuxer-max-bytes", bufferSize.toString())
|
||||
}
|
||||
|
||||
// Apply pending MPV properties from Dart
|
||||
for ((propName, propValue) in pendingProps) {
|
||||
mpvCore?.setProperty(propName, propValue)
|
||||
}
|
||||
|
||||
// Setup property observers
|
||||
mpvCore?.observeProperty("time-pos", "double")
|
||||
mpvCore?.observeProperty("duration", "double")
|
||||
mpvCore?.observeProperty("seekable", "flag")
|
||||
mpvCore?.observeProperty("pause", "flag")
|
||||
mpvCore?.observeProperty("paused-for-cache", "flag")
|
||||
mpvCore?.observeProperty("demuxer-cache-time", "double")
|
||||
mpvCore?.observeProperty("eof-reached", "flag")
|
||||
mpvCore?.observeProperty("track-list", "string")
|
||||
mpvCore?.observeProperty("aid", "string")
|
||||
mpvCore?.observeProperty("sid", "string")
|
||||
mpvCore?.observeProperty("volume", "double")
|
||||
mpvCore?.observeProperty("speed", "double")
|
||||
|
||||
// Show the MPV surface (internally posts to UI)
|
||||
mpvCore?.setVisible(true)
|
||||
|
||||
// Load media at the same position
|
||||
val startSeconds = positionMs / 1000.0
|
||||
val options = mutableListOf<String>()
|
||||
options.add("start=$startSeconds")
|
||||
headers?.forEach { (key, value) ->
|
||||
options.add("http-header-fields-append=$key: $value")
|
||||
}
|
||||
val optionsStr = options.joinToString(",")
|
||||
mpvCore?.command(arrayOf("loadfile", mpvUri, "replace", "-1", optionsStr))
|
||||
|
||||
// On GPUs without compute shaders, MPV can't do dynamic peak detection
|
||||
// and spline tone-mapping produces dim/washed-out results with extreme
|
||||
// static HDR peak metadata. Use reinhard which handles this better.
|
||||
val peakDetection = mpvCore?.getProperty("hdr-compute-peak")
|
||||
if (peakDetection == "no") {
|
||||
Log.i(TAG, "No compute shaders — overriding tone-mapping to reinhard")
|
||||
mpvCore?.setProperty("tone-mapping", "reinhard")
|
||||
mpvCore?.setProperty("tone-mapping-param", "0.7")
|
||||
mpvCore?.setProperty("tone-mapping-mode", "luma")
|
||||
}
|
||||
|
||||
// Request audio focus
|
||||
mpvCore?.requestAudioFocus()
|
||||
|
||||
// Emit backend-switched event on main thread
|
||||
activity?.runOnUiThread {
|
||||
onEvent("backend-switched", null)
|
||||
}
|
||||
|
||||
Log.i(TAG, "Successfully switched to MPV fallback")
|
||||
}
|
||||
|
||||
// Request audio focus
|
||||
mpvCore?.requestAudioFocus()
|
||||
|
||||
// Emit backend-switched event so Flutter can show notification
|
||||
onEvent("backend-switched", null)
|
||||
|
||||
Log.i(TAG, "Successfully switched to MPV fallback")
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
fallbackInProgress = false
|
||||
|
||||
@@ -115,7 +115,7 @@ class MpvPlayerCore(private val activity: Activity) :
|
||||
}
|
||||
},
|
||||
isPaused = {
|
||||
try { MPVLib.getPropertyBoolean("pause") }
|
||||
try { MPVLib.getPropertyBoolean("pause") == true }
|
||||
catch (e: Exception) { true }
|
||||
}
|
||||
)
|
||||
@@ -124,7 +124,7 @@ class MpvPlayerCore(private val activity: Activity) :
|
||||
handler = handler,
|
||||
onDisplayChanged = {
|
||||
try {
|
||||
if (MPVLib.getPropertyBoolean("pause")) {
|
||||
if (MPVLib.getPropertyBoolean("pause") == true) {
|
||||
Log.d(TAG, "Display changed, resuming playback")
|
||||
MPVLib.setPropertyBoolean("pause", false)
|
||||
}
|
||||
@@ -361,15 +361,22 @@ class MpvPlayerCore(private val activity: Activity) :
|
||||
}
|
||||
|
||||
override fun event(eventId: Int) {
|
||||
val eventName = when (eventId) {
|
||||
MPVLib.MPV_EVENT_FILE_LOADED -> "file-loaded"
|
||||
MPVLib.MPV_EVENT_END_FILE -> "end-file"
|
||||
MPVLib.MPV_EVENT_PLAYBACK_RESTART -> "playback-restart"
|
||||
else -> null
|
||||
}
|
||||
eventName?.let { name ->
|
||||
activity.runOnUiThread {
|
||||
delegate?.onEvent(name, null)
|
||||
if (disposing) return
|
||||
when (eventId) {
|
||||
MPVLib.MPV_EVENT_END_FILE -> {
|
||||
val eofReached = try { MPVLib.getPropertyBoolean("eof-reached") == true } catch (_: Exception) { false }
|
||||
val data: Map<String, Any>? = if (eofReached) {
|
||||
mapOf("reason" to 0) // EOF
|
||||
} else {
|
||||
null // Could be stop, quit, or error — no way to distinguish from JNI
|
||||
}
|
||||
activity.runOnUiThread { delegate?.onEvent("end-file", data) }
|
||||
}
|
||||
MPVLib.MPV_EVENT_FILE_LOADED -> {
|
||||
activity.runOnUiThread { delegate?.onEvent("file-loaded", null) }
|
||||
}
|
||||
MPVLib.MPV_EVENT_PLAYBACK_RESTART -> {
|
||||
activity.runOnUiThread { delegate?.onEvent("playback-restart", null) }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -432,17 +439,22 @@ class MpvPlayerCore(private val activity: Activity) :
|
||||
* This prevents ANR when mpv_get_property blocks waiting for internal locks.
|
||||
*/
|
||||
fun getPropertyAsync(name: String, result: MethodChannel.Result) {
|
||||
if (!isInitialized) {
|
||||
if (!isInitialized || disposing) {
|
||||
result.success(null)
|
||||
return
|
||||
}
|
||||
commandExecutor.execute {
|
||||
try {
|
||||
val value = MPVLib.getPropertyString(name)
|
||||
activity.runOnUiThread { result.success(value) }
|
||||
} catch (e: Exception) {
|
||||
activity.runOnUiThread { result.success(null) }
|
||||
try {
|
||||
commandExecutor.execute {
|
||||
try {
|
||||
val value = MPVLib.getPropertyString(name)
|
||||
activity.runOnUiThread { result.success(value) }
|
||||
} catch (e: Exception) {
|
||||
activity.runOnUiThread { result.success(null) }
|
||||
}
|
||||
}
|
||||
} catch (e: java.util.concurrent.RejectedExecutionException) {
|
||||
Log.w(TAG, "getPropertyAsync rejected (executor shut down)")
|
||||
result.success(null)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -451,18 +463,23 @@ class MpvPlayerCore(private val activity: Activity) :
|
||||
* This prevents ANR when mpv_set_property blocks waiting for internal locks.
|
||||
*/
|
||||
fun setPropertyAsync(name: String, value: String, result: MethodChannel.Result) {
|
||||
if (!isInitialized) {
|
||||
if (!isInitialized || disposing) {
|
||||
result.success(null)
|
||||
return
|
||||
}
|
||||
commandExecutor.execute {
|
||||
try {
|
||||
MPVLib.setPropertyString(name, value)
|
||||
activity.runOnUiThread { result.success(null) }
|
||||
} catch (e: Exception) {
|
||||
Log.e(TAG, "Async setProperty failed: ${e.message}", e)
|
||||
activity.runOnUiThread { result.success(null) }
|
||||
try {
|
||||
commandExecutor.execute {
|
||||
try {
|
||||
MPVLib.setPropertyString(name, value)
|
||||
activity.runOnUiThread { result.success(null) }
|
||||
} catch (e: Exception) {
|
||||
Log.e(TAG, "Async setProperty failed: ${e.message}", e)
|
||||
activity.runOnUiThread { result.success(null) }
|
||||
}
|
||||
}
|
||||
} catch (e: java.util.concurrent.RejectedExecutionException) {
|
||||
Log.w(TAG, "setPropertyAsync rejected (executor shut down)")
|
||||
result.success(null)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -471,7 +488,7 @@ class MpvPlayerCore(private val activity: Activity) :
|
||||
* This prevents ANR when mpv_observe_property blocks waiting for internal locks.
|
||||
*/
|
||||
fun observePropertyAsync(name: String, format: String, result: MethodChannel.Result) {
|
||||
if (!isInitialized) {
|
||||
if (!isInitialized || disposing) {
|
||||
result.success(null)
|
||||
return
|
||||
}
|
||||
@@ -482,14 +499,19 @@ class MpvPlayerCore(private val activity: Activity) :
|
||||
"node" -> MPVLib.MPV_FORMAT_NODE
|
||||
else -> MPVLib.MPV_FORMAT_NONE
|
||||
}
|
||||
commandExecutor.execute {
|
||||
try {
|
||||
MPVLib.observeProperty(name, mpvFormat)
|
||||
activity.runOnUiThread { result.success(null) }
|
||||
} catch (e: Exception) {
|
||||
Log.e(TAG, "Async observeProperty failed: ${e.message}", e)
|
||||
activity.runOnUiThread { result.success(null) }
|
||||
try {
|
||||
commandExecutor.execute {
|
||||
try {
|
||||
MPVLib.observeProperty(name, mpvFormat)
|
||||
activity.runOnUiThread { result.success(null) }
|
||||
} catch (e: Exception) {
|
||||
Log.e(TAG, "Async observeProperty failed: ${e.message}", e)
|
||||
activity.runOnUiThread { result.success(null) }
|
||||
}
|
||||
}
|
||||
} catch (e: java.util.concurrent.RejectedExecutionException) {
|
||||
Log.w(TAG, "observePropertyAsync rejected (executor shut down)")
|
||||
result.success(null)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -498,7 +520,12 @@ class MpvPlayerCore(private val activity: Activity) :
|
||||
* Used by the plugin for I/O operations that shouldn't block the main thread.
|
||||
*/
|
||||
fun runOnExecutor(block: () -> Unit) {
|
||||
commandExecutor.execute(block)
|
||||
if (disposing) return
|
||||
try {
|
||||
commandExecutor.execute(block)
|
||||
} catch (e: java.util.concurrent.RejectedExecutionException) {
|
||||
Log.w(TAG, "runOnExecutor rejected (executor shut down)")
|
||||
}
|
||||
}
|
||||
|
||||
fun command(args: Array<String>) {
|
||||
@@ -512,23 +539,28 @@ class MpvPlayerCore(private val activity: Activity) :
|
||||
* The result is called back on the UI thread when the command completes.
|
||||
*/
|
||||
fun commandAsync(args: Array<String>, result: MethodChannel.Result) {
|
||||
if (!isInitialized || args.isEmpty()) {
|
||||
if (!isInitialized || disposing || args.isEmpty()) {
|
||||
result.success(null)
|
||||
return
|
||||
}
|
||||
|
||||
commandExecutor.execute {
|
||||
try {
|
||||
MPVLib.command(args)
|
||||
activity.runOnUiThread {
|
||||
result.success(null)
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
Log.e(TAG, "Async command failed: ${e.message}", e)
|
||||
activity.runOnUiThread {
|
||||
result.error("COMMAND_FAILED", e.message, null)
|
||||
try {
|
||||
commandExecutor.execute {
|
||||
try {
|
||||
MPVLib.command(args)
|
||||
activity.runOnUiThread {
|
||||
result.success(null)
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
Log.e(TAG, "Async command failed: ${e.message}", e)
|
||||
activity.runOnUiThread {
|
||||
result.error("COMMAND_FAILED", e.message, null)
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (e: java.util.concurrent.RejectedExecutionException) {
|
||||
Log.w(TAG, "commandAsync rejected (executor shut down)")
|
||||
result.success(null)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,11 +3,14 @@ package com.edde746.plezy.watchnext
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.content.pm.PackageManager
|
||||
import android.os.Handler
|
||||
import android.os.Looper
|
||||
import android.util.Log
|
||||
import androidx.tvprovider.media.tv.TvContractCompat
|
||||
import io.flutter.embedding.engine.plugins.FlutterPlugin
|
||||
import io.flutter.plugin.common.MethodCall
|
||||
import io.flutter.plugin.common.MethodChannel
|
||||
import java.util.concurrent.Executors
|
||||
|
||||
/**
|
||||
* Flutter plugin for Android TV Watch Next integration.
|
||||
@@ -37,6 +40,8 @@ class WatchNextPlugin : FlutterPlugin, MethodChannel.MethodCallHandler {
|
||||
private lateinit var methodChannel: MethodChannel
|
||||
private var applicationContext: Context? = null
|
||||
private var watchNextProvider: WatchNextProvider? = null
|
||||
private val ioExecutor by lazy { Executors.newSingleThreadExecutor() }
|
||||
private val mainHandler = Handler(Looper.getMainLooper())
|
||||
|
||||
override fun onAttachedToEngine(binding: FlutterPlugin.FlutterPluginBinding) {
|
||||
applicationContext = binding.applicationContext
|
||||
@@ -49,6 +54,7 @@ class WatchNextPlugin : FlutterPlugin, MethodChannel.MethodCallHandler {
|
||||
methodChannel.setMethodCallHandler(null)
|
||||
applicationContext = null
|
||||
watchNextProvider = null
|
||||
ioExecutor.shutdown()
|
||||
}
|
||||
|
||||
override fun onMethodCall(call: MethodCall, result: MethodChannel.Result) {
|
||||
@@ -85,7 +91,7 @@ class WatchNextPlugin : FlutterPlugin, MethodChannel.MethodCallHandler {
|
||||
}
|
||||
|
||||
val items = itemsData.mapNotNull { parseWatchNextItem(it) }
|
||||
result.success(provider.syncWatchNextPrograms(items))
|
||||
executeOnIo(result) { provider.syncWatchNextPrograms(items) }
|
||||
}
|
||||
|
||||
private fun handleClear(result: MethodChannel.Result) {
|
||||
@@ -94,7 +100,7 @@ class WatchNextPlugin : FlutterPlugin, MethodChannel.MethodCallHandler {
|
||||
result.error("NOT_INITIALIZED", "WatchNextProvider not initialized", null)
|
||||
return
|
||||
}
|
||||
result.success(provider.clearAll())
|
||||
executeOnIo(result) { provider.clearAll() }
|
||||
}
|
||||
|
||||
private fun handleRemove(call: MethodCall, result: MethodChannel.Result) {
|
||||
@@ -109,7 +115,23 @@ class WatchNextPlugin : FlutterPlugin, MethodChannel.MethodCallHandler {
|
||||
result.error("INVALID_ARGS", "Missing 'contentId' argument", null)
|
||||
return
|
||||
}
|
||||
result.success(provider.removeItem(contentId))
|
||||
executeOnIo(result) { provider.removeItem(contentId) }
|
||||
}
|
||||
|
||||
private fun executeOnIo(result: MethodChannel.Result, block: () -> Any?) {
|
||||
try {
|
||||
ioExecutor.execute {
|
||||
try {
|
||||
val value = block()
|
||||
mainHandler.post { result.success(value) }
|
||||
} catch (e: Exception) {
|
||||
Log.e(TAG, "IO operation failed: ${e.message}", e)
|
||||
mainHandler.post { result.error("IO_ERROR", e.message, null) }
|
||||
}
|
||||
}
|
||||
} catch (e: java.util.concurrent.RejectedExecutionException) {
|
||||
result.error("SHUTDOWN", "Plugin is shutting down", null)
|
||||
}
|
||||
}
|
||||
|
||||
private fun handleGetInitialDeepLink(result: MethodChannel.Result) {
|
||||
|
||||
@@ -20,9 +20,10 @@ platform :android do
|
||||
end
|
||||
|
||||
debug_info_dir = "./debug-info/#{version_name}+#{version_code}"
|
||||
git_commit = `git rev-parse --short HEAD`.strip
|
||||
|
||||
# Build the Flutter app
|
||||
sh("cd #{ENV['PWD']}/.. && flutter build appbundle --dart-define=ENABLE_IN_APP_REVIEW=true --dart-define=ENABLE_SENTRY=true --obfuscate --split-debug-info=#{debug_info_dir}/aab")
|
||||
sh("cd #{ENV['PWD']}/.. && flutter build appbundle --dart-define=ENABLE_IN_APP_REVIEW=true --dart-define=ENABLE_SENTRY=true --dart-define=GIT_COMMIT=#{git_commit} --obfuscate --split-debug-info=#{debug_info_dir}/aab")
|
||||
|
||||
upload_to_play_store(
|
||||
track: "production",
|
||||
@@ -32,7 +33,7 @@ platform :android do
|
||||
)
|
||||
|
||||
# Build universal APK for Amazon Appstore (doesn't accept AABs, excludes x86 via env var)
|
||||
sh("cd #{ENV['PWD']}/.. && AMAZON=1 flutter build apk --release --dart-define=ENABLE_SENTRY=true --obfuscate --split-debug-info=#{debug_info_dir}/apk")
|
||||
sh("cd #{ENV['PWD']}/.. && AMAZON=1 flutter build apk --release --dart-define=ENABLE_SENTRY=true --dart-define=GIT_COMMIT=#{git_commit} --obfuscate --split-debug-info=#{debug_info_dir}/apk")
|
||||
|
||||
upload_to_amazon_appstore(
|
||||
apk_paths: [
|
||||
|
||||
@@ -6,8 +6,10 @@ default_platform(:ios)
|
||||
platform :ios do
|
||||
desc "Build and deploy to App Store"
|
||||
lane :deploy_appstore do
|
||||
git_commit = `git rev-parse --short HEAD`.strip
|
||||
|
||||
# Build the Flutter app
|
||||
sh("cd #{ENV['PWD']}/.. && flutter build ipa --dart-define=ENABLE_IN_APP_REVIEW=true --dart-define=ENABLE_SENTRY=true")
|
||||
sh("cd #{ENV['PWD']}/.. && flutter build ipa --dart-define=ENABLE_IN_APP_REVIEW=true --dart-define=ENABLE_SENTRY=true --dart-define=GIT_COMMIT=#{git_commit}")
|
||||
|
||||
# Upload to App Store
|
||||
upload_to_app_store(
|
||||
|
||||
+1146
-409
File diff suppressed because it is too large
Load Diff
@@ -1,13 +1,19 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
|
||||
import 'dpad_navigator.dart';
|
||||
import 'key_event_utils.dart';
|
||||
|
||||
/// Callbacks for chip key event handling.
|
||||
class ChipKeyCallbacks {
|
||||
/// Called when SELECT key is pressed.
|
||||
/// Called when SELECT key is pressed (short press when [onLongPress] is set).
|
||||
final VoidCallback? onSelect;
|
||||
|
||||
/// Called when SELECT key is held for 500ms.
|
||||
final VoidCallback? onLongPress;
|
||||
|
||||
/// Called when DOWN arrow is pressed.
|
||||
final VoidCallback? onNavigateDown;
|
||||
|
||||
@@ -25,6 +31,7 @@ class ChipKeyCallbacks {
|
||||
|
||||
const ChipKeyCallbacks({
|
||||
this.onSelect,
|
||||
this.onLongPress,
|
||||
this.onNavigateDown,
|
||||
this.onNavigateUp,
|
||||
this.onNavigateLeft,
|
||||
@@ -53,6 +60,8 @@ class ChipKeyCallbacks {
|
||||
mixin FocusableChipStateMixin<T extends StatefulWidget> on State<T> {
|
||||
FocusNode? _internalFocusNode;
|
||||
bool _isFocused = false;
|
||||
Timer? _longPressTimer;
|
||||
bool _isSelectKeyDown = false;
|
||||
|
||||
/// Override to return the widget's optional external focus node.
|
||||
FocusNode? get widgetFocusNode;
|
||||
@@ -85,6 +94,7 @@ mixin FocusableChipStateMixin<T extends StatefulWidget> on State<T> {
|
||||
void disposeFocusNode() {
|
||||
focusNode.removeListener(_onFocusChange);
|
||||
_internalFocusNode?.dispose();
|
||||
_longPressTimer?.cancel();
|
||||
}
|
||||
|
||||
void _onFocusChange() {
|
||||
@@ -96,7 +106,7 @@ mixin FocusableChipStateMixin<T extends StatefulWidget> on State<T> {
|
||||
/// Shared key event handler for chip widgets.
|
||||
///
|
||||
/// Handles common key patterns:
|
||||
/// - SELECT key -> onSelect
|
||||
/// - SELECT key -> onSelect (short press) / onLongPress (hold 500ms)
|
||||
/// - Arrow keys -> navigation callbacks
|
||||
/// - BACK key -> onBack
|
||||
///
|
||||
@@ -112,16 +122,53 @@ mixin FocusableChipStateMixin<T extends StatefulWidget> on State<T> {
|
||||
}
|
||||
}
|
||||
|
||||
if (!event.isActionable) {
|
||||
return KeyEventResult.ignored;
|
||||
if (SelectKeyUpSuppressor.consumeIfSuppressed(event)) {
|
||||
return KeyEventResult.handled;
|
||||
}
|
||||
|
||||
// SELECT key activates the chip
|
||||
if (key.isSelectKey && callbacks.onSelect != null) {
|
||||
callbacks.onSelect!();
|
||||
// SELECT key with long press support
|
||||
if (key.isSelectKey) {
|
||||
if (callbacks.onLongPress != null) {
|
||||
if (event is KeyDownEvent) {
|
||||
if (!_isSelectKeyDown) {
|
||||
_isSelectKeyDown = true;
|
||||
_longPressTimer?.cancel();
|
||||
_longPressTimer = Timer(const Duration(milliseconds: 500), () {
|
||||
if (mounted) {
|
||||
SelectKeyUpSuppressor.suppressSelectUntilKeyUp();
|
||||
callbacks.onLongPress?.call();
|
||||
}
|
||||
});
|
||||
}
|
||||
return KeyEventResult.handled;
|
||||
} else if (event is KeyRepeatEvent) {
|
||||
return KeyEventResult.handled;
|
||||
} else if (event is KeyUpEvent) {
|
||||
final timerWasActive = _longPressTimer?.isActive ?? false;
|
||||
_longPressTimer?.cancel();
|
||||
if (timerWasActive && _isSelectKeyDown) {
|
||||
callbacks.onSelect?.call();
|
||||
}
|
||||
_isSelectKeyDown = false;
|
||||
return KeyEventResult.handled;
|
||||
}
|
||||
} else if (event.isActionable && callbacks.onSelect != null) {
|
||||
callbacks.onSelect!();
|
||||
return KeyEventResult.handled;
|
||||
}
|
||||
}
|
||||
|
||||
// Context menu key triggers long press directly
|
||||
if (event.isActionable && key.isContextMenuKey && callbacks.onLongPress != null) {
|
||||
SelectKeyUpSuppressor.suppressSelectUntilKeyUp();
|
||||
callbacks.onLongPress!();
|
||||
return KeyEventResult.handled;
|
||||
}
|
||||
|
||||
if (!event.isActionable) {
|
||||
return KeyEventResult.ignored;
|
||||
}
|
||||
|
||||
// LEFT arrow - call callback if provided, otherwise propagate to parent
|
||||
if (key.isLeftKey) {
|
||||
if (callbacks.onNavigateLeft != null) {
|
||||
|
||||
@@ -240,7 +240,15 @@ class _FocusableWrapperState extends State<FocusableWrapper> with SingleTickerPr
|
||||
final renderObject = context.findRenderObject();
|
||||
if (renderObject == null) return;
|
||||
|
||||
final scrollable = Scrollable.maybeOf(context);
|
||||
// Find the nearest scrollable that actually has scroll range.
|
||||
// Skip inner scrollables with no extent (e.g. shrinkWrap ListView
|
||||
// with NeverScrollableScrollPhysics inside an outer scroll view).
|
||||
var scrollable = Scrollable.maybeOf(context);
|
||||
while (scrollable != null) {
|
||||
final pos = scrollable.position;
|
||||
if (pos.maxScrollExtent > pos.minScrollExtent) break;
|
||||
scrollable = Scrollable.maybeOf(scrollable.context);
|
||||
}
|
||||
if (scrollable == null) return;
|
||||
|
||||
final viewport = scrollable.context.findRenderObject() as RenderBox?;
|
||||
|
||||
@@ -97,6 +97,11 @@
|
||||
"autoSkipCreditsDescription": "Spring automatisk rulletekster over og afspil næste episode",
|
||||
"autoSkipDelay": "Auto-spring forsinkelse",
|
||||
"autoSkipDelayDescription": "Vent ${seconds} sekunder før automatisk spring",
|
||||
"introPattern": "Intromarkørmønster",
|
||||
"introPatternDescription": "Regulært udtryk til at genkende intromarkører i kapiteltitler",
|
||||
"creditsPattern": "Rulletekstmarkørmønster",
|
||||
"creditsPatternDescription": "Regulært udtryk til at genkende rulletekstmarkører i kapiteltitler",
|
||||
"invalidRegex": "Ugyldigt regulært udtryk",
|
||||
"downloads": "Downloads", "downloadLocationDescription": "Vælg hvor downloadet indhold skal gemmes",
|
||||
"downloadLocationDefault": "Standard (App-lagring)", "downloadLocationCustom": "Brugerdefineret placering",
|
||||
"selectFolder": "Vælg mappe", "resetToDefault": "Nulstil til standard",
|
||||
@@ -295,7 +300,7 @@
|
||||
"noCollections": "Ingen samlinger i dette bibliotek",
|
||||
"noFoldersFound": "Ingen mapper fundet", "folders": "mapper",
|
||||
"tabs": { "recommended": "Anbefalet", "browse": "Gennemse", "collections": "Samlinger", "playlists": "Playlister" },
|
||||
"groupings": { "all": "Alle", "movies": "Film", "shows": "TV-serier", "seasons": "Sæsoner", "episodes": "Episoder", "folders": "Mapper" }
|
||||
"groupings": { "title": "Gruppering", "all": "Alle", "movies": "Film", "shows": "TV-serier", "seasons": "Sæsoner", "episodes": "Episoder", "folders": "Mapper" }
|
||||
},
|
||||
"about": {
|
||||
"title": "Om", "openSourceLicenses": "Open source-licenser", "versionLabel": "Version ${version}",
|
||||
|
||||
@@ -178,6 +178,11 @@
|
||||
"autoSkipCreditsDescription": "Abspann automatisch überspringen und nächste Episode abspielen",
|
||||
"autoSkipDelay": "Verzögerung für automatisches Überspringen",
|
||||
"autoSkipDelayDescription": "${seconds} Sekunden vor dem automatischen Überspringen warten",
|
||||
"introPattern": "Intro-Markierungsmuster",
|
||||
"introPatternDescription": "Regulärer Ausdruck zum Erkennen von Intro-Markierungen in Kapiteltiteln",
|
||||
"creditsPattern": "Abspann-Markierungsmuster",
|
||||
"creditsPatternDescription": "Regulärer Ausdruck zum Erkennen von Abspann-Markierungen in Kapiteltiteln",
|
||||
"invalidRegex": "Ungültiger regulärer Ausdruck",
|
||||
"downloads": "Downloads",
|
||||
"downloadLocationDescription": "Speicherort für heruntergeladene Inhalte wählen",
|
||||
"downloadLocationDefault": "Standard (App-Speicher)",
|
||||
@@ -514,6 +519,7 @@
|
||||
"playlists": "Wiedergabelisten"
|
||||
},
|
||||
"groupings": {
|
||||
"title": "Gruppierung",
|
||||
"all": "Alle",
|
||||
"movies": "Filme",
|
||||
"shows": "Serien",
|
||||
|
||||
@@ -178,6 +178,11 @@
|
||||
"autoSkipCreditsDescription": "Automatically skip credits and play next episode",
|
||||
"autoSkipDelay": "Auto Skip Delay",
|
||||
"autoSkipDelayDescription": "Wait ${seconds} seconds before auto-skipping",
|
||||
"introPattern": "Intro Marker Pattern",
|
||||
"introPatternDescription": "Regex pattern to match intro markers in chapter titles",
|
||||
"creditsPattern": "Credits Marker Pattern",
|
||||
"creditsPatternDescription": "Regex pattern to match credits markers in chapter titles",
|
||||
"invalidRegex": "Invalid regular expression",
|
||||
"downloads": "Downloads",
|
||||
"downloadLocationDescription": "Choose where to store downloaded content",
|
||||
"downloadLocationDefault": "Default (App Storage)",
|
||||
@@ -514,6 +519,7 @@
|
||||
"playlists": "Playlists"
|
||||
},
|
||||
"groupings": {
|
||||
"title": "Grouping",
|
||||
"all": "All",
|
||||
"movies": "Movies",
|
||||
"shows": "TV Shows",
|
||||
|
||||
@@ -178,6 +178,11 @@
|
||||
"autoSkipCreditsDescription": "Saltar automáticamente los créditos y reproducir el siguiente episodio",
|
||||
"autoSkipDelay": "Retraso de Salto automático",
|
||||
"autoSkipDelayDescription": "Esperar ${seconds} segundos antes de saltar automáticamente",
|
||||
"introPattern": "Patrón de marcador de intro",
|
||||
"introPatternDescription": "Expresión regular para reconocer marcadores de intro en los títulos de capítulos",
|
||||
"creditsPattern": "Patrón de marcador de créditos",
|
||||
"creditsPatternDescription": "Expresión regular para reconocer marcadores de créditos en los títulos de capítulos",
|
||||
"invalidRegex": "Expresión regular no válida",
|
||||
"downloads": "Descargas",
|
||||
"downloadLocationDescription": "Elegir dónde almacenar el contenido descargado",
|
||||
"downloadLocationDefault": "Predeterminado (Almacenamiento de la App)",
|
||||
@@ -514,6 +519,7 @@
|
||||
"playlists": "Listas"
|
||||
},
|
||||
"groupings": {
|
||||
"title": "Agrupación",
|
||||
"all": "Todo",
|
||||
"movies": "Películas",
|
||||
"shows": "Series",
|
||||
|
||||
@@ -178,6 +178,11 @@
|
||||
"autoSkipCreditsDescription": "Passer les crédits et passer à l'épisode suivant automatiquement",
|
||||
"autoSkipDelay": "Délai avant skip automatique",
|
||||
"autoSkipDelayDescription": "Attendre ${seconds} secondes avant l'auto-skip",
|
||||
"introPattern": "Modèle de marqueur d'intro",
|
||||
"introPatternDescription": "Expression régulière pour reconnaître les marqueurs d'intro dans les titres de chapitres",
|
||||
"creditsPattern": "Modèle de marqueur de générique",
|
||||
"creditsPatternDescription": "Expression régulière pour reconnaître les marqueurs de générique dans les titres de chapitres",
|
||||
"invalidRegex": "Expression régulière invalide",
|
||||
"downloads": "Téléchargement",
|
||||
"downloadLocationDescription": "Choisissez où stocker le contenu téléchargé",
|
||||
"downloadLocationDefault": "Par défaut (stockage de l'application)",
|
||||
@@ -514,6 +519,7 @@
|
||||
"playlists": "Playlists"
|
||||
},
|
||||
"groupings": {
|
||||
"title": "Regroupement",
|
||||
"all": "Tous",
|
||||
"movies": "Films",
|
||||
"shows": "Show TV",
|
||||
|
||||
@@ -178,6 +178,11 @@
|
||||
"autoSkipCreditsDescription": "Salta automaticamente i crediti e riproduci l'episodio successivo",
|
||||
"autoSkipDelay": "Ritardo Salto Automatico",
|
||||
"autoSkipDelayDescription": "Aspetta ${seconds} secondi prima del salto automatico",
|
||||
"introPattern": "Pattern marcatore intro",
|
||||
"introPatternDescription": "Espressione regolare per riconoscere i marcatori intro nei titoli dei capitoli",
|
||||
"creditsPattern": "Pattern marcatore titoli di coda",
|
||||
"creditsPatternDescription": "Espressione regolare per riconoscere i marcatori dei titoli di coda nei capitoli",
|
||||
"invalidRegex": "Espressione regolare non valida",
|
||||
"downloads": "Download",
|
||||
"downloadLocationDescription": "Scegli dove salvare i contenuti scaricati",
|
||||
"downloadLocationDefault": "Predefinita (Archiviazione App)",
|
||||
@@ -514,6 +519,7 @@
|
||||
"playlists": "Playlist"
|
||||
},
|
||||
"groupings": {
|
||||
"title": "Raggruppamento",
|
||||
"all": "Tutti",
|
||||
"movies": "Film",
|
||||
"shows": "Serie TV",
|
||||
|
||||
@@ -178,6 +178,11 @@
|
||||
"autoSkipCreditsDescription": "クレジットを自動的にスキップして次のエピソードを再生",
|
||||
"autoSkipDelay": "自動スキップの遅延",
|
||||
"autoSkipDelayDescription": "自動スキップまで${seconds}秒待機",
|
||||
"introPattern": "イントロマーカーパターン",
|
||||
"introPatternDescription": "チャプタータイトルのイントロマーカーに一致する正規表現パターン",
|
||||
"creditsPattern": "クレジットマーカーパターン",
|
||||
"creditsPatternDescription": "チャプタータイトルのクレジットマーカーに一致する正規表現パターン",
|
||||
"invalidRegex": "無効な正規表現",
|
||||
"downloads": "ダウンロード",
|
||||
"downloadLocationDescription": "ダウンロードコンテンツの保存場所を選択",
|
||||
"downloadLocationDefault": "デフォルト(アプリストレージ)",
|
||||
@@ -514,6 +519,7 @@
|
||||
"playlists": "プレイリスト"
|
||||
},
|
||||
"groupings": {
|
||||
"title": "グループ",
|
||||
"all": "すべて",
|
||||
"movies": "映画",
|
||||
"shows": "テレビ番組",
|
||||
|
||||
@@ -178,6 +178,11 @@
|
||||
"autoSkipCreditsDescription": "엔딩 크레딧 자동 건너뛰기 후 다음 에피소드 재생",
|
||||
"autoSkipDelay": "자동 건너뛰기 지연",
|
||||
"autoSkipDelayDescription": "자동 건너뛰기 전 ${seconds} 초 대기",
|
||||
"introPattern": "인트로 마커 패턴",
|
||||
"introPatternDescription": "챕터 제목에서 인트로 마커를 인식하는 정규식 패턴",
|
||||
"creditsPattern": "크레딧 마커 패턴",
|
||||
"creditsPatternDescription": "챕터 제목에서 크레딧 마커를 인식하는 정규식 패턴",
|
||||
"invalidRegex": "잘못된 정규식",
|
||||
"downloads": "다운로드",
|
||||
"downloadLocationDescription": "다운로드 콘텐츠 저장 위치 선택",
|
||||
"downloadLocationDefault": "기본값 (앱 저장소)",
|
||||
@@ -514,6 +519,7 @@
|
||||
"playlists": "재생 목록"
|
||||
},
|
||||
"groupings": {
|
||||
"title": "그룹",
|
||||
"all": "전체",
|
||||
"movies": "영화",
|
||||
"shows": "TV 프로그램",
|
||||
|
||||
@@ -178,6 +178,11 @@
|
||||
"autoSkipCreditsDescription": "Hopp automatisk over rulletekst og spill neste episode",
|
||||
"autoSkipDelay": "Forsinkelse for automatisk hopp",
|
||||
"autoSkipDelayDescription": "Vent ${seconds} sekunder før automatisk hopping",
|
||||
"introPattern": "Intromarkørmønster",
|
||||
"introPatternDescription": "Regulært uttrykk for å gjenkjenne intromarkører i kapitteltitler",
|
||||
"creditsPattern": "Rulletekstmarkørmønster",
|
||||
"creditsPatternDescription": "Regulært uttrykk for å gjenkjenne rulletekstmarkører i kapitteltitler",
|
||||
"invalidRegex": "Ugyldig regulært uttrykk",
|
||||
"downloads": "Nedlastinger",
|
||||
"downloadLocationDescription": "Velg hvor nedlastet innhold skal lagres",
|
||||
"downloadLocationDefault": "Standard (App-lagring)",
|
||||
@@ -514,6 +519,7 @@
|
||||
"playlists": "Spillelister"
|
||||
},
|
||||
"groupings": {
|
||||
"title": "Gruppering",
|
||||
"all": "Alle",
|
||||
"movies": "Filmer",
|
||||
"shows": "TV-serier",
|
||||
|
||||
@@ -178,6 +178,11 @@
|
||||
"autoSkipCreditsDescription": "Credits automatisch overslaan en volgende aflevering afspelen",
|
||||
"autoSkipDelay": "Vertraging Automatisch Overslaan",
|
||||
"autoSkipDelayDescription": "${seconds} seconden wachten voor automatisch overslaan",
|
||||
"introPattern": "Intromarkeringspatroon",
|
||||
"introPatternDescription": "Reguliere expressie om intromarkeringen in hoofdstuktitels te herkennen",
|
||||
"creditsPattern": "Aftitelingmarkeringspatroon",
|
||||
"creditsPatternDescription": "Reguliere expressie om aftitelingmarkeringen in hoofdstuktitels te herkennen",
|
||||
"invalidRegex": "Ongeldige reguliere expressie",
|
||||
"downloads": "Downloads",
|
||||
"downloadLocationDescription": "Kies waar gedownloade content wordt opgeslagen",
|
||||
"downloadLocationDefault": "Standaard (App-opslag)",
|
||||
@@ -514,6 +519,7 @@
|
||||
"playlists": "Afspeellijsten"
|
||||
},
|
||||
"groupings": {
|
||||
"title": "Groepering",
|
||||
"all": "Alles",
|
||||
"movies": "Films",
|
||||
"shows": "Series",
|
||||
|
||||
@@ -178,6 +178,11 @@
|
||||
"autoSkipCreditsDescription": "Automatycznie pomijaj napisy końcowe i odtwórz następny odcinek",
|
||||
"autoSkipDelay": "Opóźnienie automatycznego pomijania",
|
||||
"autoSkipDelayDescription": "Czekaj ${seconds} sekund przed automatycznym pominięciem",
|
||||
"introPattern": "Wzorzec znacznika intro",
|
||||
"introPatternDescription": "Wyrażenie regularne do rozpoznawania znaczników intro w tytułach rozdziałów",
|
||||
"creditsPattern": "Wzorzec znacznika napisów końcowych",
|
||||
"creditsPatternDescription": "Wyrażenie regularne do rozpoznawania znaczników napisów końcowych w tytułach rozdziałów",
|
||||
"invalidRegex": "Nieprawidłowe wyrażenie regularne",
|
||||
"downloads": "Pobrania",
|
||||
"downloadLocationDescription": "Wybierz miejsce przechowywania pobranych treści",
|
||||
"downloadLocationDefault": "Domyślne (Pamięć aplikacji)",
|
||||
@@ -514,6 +519,7 @@
|
||||
"playlists": "Playlisty"
|
||||
},
|
||||
"groupings": {
|
||||
"title": "Grupowanie",
|
||||
"all": "Wszystkie",
|
||||
"movies": "Filmy",
|
||||
"shows": "Seriale TV",
|
||||
|
||||
@@ -178,6 +178,11 @@
|
||||
"autoSkipCreditsDescription": "Pular créditos automaticamente e reproduzir próximo episódio",
|
||||
"autoSkipDelay": "Atraso do Pulo Automático",
|
||||
"autoSkipDelayDescription": "Aguardar ${seconds} segundos antes de pular automaticamente",
|
||||
"introPattern": "Padrão de marcador de intro",
|
||||
"introPatternDescription": "Expressão regular para corresponder marcadores de intro nos títulos dos capítulos",
|
||||
"creditsPattern": "Padrão de marcador de créditos",
|
||||
"creditsPatternDescription": "Expressão regular para corresponder marcadores de créditos nos títulos dos capítulos",
|
||||
"invalidRegex": "Expressão regular inválida",
|
||||
"downloads": "Downloads",
|
||||
"downloadLocationDescription": "Escolha onde armazenar conteúdo baixado",
|
||||
"downloadLocationDefault": "Padrão (Armazenamento do App)",
|
||||
@@ -514,6 +519,7 @@
|
||||
"playlists": "Playlists"
|
||||
},
|
||||
"groupings": {
|
||||
"title": "Agrupamento",
|
||||
"all": "Todos",
|
||||
"movies": "Filmes",
|
||||
"shows": "Séries de TV",
|
||||
|
||||
@@ -178,6 +178,11 @@
|
||||
"autoSkipCreditsDescription": "Автоматически пропускать титры и воспроизводить следующий эпизод",
|
||||
"autoSkipDelay": "Задержка автопропуска",
|
||||
"autoSkipDelayDescription": "Подождать ${seconds} секунд перед автопропуском",
|
||||
"introPattern": "Шаблон маркера вступления",
|
||||
"introPatternDescription": "Регулярное выражение для распознавания маркеров вступления в заголовках глав",
|
||||
"creditsPattern": "Шаблон маркера титров",
|
||||
"creditsPatternDescription": "Регулярное выражение для распознавания маркеров титров в заголовках глав",
|
||||
"invalidRegex": "Недопустимое регулярное выражение",
|
||||
"downloads": "Загрузки",
|
||||
"downloadLocationDescription": "Выберите место для хранения загруженного контента",
|
||||
"downloadLocationDefault": "По умолчанию (Хранилище приложения)",
|
||||
@@ -514,6 +519,7 @@
|
||||
"playlists": "Плейлисты"
|
||||
},
|
||||
"groupings": {
|
||||
"title": "Группировка",
|
||||
"all": "Все",
|
||||
"movies": "Фильмы",
|
||||
"shows": "Сериалы",
|
||||
|
||||
@@ -4,9 +4,9 @@
|
||||
/// To regenerate, run: `dart run slang`
|
||||
///
|
||||
/// Locales: 15
|
||||
/// Strings: 12105 (807 per locale)
|
||||
/// Strings: 12195 (813 per locale)
|
||||
///
|
||||
/// Built on 2026-03-10 at 00:19 UTC
|
||||
/// Built on 2026-03-13 at 05:11 UTC
|
||||
|
||||
// coverage:ignore-file
|
||||
// ignore_for_file: type=lint, unused_import
|
||||
|
||||
@@ -297,6 +297,11 @@ class _TranslationsSettingsDa implements TranslationsSettingsEn {
|
||||
@override String get autoSkipCreditsDescription => 'Spring automatisk rulletekster over og afspil næste episode';
|
||||
@override String get autoSkipDelay => 'Auto-spring forsinkelse';
|
||||
@override String autoSkipDelayDescription({required Object seconds}) => 'Vent ${seconds} sekunder før automatisk spring';
|
||||
@override String get introPattern => 'Intromarkørmønster';
|
||||
@override String get introPatternDescription => 'Regulært udtryk til at genkende intromarkører i kapiteltitler';
|
||||
@override String get creditsPattern => 'Rulletekstmarkørmønster';
|
||||
@override String get creditsPatternDescription => 'Regulært udtryk til at genkende rulletekstmarkører i kapiteltitler';
|
||||
@override String get invalidRegex => 'Ugyldigt regulært udtryk';
|
||||
@override String get downloads => 'Downloads';
|
||||
@override String get downloadLocationDescription => 'Vælg hvor downloadet indhold skal gemmes';
|
||||
@override String get downloadLocationDefault => 'Standard (App-lagring)';
|
||||
@@ -1192,6 +1197,7 @@ class _TranslationsLibrariesGroupingsDa implements TranslationsLibrariesGrouping
|
||||
final TranslationsDa _root; // ignore: unused_field
|
||||
|
||||
// Translations
|
||||
@override String get title => 'Gruppering';
|
||||
@override String get all => 'Alle';
|
||||
@override String get movies => 'Film';
|
||||
@override String get shows => 'TV-serier';
|
||||
@@ -1472,6 +1478,11 @@ extension on TranslationsDa {
|
||||
'settings.autoSkipCreditsDescription' => 'Spring automatisk rulletekster over og afspil næste episode',
|
||||
'settings.autoSkipDelay' => 'Auto-spring forsinkelse',
|
||||
'settings.autoSkipDelayDescription' => ({required Object seconds}) => 'Vent ${seconds} sekunder før automatisk spring',
|
||||
'settings.introPattern' => 'Intromarkørmønster',
|
||||
'settings.introPatternDescription' => 'Regulært udtryk til at genkende intromarkører i kapiteltitler',
|
||||
'settings.creditsPattern' => 'Rulletekstmarkørmønster',
|
||||
'settings.creditsPatternDescription' => 'Regulært udtryk til at genkende rulletekstmarkører i kapiteltitler',
|
||||
'settings.invalidRegex' => 'Ugyldigt regulært udtryk',
|
||||
'settings.downloads' => 'Downloads',
|
||||
'settings.downloadLocationDescription' => 'Vælg hvor downloadet indhold skal gemmes',
|
||||
'settings.downloadLocationDefault' => 'Standard (App-lagring)',
|
||||
@@ -1769,6 +1780,7 @@ extension on TranslationsDa {
|
||||
'libraries.tabs.browse' => 'Gennemse',
|
||||
'libraries.tabs.collections' => 'Samlinger',
|
||||
'libraries.tabs.playlists' => 'Playlister',
|
||||
'libraries.groupings.title' => 'Gruppering',
|
||||
'libraries.groupings.all' => 'Alle',
|
||||
'libraries.groupings.movies' => 'Film',
|
||||
'libraries.groupings.shows' => 'TV-serier',
|
||||
@@ -1810,14 +1822,14 @@ extension on TranslationsDa {
|
||||
'liveTv.nowPlaying' => 'Afspiller nu',
|
||||
'liveTv.noPrograms' => 'Ingen programdata tilgængelig',
|
||||
'liveTv.channelNumber' => ({required Object number}) => 'Kn. ${number}',
|
||||
_ => null,
|
||||
} ?? switch (path) {
|
||||
'liveTv.live' => 'LIVE',
|
||||
'liveTv.hd' => 'HD',
|
||||
'liveTv.premiere' => 'NY',
|
||||
'liveTv.reloadGuide' => 'Genindlæs guide',
|
||||
'liveTv.allChannels' => 'Alle kanaler',
|
||||
'liveTv.now' => 'Nu',
|
||||
_ => null,
|
||||
} ?? switch (path) {
|
||||
'liveTv.today' => 'I dag',
|
||||
'liveTv.midnight' => 'Midnat',
|
||||
'liveTv.overnight' => 'Nat',
|
||||
|
||||
@@ -297,6 +297,11 @@ class _TranslationsSettingsDe implements TranslationsSettingsEn {
|
||||
@override String get autoSkipCreditsDescription => 'Abspann automatisch überspringen und nächste Episode abspielen';
|
||||
@override String get autoSkipDelay => 'Verzögerung für automatisches Überspringen';
|
||||
@override String autoSkipDelayDescription({required Object seconds}) => '${seconds} Sekunden vor dem automatischen Überspringen warten';
|
||||
@override String get introPattern => 'Intro-Markierungsmuster';
|
||||
@override String get introPatternDescription => 'Regulärer Ausdruck zum Erkennen von Intro-Markierungen in Kapiteltiteln';
|
||||
@override String get creditsPattern => 'Abspann-Markierungsmuster';
|
||||
@override String get creditsPatternDescription => 'Regulärer Ausdruck zum Erkennen von Abspann-Markierungen in Kapiteltiteln';
|
||||
@override String get invalidRegex => 'Ungültiger regulärer Ausdruck';
|
||||
@override String get downloads => 'Downloads';
|
||||
@override String get downloadLocationDescription => 'Speicherort für heruntergeladene Inhalte wählen';
|
||||
@override String get downloadLocationDefault => 'Standard (App-Speicher)';
|
||||
@@ -1192,6 +1197,7 @@ class _TranslationsLibrariesGroupingsDe implements TranslationsLibrariesGrouping
|
||||
final TranslationsDe _root; // ignore: unused_field
|
||||
|
||||
// Translations
|
||||
@override String get title => 'Gruppierung';
|
||||
@override String get all => 'Alle';
|
||||
@override String get movies => 'Filme';
|
||||
@override String get shows => 'Serien';
|
||||
@@ -1472,6 +1478,11 @@ extension on TranslationsDe {
|
||||
'settings.autoSkipCreditsDescription' => 'Abspann automatisch überspringen und nächste Episode abspielen',
|
||||
'settings.autoSkipDelay' => 'Verzögerung für automatisches Überspringen',
|
||||
'settings.autoSkipDelayDescription' => ({required Object seconds}) => '${seconds} Sekunden vor dem automatischen Überspringen warten',
|
||||
'settings.introPattern' => 'Intro-Markierungsmuster',
|
||||
'settings.introPatternDescription' => 'Regulärer Ausdruck zum Erkennen von Intro-Markierungen in Kapiteltiteln',
|
||||
'settings.creditsPattern' => 'Abspann-Markierungsmuster',
|
||||
'settings.creditsPatternDescription' => 'Regulärer Ausdruck zum Erkennen von Abspann-Markierungen in Kapiteltiteln',
|
||||
'settings.invalidRegex' => 'Ungültiger regulärer Ausdruck',
|
||||
'settings.downloads' => 'Downloads',
|
||||
'settings.downloadLocationDescription' => 'Speicherort für heruntergeladene Inhalte wählen',
|
||||
'settings.downloadLocationDefault' => 'Standard (App-Speicher)',
|
||||
@@ -1769,6 +1780,7 @@ extension on TranslationsDe {
|
||||
'libraries.tabs.browse' => 'Durchsuchen',
|
||||
'libraries.tabs.collections' => 'Sammlungen',
|
||||
'libraries.tabs.playlists' => 'Wiedergabelisten',
|
||||
'libraries.groupings.title' => 'Gruppierung',
|
||||
'libraries.groupings.all' => 'Alle',
|
||||
'libraries.groupings.movies' => 'Filme',
|
||||
'libraries.groupings.shows' => 'Serien',
|
||||
@@ -1810,14 +1822,14 @@ extension on TranslationsDe {
|
||||
'liveTv.nowPlaying' => 'Läuft gerade',
|
||||
'liveTv.noPrograms' => 'Keine Programmdaten verfügbar',
|
||||
'liveTv.channelNumber' => ({required Object number}) => 'Kanal ${number}',
|
||||
_ => null,
|
||||
} ?? switch (path) {
|
||||
'liveTv.live' => 'LIVE',
|
||||
'liveTv.hd' => 'HD',
|
||||
'liveTv.premiere' => 'NEU',
|
||||
'liveTv.reloadGuide' => 'Programmführer neu laden',
|
||||
'liveTv.allChannels' => 'Alle Kanäle',
|
||||
'liveTv.now' => 'Jetzt',
|
||||
_ => null,
|
||||
} ?? switch (path) {
|
||||
'liveTv.today' => 'Heute',
|
||||
'liveTv.midnight' => 'Mitternacht',
|
||||
'liveTv.overnight' => 'Nacht',
|
||||
|
||||
@@ -637,6 +637,21 @@ class TranslationsSettingsEn {
|
||||
/// en: 'Wait ${seconds} seconds before auto-skipping'
|
||||
String autoSkipDelayDescription({required Object seconds}) => 'Wait ${seconds} seconds before auto-skipping';
|
||||
|
||||
/// en: 'Intro Marker Pattern'
|
||||
String get introPattern => 'Intro Marker Pattern';
|
||||
|
||||
/// en: 'Regex pattern to match intro markers in chapter titles'
|
||||
String get introPatternDescription => 'Regex pattern to match intro markers in chapter titles';
|
||||
|
||||
/// en: 'Credits Marker Pattern'
|
||||
String get creditsPattern => 'Credits Marker Pattern';
|
||||
|
||||
/// en: 'Regex pattern to match credits markers in chapter titles'
|
||||
String get creditsPatternDescription => 'Regex pattern to match credits markers in chapter titles';
|
||||
|
||||
/// en: 'Invalid regular expression'
|
||||
String get invalidRegex => 'Invalid regular expression';
|
||||
|
||||
/// en: 'Downloads'
|
||||
String get downloads => 'Downloads';
|
||||
|
||||
@@ -2664,6 +2679,9 @@ class TranslationsLibrariesGroupingsEn {
|
||||
|
||||
// Translations
|
||||
|
||||
/// en: 'Grouping'
|
||||
String get title => 'Grouping';
|
||||
|
||||
/// en: 'All'
|
||||
String get all => 'All';
|
||||
|
||||
@@ -3093,6 +3111,11 @@ extension on Translations {
|
||||
'settings.autoSkipCreditsDescription' => 'Automatically skip credits and play next episode',
|
||||
'settings.autoSkipDelay' => 'Auto Skip Delay',
|
||||
'settings.autoSkipDelayDescription' => ({required Object seconds}) => 'Wait ${seconds} seconds before auto-skipping',
|
||||
'settings.introPattern' => 'Intro Marker Pattern',
|
||||
'settings.introPatternDescription' => 'Regex pattern to match intro markers in chapter titles',
|
||||
'settings.creditsPattern' => 'Credits Marker Pattern',
|
||||
'settings.creditsPatternDescription' => 'Regex pattern to match credits markers in chapter titles',
|
||||
'settings.invalidRegex' => 'Invalid regular expression',
|
||||
'settings.downloads' => 'Downloads',
|
||||
'settings.downloadLocationDescription' => 'Choose where to store downloaded content',
|
||||
'settings.downloadLocationDefault' => 'Default (App Storage)',
|
||||
@@ -3390,6 +3413,7 @@ extension on Translations {
|
||||
'libraries.tabs.browse' => 'Browse',
|
||||
'libraries.tabs.collections' => 'Collections',
|
||||
'libraries.tabs.playlists' => 'Playlists',
|
||||
'libraries.groupings.title' => 'Grouping',
|
||||
'libraries.groupings.all' => 'All',
|
||||
'libraries.groupings.movies' => 'Movies',
|
||||
'libraries.groupings.shows' => 'TV Shows',
|
||||
@@ -3431,14 +3455,14 @@ extension on Translations {
|
||||
'liveTv.nowPlaying' => 'Now Playing',
|
||||
'liveTv.noPrograms' => 'No program data available',
|
||||
'liveTv.channelNumber' => ({required Object number}) => 'Ch. ${number}',
|
||||
_ => null,
|
||||
} ?? switch (path) {
|
||||
'liveTv.live' => 'LIVE',
|
||||
'liveTv.hd' => 'HD',
|
||||
'liveTv.premiere' => 'NEW',
|
||||
'liveTv.reloadGuide' => 'Reload Guide',
|
||||
'liveTv.allChannels' => 'All Channels',
|
||||
'liveTv.now' => 'Now',
|
||||
_ => null,
|
||||
} ?? switch (path) {
|
||||
'liveTv.today' => 'Today',
|
||||
'liveTv.midnight' => 'Midnight',
|
||||
'liveTv.overnight' => 'Overnight',
|
||||
|
||||
@@ -297,6 +297,11 @@ class _TranslationsSettingsEs implements TranslationsSettingsEn {
|
||||
@override String get autoSkipCreditsDescription => 'Saltar automáticamente los créditos y reproducir el siguiente episodio';
|
||||
@override String get autoSkipDelay => 'Retraso de Salto automático';
|
||||
@override String autoSkipDelayDescription({required Object seconds}) => 'Esperar ${seconds} segundos antes de saltar automáticamente';
|
||||
@override String get introPattern => 'Patrón de marcador de intro';
|
||||
@override String get introPatternDescription => 'Expresión regular para reconocer marcadores de intro en los títulos de capítulos';
|
||||
@override String get creditsPattern => 'Patrón de marcador de créditos';
|
||||
@override String get creditsPatternDescription => 'Expresión regular para reconocer marcadores de créditos en los títulos de capítulos';
|
||||
@override String get invalidRegex => 'Expresión regular no válida';
|
||||
@override String get downloads => 'Descargas';
|
||||
@override String get downloadLocationDescription => 'Elegir dónde almacenar el contenido descargado';
|
||||
@override String get downloadLocationDefault => 'Predeterminado (Almacenamiento de la App)';
|
||||
@@ -1192,6 +1197,7 @@ class _TranslationsLibrariesGroupingsEs implements TranslationsLibrariesGrouping
|
||||
final TranslationsEs _root; // ignore: unused_field
|
||||
|
||||
// Translations
|
||||
@override String get title => 'Agrupación';
|
||||
@override String get all => 'Todo';
|
||||
@override String get movies => 'Películas';
|
||||
@override String get shows => 'Series';
|
||||
@@ -1472,6 +1478,11 @@ extension on TranslationsEs {
|
||||
'settings.autoSkipCreditsDescription' => 'Saltar automáticamente los créditos y reproducir el siguiente episodio',
|
||||
'settings.autoSkipDelay' => 'Retraso de Salto automático',
|
||||
'settings.autoSkipDelayDescription' => ({required Object seconds}) => 'Esperar ${seconds} segundos antes de saltar automáticamente',
|
||||
'settings.introPattern' => 'Patrón de marcador de intro',
|
||||
'settings.introPatternDescription' => 'Expresión regular para reconocer marcadores de intro en los títulos de capítulos',
|
||||
'settings.creditsPattern' => 'Patrón de marcador de créditos',
|
||||
'settings.creditsPatternDescription' => 'Expresión regular para reconocer marcadores de créditos en los títulos de capítulos',
|
||||
'settings.invalidRegex' => 'Expresión regular no válida',
|
||||
'settings.downloads' => 'Descargas',
|
||||
'settings.downloadLocationDescription' => 'Elegir dónde almacenar el contenido descargado',
|
||||
'settings.downloadLocationDefault' => 'Predeterminado (Almacenamiento de la App)',
|
||||
@@ -1769,6 +1780,7 @@ extension on TranslationsEs {
|
||||
'libraries.tabs.browse' => 'Explorar',
|
||||
'libraries.tabs.collections' => 'Colecciones',
|
||||
'libraries.tabs.playlists' => 'Listas',
|
||||
'libraries.groupings.title' => 'Agrupación',
|
||||
'libraries.groupings.all' => 'Todo',
|
||||
'libraries.groupings.movies' => 'Películas',
|
||||
'libraries.groupings.shows' => 'Series',
|
||||
@@ -1810,14 +1822,14 @@ extension on TranslationsEs {
|
||||
'liveTv.nowPlaying' => 'Reproduciendo ahora',
|
||||
'liveTv.noPrograms' => 'No hay datos de programación disponibles',
|
||||
'liveTv.channelNumber' => ({required Object number}) => 'Canal ${number}',
|
||||
_ => null,
|
||||
} ?? switch (path) {
|
||||
'liveTv.live' => 'EN VIVO',
|
||||
'liveTv.hd' => 'HD',
|
||||
'liveTv.premiere' => 'NUEVO',
|
||||
'liveTv.reloadGuide' => 'Recargar guía',
|
||||
'liveTv.allChannels' => 'Todos los canales',
|
||||
'liveTv.now' => 'Ahora',
|
||||
_ => null,
|
||||
} ?? switch (path) {
|
||||
'liveTv.today' => 'Hoy',
|
||||
'liveTv.midnight' => 'Medianoche',
|
||||
'liveTv.overnight' => 'Madrugada',
|
||||
|
||||
@@ -297,6 +297,11 @@ class _TranslationsSettingsFr implements TranslationsSettingsEn {
|
||||
@override String get autoSkipCreditsDescription => 'Passer les crédits et passer à l\'épisode suivant automatiquement';
|
||||
@override String get autoSkipDelay => 'Délai avant skip automatique';
|
||||
@override String autoSkipDelayDescription({required Object seconds}) => 'Attendre ${seconds} secondes avant l\'auto-skip';
|
||||
@override String get introPattern => 'Modèle de marqueur d\'intro';
|
||||
@override String get introPatternDescription => 'Expression régulière pour reconnaître les marqueurs d\'intro dans les titres de chapitres';
|
||||
@override String get creditsPattern => 'Modèle de marqueur de générique';
|
||||
@override String get creditsPatternDescription => 'Expression régulière pour reconnaître les marqueurs de générique dans les titres de chapitres';
|
||||
@override String get invalidRegex => 'Expression régulière invalide';
|
||||
@override String get downloads => 'Téléchargement';
|
||||
@override String get downloadLocationDescription => 'Choisissez où stocker le contenu téléchargé';
|
||||
@override String get downloadLocationDefault => 'Par défaut (stockage de l\'application)';
|
||||
@@ -1192,6 +1197,7 @@ class _TranslationsLibrariesGroupingsFr implements TranslationsLibrariesGrouping
|
||||
final TranslationsFr _root; // ignore: unused_field
|
||||
|
||||
// Translations
|
||||
@override String get title => 'Regroupement';
|
||||
@override String get all => 'Tous';
|
||||
@override String get movies => 'Films';
|
||||
@override String get shows => 'Show TV';
|
||||
@@ -1472,6 +1478,11 @@ extension on TranslationsFr {
|
||||
'settings.autoSkipCreditsDescription' => 'Passer les crédits et passer à l\'épisode suivant automatiquement',
|
||||
'settings.autoSkipDelay' => 'Délai avant skip automatique',
|
||||
'settings.autoSkipDelayDescription' => ({required Object seconds}) => 'Attendre ${seconds} secondes avant l\'auto-skip',
|
||||
'settings.introPattern' => 'Modèle de marqueur d\'intro',
|
||||
'settings.introPatternDescription' => 'Expression régulière pour reconnaître les marqueurs d\'intro dans les titres de chapitres',
|
||||
'settings.creditsPattern' => 'Modèle de marqueur de générique',
|
||||
'settings.creditsPatternDescription' => 'Expression régulière pour reconnaître les marqueurs de générique dans les titres de chapitres',
|
||||
'settings.invalidRegex' => 'Expression régulière invalide',
|
||||
'settings.downloads' => 'Téléchargement',
|
||||
'settings.downloadLocationDescription' => 'Choisissez où stocker le contenu téléchargé',
|
||||
'settings.downloadLocationDefault' => 'Par défaut (stockage de l\'application)',
|
||||
@@ -1769,6 +1780,7 @@ extension on TranslationsFr {
|
||||
'libraries.tabs.browse' => 'Parcourir',
|
||||
'libraries.tabs.collections' => 'Collections',
|
||||
'libraries.tabs.playlists' => 'Playlists',
|
||||
'libraries.groupings.title' => 'Regroupement',
|
||||
'libraries.groupings.all' => 'Tous',
|
||||
'libraries.groupings.movies' => 'Films',
|
||||
'libraries.groupings.shows' => 'Show TV',
|
||||
@@ -1810,14 +1822,14 @@ extension on TranslationsFr {
|
||||
'liveTv.nowPlaying' => 'En cours de lecture',
|
||||
'liveTv.noPrograms' => 'Aucune donnée de programme disponible',
|
||||
'liveTv.channelNumber' => ({required Object number}) => 'Ch. ${number}',
|
||||
_ => null,
|
||||
} ?? switch (path) {
|
||||
'liveTv.live' => 'EN DIRECT',
|
||||
'liveTv.hd' => 'HD',
|
||||
'liveTv.premiere' => 'NOUVEAU',
|
||||
'liveTv.reloadGuide' => 'Recharger le guide',
|
||||
'liveTv.allChannels' => 'Toutes les chaînes',
|
||||
'liveTv.now' => 'Maintenant',
|
||||
_ => null,
|
||||
} ?? switch (path) {
|
||||
'liveTv.today' => 'Aujourd\'hui',
|
||||
'liveTv.midnight' => 'Minuit',
|
||||
'liveTv.overnight' => 'Nuit',
|
||||
|
||||
@@ -297,6 +297,11 @@ class _TranslationsSettingsIt implements TranslationsSettingsEn {
|
||||
@override String get autoSkipCreditsDescription => 'Salta automaticamente i crediti e riproduci l\'episodio successivo';
|
||||
@override String get autoSkipDelay => 'Ritardo Salto Automatico';
|
||||
@override String autoSkipDelayDescription({required Object seconds}) => 'Aspetta ${seconds} secondi prima del salto automatico';
|
||||
@override String get introPattern => 'Pattern marcatore intro';
|
||||
@override String get introPatternDescription => 'Espressione regolare per riconoscere i marcatori intro nei titoli dei capitoli';
|
||||
@override String get creditsPattern => 'Pattern marcatore titoli di coda';
|
||||
@override String get creditsPatternDescription => 'Espressione regolare per riconoscere i marcatori dei titoli di coda nei capitoli';
|
||||
@override String get invalidRegex => 'Espressione regolare non valida';
|
||||
@override String get downloads => 'Download';
|
||||
@override String get downloadLocationDescription => 'Scegli dove salvare i contenuti scaricati';
|
||||
@override String get downloadLocationDefault => 'Predefinita (Archiviazione App)';
|
||||
@@ -1192,6 +1197,7 @@ class _TranslationsLibrariesGroupingsIt implements TranslationsLibrariesGrouping
|
||||
final TranslationsIt _root; // ignore: unused_field
|
||||
|
||||
// Translations
|
||||
@override String get title => 'Raggruppamento';
|
||||
@override String get all => 'Tutti';
|
||||
@override String get movies => 'Film';
|
||||
@override String get shows => 'Serie TV';
|
||||
@@ -1472,6 +1478,11 @@ extension on TranslationsIt {
|
||||
'settings.autoSkipCreditsDescription' => 'Salta automaticamente i crediti e riproduci l\'episodio successivo',
|
||||
'settings.autoSkipDelay' => 'Ritardo Salto Automatico',
|
||||
'settings.autoSkipDelayDescription' => ({required Object seconds}) => 'Aspetta ${seconds} secondi prima del salto automatico',
|
||||
'settings.introPattern' => 'Pattern marcatore intro',
|
||||
'settings.introPatternDescription' => 'Espressione regolare per riconoscere i marcatori intro nei titoli dei capitoli',
|
||||
'settings.creditsPattern' => 'Pattern marcatore titoli di coda',
|
||||
'settings.creditsPatternDescription' => 'Espressione regolare per riconoscere i marcatori dei titoli di coda nei capitoli',
|
||||
'settings.invalidRegex' => 'Espressione regolare non valida',
|
||||
'settings.downloads' => 'Download',
|
||||
'settings.downloadLocationDescription' => 'Scegli dove salvare i contenuti scaricati',
|
||||
'settings.downloadLocationDefault' => 'Predefinita (Archiviazione App)',
|
||||
@@ -1769,6 +1780,7 @@ extension on TranslationsIt {
|
||||
'libraries.tabs.browse' => 'Esplora',
|
||||
'libraries.tabs.collections' => 'Raccolte',
|
||||
'libraries.tabs.playlists' => 'Playlist',
|
||||
'libraries.groupings.title' => 'Raggruppamento',
|
||||
'libraries.groupings.all' => 'Tutti',
|
||||
'libraries.groupings.movies' => 'Film',
|
||||
'libraries.groupings.shows' => 'Serie TV',
|
||||
@@ -1810,14 +1822,14 @@ extension on TranslationsIt {
|
||||
'liveTv.nowPlaying' => 'In riproduzione',
|
||||
'liveTv.noPrograms' => 'Nessun dato di programma disponibile',
|
||||
'liveTv.channelNumber' => ({required Object number}) => 'Canale ${number}',
|
||||
_ => null,
|
||||
} ?? switch (path) {
|
||||
'liveTv.live' => 'IN DIRETTA',
|
||||
'liveTv.hd' => 'HD',
|
||||
'liveTv.premiere' => 'NUOVO',
|
||||
'liveTv.reloadGuide' => 'Ricarica guida',
|
||||
'liveTv.allChannels' => 'Tutti i canali',
|
||||
'liveTv.now' => 'Ora',
|
||||
_ => null,
|
||||
} ?? switch (path) {
|
||||
'liveTv.today' => 'Oggi',
|
||||
'liveTv.midnight' => 'Mezzanotte',
|
||||
'liveTv.overnight' => 'Notte',
|
||||
|
||||
@@ -297,6 +297,11 @@ class _TranslationsSettingsJa implements TranslationsSettingsEn {
|
||||
@override String get autoSkipCreditsDescription => 'クレジットを自動的にスキップして次のエピソードを再生';
|
||||
@override String get autoSkipDelay => '自動スキップの遅延';
|
||||
@override String autoSkipDelayDescription({required Object seconds}) => '自動スキップまで${seconds}秒待機';
|
||||
@override String get introPattern => 'イントロマーカーパターン';
|
||||
@override String get introPatternDescription => 'チャプタータイトルのイントロマーカーに一致する正規表現パターン';
|
||||
@override String get creditsPattern => 'クレジットマーカーパターン';
|
||||
@override String get creditsPatternDescription => 'チャプタータイトルのクレジットマーカーに一致する正規表現パターン';
|
||||
@override String get invalidRegex => '無効な正規表現';
|
||||
@override String get downloads => 'ダウンロード';
|
||||
@override String get downloadLocationDescription => 'ダウンロードコンテンツの保存場所を選択';
|
||||
@override String get downloadLocationDefault => 'デフォルト(アプリストレージ)';
|
||||
@@ -1192,6 +1197,7 @@ class _TranslationsLibrariesGroupingsJa implements TranslationsLibrariesGrouping
|
||||
final TranslationsJa _root; // ignore: unused_field
|
||||
|
||||
// Translations
|
||||
@override String get title => 'グループ';
|
||||
@override String get all => 'すべて';
|
||||
@override String get movies => '映画';
|
||||
@override String get shows => 'テレビ番組';
|
||||
@@ -1472,6 +1478,11 @@ extension on TranslationsJa {
|
||||
'settings.autoSkipCreditsDescription' => 'クレジットを自動的にスキップして次のエピソードを再生',
|
||||
'settings.autoSkipDelay' => '自動スキップの遅延',
|
||||
'settings.autoSkipDelayDescription' => ({required Object seconds}) => '自動スキップまで${seconds}秒待機',
|
||||
'settings.introPattern' => 'イントロマーカーパターン',
|
||||
'settings.introPatternDescription' => 'チャプタータイトルのイントロマーカーに一致する正規表現パターン',
|
||||
'settings.creditsPattern' => 'クレジットマーカーパターン',
|
||||
'settings.creditsPatternDescription' => 'チャプタータイトルのクレジットマーカーに一致する正規表現パターン',
|
||||
'settings.invalidRegex' => '無効な正規表現',
|
||||
'settings.downloads' => 'ダウンロード',
|
||||
'settings.downloadLocationDescription' => 'ダウンロードコンテンツの保存場所を選択',
|
||||
'settings.downloadLocationDefault' => 'デフォルト(アプリストレージ)',
|
||||
@@ -1769,6 +1780,7 @@ extension on TranslationsJa {
|
||||
'libraries.tabs.browse' => 'ブラウズ',
|
||||
'libraries.tabs.collections' => 'コレクション',
|
||||
'libraries.tabs.playlists' => 'プレイリスト',
|
||||
'libraries.groupings.title' => 'グループ',
|
||||
'libraries.groupings.all' => 'すべて',
|
||||
'libraries.groupings.movies' => '映画',
|
||||
'libraries.groupings.shows' => 'テレビ番組',
|
||||
@@ -1810,14 +1822,14 @@ extension on TranslationsJa {
|
||||
'liveTv.nowPlaying' => '現在放送中',
|
||||
'liveTv.noPrograms' => '番組データがありません',
|
||||
'liveTv.channelNumber' => ({required Object number}) => 'Ch. ${number}',
|
||||
_ => null,
|
||||
} ?? switch (path) {
|
||||
'liveTv.live' => 'ライブ',
|
||||
'liveTv.hd' => 'HD',
|
||||
'liveTv.premiere' => '新着',
|
||||
'liveTv.reloadGuide' => '番組表を再読込',
|
||||
'liveTv.allChannels' => 'すべてのチャンネル',
|
||||
'liveTv.now' => '現在',
|
||||
_ => null,
|
||||
} ?? switch (path) {
|
||||
'liveTv.today' => '今日',
|
||||
'liveTv.midnight' => '深夜',
|
||||
'liveTv.overnight' => '深夜',
|
||||
|
||||
@@ -297,6 +297,11 @@ class _TranslationsSettingsKo implements TranslationsSettingsEn {
|
||||
@override String get autoSkipCreditsDescription => '엔딩 크레딧 자동 건너뛰기 후 다음 에피소드 재생';
|
||||
@override String get autoSkipDelay => '자동 건너뛰기 지연';
|
||||
@override String autoSkipDelayDescription({required Object seconds}) => '자동 건너뛰기 전 ${seconds} 초 대기';
|
||||
@override String get introPattern => '인트로 마커 패턴';
|
||||
@override String get introPatternDescription => '챕터 제목에서 인트로 마커를 인식하는 정규식 패턴';
|
||||
@override String get creditsPattern => '크레딧 마커 패턴';
|
||||
@override String get creditsPatternDescription => '챕터 제목에서 크레딧 마커를 인식하는 정규식 패턴';
|
||||
@override String get invalidRegex => '잘못된 정규식';
|
||||
@override String get downloads => '다운로드';
|
||||
@override String get downloadLocationDescription => '다운로드 콘텐츠 저장 위치 선택';
|
||||
@override String get downloadLocationDefault => '기본값 (앱 저장소)';
|
||||
@@ -1192,6 +1197,7 @@ class _TranslationsLibrariesGroupingsKo implements TranslationsLibrariesGrouping
|
||||
final TranslationsKo _root; // ignore: unused_field
|
||||
|
||||
// Translations
|
||||
@override String get title => '그룹';
|
||||
@override String get all => '전체';
|
||||
@override String get movies => '영화';
|
||||
@override String get shows => 'TV 프로그램';
|
||||
@@ -1472,6 +1478,11 @@ extension on TranslationsKo {
|
||||
'settings.autoSkipCreditsDescription' => '엔딩 크레딧 자동 건너뛰기 후 다음 에피소드 재생',
|
||||
'settings.autoSkipDelay' => '자동 건너뛰기 지연',
|
||||
'settings.autoSkipDelayDescription' => ({required Object seconds}) => '자동 건너뛰기 전 ${seconds} 초 대기',
|
||||
'settings.introPattern' => '인트로 마커 패턴',
|
||||
'settings.introPatternDescription' => '챕터 제목에서 인트로 마커를 인식하는 정규식 패턴',
|
||||
'settings.creditsPattern' => '크레딧 마커 패턴',
|
||||
'settings.creditsPatternDescription' => '챕터 제목에서 크레딧 마커를 인식하는 정규식 패턴',
|
||||
'settings.invalidRegex' => '잘못된 정규식',
|
||||
'settings.downloads' => '다운로드',
|
||||
'settings.downloadLocationDescription' => '다운로드 콘텐츠 저장 위치 선택',
|
||||
'settings.downloadLocationDefault' => '기본값 (앱 저장소)',
|
||||
@@ -1769,6 +1780,7 @@ extension on TranslationsKo {
|
||||
'libraries.tabs.browse' => '찾아보기',
|
||||
'libraries.tabs.collections' => '컬렉션',
|
||||
'libraries.tabs.playlists' => '재생 목록',
|
||||
'libraries.groupings.title' => '그룹',
|
||||
'libraries.groupings.all' => '전체',
|
||||
'libraries.groupings.movies' => '영화',
|
||||
'libraries.groupings.shows' => 'TV 프로그램',
|
||||
@@ -1810,14 +1822,14 @@ extension on TranslationsKo {
|
||||
'liveTv.nowPlaying' => '현재 재생 중',
|
||||
'liveTv.noPrograms' => '프로그램 데이터가 없습니다',
|
||||
'liveTv.channelNumber' => ({required Object number}) => '채널 ${number}',
|
||||
_ => null,
|
||||
} ?? switch (path) {
|
||||
'liveTv.live' => '실시간',
|
||||
'liveTv.hd' => 'HD',
|
||||
'liveTv.premiere' => '신규',
|
||||
'liveTv.reloadGuide' => '편성표 새로고침',
|
||||
'liveTv.allChannels' => '전체 채널',
|
||||
'liveTv.now' => '지금',
|
||||
_ => null,
|
||||
} ?? switch (path) {
|
||||
'liveTv.today' => '오늘',
|
||||
'liveTv.midnight' => '자정',
|
||||
'liveTv.overnight' => '심야',
|
||||
|
||||
@@ -297,6 +297,11 @@ class _TranslationsSettingsNb implements TranslationsSettingsEn {
|
||||
@override String get autoSkipCreditsDescription => 'Hopp automatisk over rulletekst og spill neste episode';
|
||||
@override String get autoSkipDelay => 'Forsinkelse for automatisk hopp';
|
||||
@override String autoSkipDelayDescription({required Object seconds}) => 'Vent ${seconds} sekunder før automatisk hopping';
|
||||
@override String get introPattern => 'Intromarkørmønster';
|
||||
@override String get introPatternDescription => 'Regulært uttrykk for å gjenkjenne intromarkører i kapitteltitler';
|
||||
@override String get creditsPattern => 'Rulletekstmarkørmønster';
|
||||
@override String get creditsPatternDescription => 'Regulært uttrykk for å gjenkjenne rulletekstmarkører i kapitteltitler';
|
||||
@override String get invalidRegex => 'Ugyldig regulært uttrykk';
|
||||
@override String get downloads => 'Nedlastinger';
|
||||
@override String get downloadLocationDescription => 'Velg hvor nedlastet innhold skal lagres';
|
||||
@override String get downloadLocationDefault => 'Standard (App-lagring)';
|
||||
@@ -1192,6 +1197,7 @@ class _TranslationsLibrariesGroupingsNb implements TranslationsLibrariesGrouping
|
||||
final TranslationsNb _root; // ignore: unused_field
|
||||
|
||||
// Translations
|
||||
@override String get title => 'Gruppering';
|
||||
@override String get all => 'Alle';
|
||||
@override String get movies => 'Filmer';
|
||||
@override String get shows => 'TV-serier';
|
||||
@@ -1472,6 +1478,11 @@ extension on TranslationsNb {
|
||||
'settings.autoSkipCreditsDescription' => 'Hopp automatisk over rulletekst og spill neste episode',
|
||||
'settings.autoSkipDelay' => 'Forsinkelse for automatisk hopp',
|
||||
'settings.autoSkipDelayDescription' => ({required Object seconds}) => 'Vent ${seconds} sekunder før automatisk hopping',
|
||||
'settings.introPattern' => 'Intromarkørmønster',
|
||||
'settings.introPatternDescription' => 'Regulært uttrykk for å gjenkjenne intromarkører i kapitteltitler',
|
||||
'settings.creditsPattern' => 'Rulletekstmarkørmønster',
|
||||
'settings.creditsPatternDescription' => 'Regulært uttrykk for å gjenkjenne rulletekstmarkører i kapitteltitler',
|
||||
'settings.invalidRegex' => 'Ugyldig regulært uttrykk',
|
||||
'settings.downloads' => 'Nedlastinger',
|
||||
'settings.downloadLocationDescription' => 'Velg hvor nedlastet innhold skal lagres',
|
||||
'settings.downloadLocationDefault' => 'Standard (App-lagring)',
|
||||
@@ -1769,6 +1780,7 @@ extension on TranslationsNb {
|
||||
'libraries.tabs.browse' => 'Bla gjennom',
|
||||
'libraries.tabs.collections' => 'Samlinger',
|
||||
'libraries.tabs.playlists' => 'Spillelister',
|
||||
'libraries.groupings.title' => 'Gruppering',
|
||||
'libraries.groupings.all' => 'Alle',
|
||||
'libraries.groupings.movies' => 'Filmer',
|
||||
'libraries.groupings.shows' => 'TV-serier',
|
||||
@@ -1810,14 +1822,14 @@ extension on TranslationsNb {
|
||||
'liveTv.nowPlaying' => 'Spilles nå',
|
||||
'liveTv.noPrograms' => 'Ingen programdata tilgjengelig',
|
||||
'liveTv.channelNumber' => ({required Object number}) => 'Kanal ${number}',
|
||||
_ => null,
|
||||
} ?? switch (path) {
|
||||
'liveTv.live' => 'DIREKTE',
|
||||
'liveTv.hd' => 'HD',
|
||||
'liveTv.premiere' => 'NY',
|
||||
'liveTv.reloadGuide' => 'Last inn programguide på nytt',
|
||||
'liveTv.allChannels' => 'Alle kanaler',
|
||||
'liveTv.now' => 'Nå',
|
||||
_ => null,
|
||||
} ?? switch (path) {
|
||||
'liveTv.today' => 'I dag',
|
||||
'liveTv.midnight' => 'Midnatt',
|
||||
'liveTv.overnight' => 'Natt',
|
||||
|
||||
@@ -297,6 +297,11 @@ class _TranslationsSettingsNl implements TranslationsSettingsEn {
|
||||
@override String get autoSkipCreditsDescription => 'Credits automatisch overslaan en volgende aflevering afspelen';
|
||||
@override String get autoSkipDelay => 'Vertraging Automatisch Overslaan';
|
||||
@override String autoSkipDelayDescription({required Object seconds}) => '${seconds} seconden wachten voor automatisch overslaan';
|
||||
@override String get introPattern => 'Intromarkeringspatroon';
|
||||
@override String get introPatternDescription => 'Reguliere expressie om intromarkeringen in hoofdstuktitels te herkennen';
|
||||
@override String get creditsPattern => 'Aftitelingmarkeringspatroon';
|
||||
@override String get creditsPatternDescription => 'Reguliere expressie om aftitelingmarkeringen in hoofdstuktitels te herkennen';
|
||||
@override String get invalidRegex => 'Ongeldige reguliere expressie';
|
||||
@override String get downloads => 'Downloads';
|
||||
@override String get downloadLocationDescription => 'Kies waar gedownloade content wordt opgeslagen';
|
||||
@override String get downloadLocationDefault => 'Standaard (App-opslag)';
|
||||
@@ -1192,6 +1197,7 @@ class _TranslationsLibrariesGroupingsNl implements TranslationsLibrariesGrouping
|
||||
final TranslationsNl _root; // ignore: unused_field
|
||||
|
||||
// Translations
|
||||
@override String get title => 'Groepering';
|
||||
@override String get all => 'Alles';
|
||||
@override String get movies => 'Films';
|
||||
@override String get shows => 'Series';
|
||||
@@ -1472,6 +1478,11 @@ extension on TranslationsNl {
|
||||
'settings.autoSkipCreditsDescription' => 'Credits automatisch overslaan en volgende aflevering afspelen',
|
||||
'settings.autoSkipDelay' => 'Vertraging Automatisch Overslaan',
|
||||
'settings.autoSkipDelayDescription' => ({required Object seconds}) => '${seconds} seconden wachten voor automatisch overslaan',
|
||||
'settings.introPattern' => 'Intromarkeringspatroon',
|
||||
'settings.introPatternDescription' => 'Reguliere expressie om intromarkeringen in hoofdstuktitels te herkennen',
|
||||
'settings.creditsPattern' => 'Aftitelingmarkeringspatroon',
|
||||
'settings.creditsPatternDescription' => 'Reguliere expressie om aftitelingmarkeringen in hoofdstuktitels te herkennen',
|
||||
'settings.invalidRegex' => 'Ongeldige reguliere expressie',
|
||||
'settings.downloads' => 'Downloads',
|
||||
'settings.downloadLocationDescription' => 'Kies waar gedownloade content wordt opgeslagen',
|
||||
'settings.downloadLocationDefault' => 'Standaard (App-opslag)',
|
||||
@@ -1769,6 +1780,7 @@ extension on TranslationsNl {
|
||||
'libraries.tabs.browse' => 'Bladeren',
|
||||
'libraries.tabs.collections' => 'Collecties',
|
||||
'libraries.tabs.playlists' => 'Afspeellijsten',
|
||||
'libraries.groupings.title' => 'Groepering',
|
||||
'libraries.groupings.all' => 'Alles',
|
||||
'libraries.groupings.movies' => 'Films',
|
||||
'libraries.groupings.shows' => 'Series',
|
||||
@@ -1810,14 +1822,14 @@ extension on TranslationsNl {
|
||||
'liveTv.nowPlaying' => 'Nu aan het afspelen',
|
||||
'liveTv.noPrograms' => 'Geen programmagegevens beschikbaar',
|
||||
'liveTv.channelNumber' => ({required Object number}) => 'Kanaal ${number}',
|
||||
_ => null,
|
||||
} ?? switch (path) {
|
||||
'liveTv.live' => 'LIVE',
|
||||
'liveTv.hd' => 'HD',
|
||||
'liveTv.premiere' => 'NIEUW',
|
||||
'liveTv.reloadGuide' => 'Gids herladen',
|
||||
'liveTv.allChannels' => 'Alle zenders',
|
||||
'liveTv.now' => 'Nu',
|
||||
_ => null,
|
||||
} ?? switch (path) {
|
||||
'liveTv.today' => 'Vandaag',
|
||||
'liveTv.midnight' => 'Middernacht',
|
||||
'liveTv.overnight' => 'Nacht',
|
||||
|
||||
@@ -297,6 +297,11 @@ class _TranslationsSettingsPl implements TranslationsSettingsEn {
|
||||
@override String get autoSkipCreditsDescription => 'Automatycznie pomijaj napisy końcowe i odtwórz następny odcinek';
|
||||
@override String get autoSkipDelay => 'Opóźnienie automatycznego pomijania';
|
||||
@override String autoSkipDelayDescription({required Object seconds}) => 'Czekaj ${seconds} sekund przed automatycznym pominięciem';
|
||||
@override String get introPattern => 'Wzorzec znacznika intro';
|
||||
@override String get introPatternDescription => 'Wyrażenie regularne do rozpoznawania znaczników intro w tytułach rozdziałów';
|
||||
@override String get creditsPattern => 'Wzorzec znacznika napisów końcowych';
|
||||
@override String get creditsPatternDescription => 'Wyrażenie regularne do rozpoznawania znaczników napisów końcowych w tytułach rozdziałów';
|
||||
@override String get invalidRegex => 'Nieprawidłowe wyrażenie regularne';
|
||||
@override String get downloads => 'Pobrania';
|
||||
@override String get downloadLocationDescription => 'Wybierz miejsce przechowywania pobranych treści';
|
||||
@override String get downloadLocationDefault => 'Domyślne (Pamięć aplikacji)';
|
||||
@@ -1192,6 +1197,7 @@ class _TranslationsLibrariesGroupingsPl implements TranslationsLibrariesGrouping
|
||||
final TranslationsPl _root; // ignore: unused_field
|
||||
|
||||
// Translations
|
||||
@override String get title => 'Grupowanie';
|
||||
@override String get all => 'Wszystkie';
|
||||
@override String get movies => 'Filmy';
|
||||
@override String get shows => 'Seriale TV';
|
||||
@@ -1472,6 +1478,11 @@ extension on TranslationsPl {
|
||||
'settings.autoSkipCreditsDescription' => 'Automatycznie pomijaj napisy końcowe i odtwórz następny odcinek',
|
||||
'settings.autoSkipDelay' => 'Opóźnienie automatycznego pomijania',
|
||||
'settings.autoSkipDelayDescription' => ({required Object seconds}) => 'Czekaj ${seconds} sekund przed automatycznym pominięciem',
|
||||
'settings.introPattern' => 'Wzorzec znacznika intro',
|
||||
'settings.introPatternDescription' => 'Wyrażenie regularne do rozpoznawania znaczników intro w tytułach rozdziałów',
|
||||
'settings.creditsPattern' => 'Wzorzec znacznika napisów końcowych',
|
||||
'settings.creditsPatternDescription' => 'Wyrażenie regularne do rozpoznawania znaczników napisów końcowych w tytułach rozdziałów',
|
||||
'settings.invalidRegex' => 'Nieprawidłowe wyrażenie regularne',
|
||||
'settings.downloads' => 'Pobrania',
|
||||
'settings.downloadLocationDescription' => 'Wybierz miejsce przechowywania pobranych treści',
|
||||
'settings.downloadLocationDefault' => 'Domyślne (Pamięć aplikacji)',
|
||||
@@ -1769,6 +1780,7 @@ extension on TranslationsPl {
|
||||
'libraries.tabs.browse' => 'Przeglądaj',
|
||||
'libraries.tabs.collections' => 'Kolekcje',
|
||||
'libraries.tabs.playlists' => 'Playlisty',
|
||||
'libraries.groupings.title' => 'Grupowanie',
|
||||
'libraries.groupings.all' => 'Wszystkie',
|
||||
'libraries.groupings.movies' => 'Filmy',
|
||||
'libraries.groupings.shows' => 'Seriale TV',
|
||||
@@ -1810,14 +1822,14 @@ extension on TranslationsPl {
|
||||
'liveTv.nowPlaying' => 'Teraz odtwarzane',
|
||||
'liveTv.noPrograms' => 'Brak danych o programach',
|
||||
'liveTv.channelNumber' => ({required Object number}) => 'Kn. ${number}',
|
||||
_ => null,
|
||||
} ?? switch (path) {
|
||||
'liveTv.live' => 'NA ŻYWO',
|
||||
'liveTv.hd' => 'HD',
|
||||
'liveTv.premiere' => 'NOWE',
|
||||
'liveTv.reloadGuide' => 'Odśwież przewodnik',
|
||||
'liveTv.allChannels' => 'Wszystkie kanały',
|
||||
'liveTv.now' => 'Teraz',
|
||||
_ => null,
|
||||
} ?? switch (path) {
|
||||
'liveTv.today' => 'Dzisiaj',
|
||||
'liveTv.midnight' => 'Północ',
|
||||
'liveTv.overnight' => 'Nocą',
|
||||
|
||||
@@ -297,6 +297,11 @@ class _TranslationsSettingsPt implements TranslationsSettingsEn {
|
||||
@override String get autoSkipCreditsDescription => 'Pular créditos automaticamente e reproduzir próximo episódio';
|
||||
@override String get autoSkipDelay => 'Atraso do Pulo Automático';
|
||||
@override String autoSkipDelayDescription({required Object seconds}) => 'Aguardar ${seconds} segundos antes de pular automaticamente';
|
||||
@override String get introPattern => 'Padrão de marcador de intro';
|
||||
@override String get introPatternDescription => 'Expressão regular para corresponder marcadores de intro nos títulos dos capítulos';
|
||||
@override String get creditsPattern => 'Padrão de marcador de créditos';
|
||||
@override String get creditsPatternDescription => 'Expressão regular para corresponder marcadores de créditos nos títulos dos capítulos';
|
||||
@override String get invalidRegex => 'Expressão regular inválida';
|
||||
@override String get downloads => 'Downloads';
|
||||
@override String get downloadLocationDescription => 'Escolha onde armazenar conteúdo baixado';
|
||||
@override String get downloadLocationDefault => 'Padrão (Armazenamento do App)';
|
||||
@@ -1192,6 +1197,7 @@ class _TranslationsLibrariesGroupingsPt implements TranslationsLibrariesGrouping
|
||||
final TranslationsPt _root; // ignore: unused_field
|
||||
|
||||
// Translations
|
||||
@override String get title => 'Agrupamento';
|
||||
@override String get all => 'Todos';
|
||||
@override String get movies => 'Filmes';
|
||||
@override String get shows => 'Séries de TV';
|
||||
@@ -1472,6 +1478,11 @@ extension on TranslationsPt {
|
||||
'settings.autoSkipCreditsDescription' => 'Pular créditos automaticamente e reproduzir próximo episódio',
|
||||
'settings.autoSkipDelay' => 'Atraso do Pulo Automático',
|
||||
'settings.autoSkipDelayDescription' => ({required Object seconds}) => 'Aguardar ${seconds} segundos antes de pular automaticamente',
|
||||
'settings.introPattern' => 'Padrão de marcador de intro',
|
||||
'settings.introPatternDescription' => 'Expressão regular para corresponder marcadores de intro nos títulos dos capítulos',
|
||||
'settings.creditsPattern' => 'Padrão de marcador de créditos',
|
||||
'settings.creditsPatternDescription' => 'Expressão regular para corresponder marcadores de créditos nos títulos dos capítulos',
|
||||
'settings.invalidRegex' => 'Expressão regular inválida',
|
||||
'settings.downloads' => 'Downloads',
|
||||
'settings.downloadLocationDescription' => 'Escolha onde armazenar conteúdo baixado',
|
||||
'settings.downloadLocationDefault' => 'Padrão (Armazenamento do App)',
|
||||
@@ -1769,6 +1780,7 @@ extension on TranslationsPt {
|
||||
'libraries.tabs.browse' => 'Navegar',
|
||||
'libraries.tabs.collections' => 'Coleções',
|
||||
'libraries.tabs.playlists' => 'Playlists',
|
||||
'libraries.groupings.title' => 'Agrupamento',
|
||||
'libraries.groupings.all' => 'Todos',
|
||||
'libraries.groupings.movies' => 'Filmes',
|
||||
'libraries.groupings.shows' => 'Séries de TV',
|
||||
@@ -1810,14 +1822,14 @@ extension on TranslationsPt {
|
||||
'liveTv.nowPlaying' => 'Reproduzindo Agora',
|
||||
'liveTv.noPrograms' => 'Nenhum dado de programação disponível',
|
||||
'liveTv.channelNumber' => ({required Object number}) => 'Ch. ${number}',
|
||||
_ => null,
|
||||
} ?? switch (path) {
|
||||
'liveTv.live' => 'AO VIVO',
|
||||
'liveTv.hd' => 'HD',
|
||||
'liveTv.premiere' => 'NOVO',
|
||||
'liveTv.reloadGuide' => 'Recarregar Guia',
|
||||
'liveTv.allChannels' => 'Todos os Canais',
|
||||
'liveTv.now' => 'Agora',
|
||||
_ => null,
|
||||
} ?? switch (path) {
|
||||
'liveTv.today' => 'Hoje',
|
||||
'liveTv.midnight' => 'Meia-noite',
|
||||
'liveTv.overnight' => 'Madrugada',
|
||||
|
||||
@@ -297,6 +297,11 @@ class _TranslationsSettingsRu implements TranslationsSettingsEn {
|
||||
@override String get autoSkipCreditsDescription => 'Автоматически пропускать титры и воспроизводить следующий эпизод';
|
||||
@override String get autoSkipDelay => 'Задержка автопропуска';
|
||||
@override String autoSkipDelayDescription({required Object seconds}) => 'Подождать ${seconds} секунд перед автопропуском';
|
||||
@override String get introPattern => 'Шаблон маркера вступления';
|
||||
@override String get introPatternDescription => 'Регулярное выражение для распознавания маркеров вступления в заголовках глав';
|
||||
@override String get creditsPattern => 'Шаблон маркера титров';
|
||||
@override String get creditsPatternDescription => 'Регулярное выражение для распознавания маркеров титров в заголовках глав';
|
||||
@override String get invalidRegex => 'Недопустимое регулярное выражение';
|
||||
@override String get downloads => 'Загрузки';
|
||||
@override String get downloadLocationDescription => 'Выберите место для хранения загруженного контента';
|
||||
@override String get downloadLocationDefault => 'По умолчанию (Хранилище приложения)';
|
||||
@@ -1192,6 +1197,7 @@ class _TranslationsLibrariesGroupingsRu implements TranslationsLibrariesGrouping
|
||||
final TranslationsRu _root; // ignore: unused_field
|
||||
|
||||
// Translations
|
||||
@override String get title => 'Группировка';
|
||||
@override String get all => 'Все';
|
||||
@override String get movies => 'Фильмы';
|
||||
@override String get shows => 'Сериалы';
|
||||
@@ -1472,6 +1478,11 @@ extension on TranslationsRu {
|
||||
'settings.autoSkipCreditsDescription' => 'Автоматически пропускать титры и воспроизводить следующий эпизод',
|
||||
'settings.autoSkipDelay' => 'Задержка автопропуска',
|
||||
'settings.autoSkipDelayDescription' => ({required Object seconds}) => 'Подождать ${seconds} секунд перед автопропуском',
|
||||
'settings.introPattern' => 'Шаблон маркера вступления',
|
||||
'settings.introPatternDescription' => 'Регулярное выражение для распознавания маркеров вступления в заголовках глав',
|
||||
'settings.creditsPattern' => 'Шаблон маркера титров',
|
||||
'settings.creditsPatternDescription' => 'Регулярное выражение для распознавания маркеров титров в заголовках глав',
|
||||
'settings.invalidRegex' => 'Недопустимое регулярное выражение',
|
||||
'settings.downloads' => 'Загрузки',
|
||||
'settings.downloadLocationDescription' => 'Выберите место для хранения загруженного контента',
|
||||
'settings.downloadLocationDefault' => 'По умолчанию (Хранилище приложения)',
|
||||
@@ -1769,6 +1780,7 @@ extension on TranslationsRu {
|
||||
'libraries.tabs.browse' => 'Обзор',
|
||||
'libraries.tabs.collections' => 'Коллекции',
|
||||
'libraries.tabs.playlists' => 'Плейлисты',
|
||||
'libraries.groupings.title' => 'Группировка',
|
||||
'libraries.groupings.all' => 'Все',
|
||||
'libraries.groupings.movies' => 'Фильмы',
|
||||
'libraries.groupings.shows' => 'Сериалы',
|
||||
@@ -1810,14 +1822,14 @@ extension on TranslationsRu {
|
||||
'liveTv.nowPlaying' => 'Сейчас воспроизводится',
|
||||
'liveTv.noPrograms' => 'Нет данных о программах',
|
||||
'liveTv.channelNumber' => ({required Object number}) => 'Кн. ${number}',
|
||||
_ => null,
|
||||
} ?? switch (path) {
|
||||
'liveTv.live' => 'ЭФИР',
|
||||
'liveTv.hd' => 'HD',
|
||||
'liveTv.premiere' => 'НОВОЕ',
|
||||
'liveTv.reloadGuide' => 'Перезагрузить программу',
|
||||
'liveTv.allChannels' => 'Все каналы',
|
||||
'liveTv.now' => 'Сейчас',
|
||||
_ => null,
|
||||
} ?? switch (path) {
|
||||
'liveTv.today' => 'Сегодня',
|
||||
'liveTv.midnight' => 'Полночь',
|
||||
'liveTv.overnight' => 'Ночь',
|
||||
|
||||
@@ -297,6 +297,11 @@ class _TranslationsSettingsSv implements TranslationsSettingsEn {
|
||||
@override String get autoSkipCreditsDescription => 'Hoppa automatiskt över credits och spela nästa avsnitt';
|
||||
@override String get autoSkipDelay => 'Fördröjning Auto Hoppa Över';
|
||||
@override String autoSkipDelayDescription({required Object seconds}) => 'Vänta ${seconds} sekunder innan automatisk överhoppning';
|
||||
@override String get introPattern => 'Intromarkörsmönster';
|
||||
@override String get introPatternDescription => 'Reguljärt uttryck för att matcha intromarkörer i kapiteltitlar';
|
||||
@override String get creditsPattern => 'Eftertextmarkörsmönster';
|
||||
@override String get creditsPatternDescription => 'Reguljärt uttryck för att matcha eftertextmarkörer i kapiteltitlar';
|
||||
@override String get invalidRegex => 'Ogiltigt reguljärt uttryck';
|
||||
@override String get downloads => 'Nedladdningar';
|
||||
@override String get downloadLocationDescription => 'Välj var nedladdat innehåll ska lagras';
|
||||
@override String get downloadLocationDefault => 'Standard (App-lagring)';
|
||||
@@ -1192,6 +1197,7 @@ class _TranslationsLibrariesGroupingsSv implements TranslationsLibrariesGrouping
|
||||
final TranslationsSv _root; // ignore: unused_field
|
||||
|
||||
// Translations
|
||||
@override String get title => 'Gruppering';
|
||||
@override String get all => 'Alla';
|
||||
@override String get movies => 'Filmer';
|
||||
@override String get shows => 'Serier';
|
||||
@@ -1472,6 +1478,11 @@ extension on TranslationsSv {
|
||||
'settings.autoSkipCreditsDescription' => 'Hoppa automatiskt över credits och spela nästa avsnitt',
|
||||
'settings.autoSkipDelay' => 'Fördröjning Auto Hoppa Över',
|
||||
'settings.autoSkipDelayDescription' => ({required Object seconds}) => 'Vänta ${seconds} sekunder innan automatisk överhoppning',
|
||||
'settings.introPattern' => 'Intromarkörsmönster',
|
||||
'settings.introPatternDescription' => 'Reguljärt uttryck för att matcha intromarkörer i kapiteltitlar',
|
||||
'settings.creditsPattern' => 'Eftertextmarkörsmönster',
|
||||
'settings.creditsPatternDescription' => 'Reguljärt uttryck för att matcha eftertextmarkörer i kapiteltitlar',
|
||||
'settings.invalidRegex' => 'Ogiltigt reguljärt uttryck',
|
||||
'settings.downloads' => 'Nedladdningar',
|
||||
'settings.downloadLocationDescription' => 'Välj var nedladdat innehåll ska lagras',
|
||||
'settings.downloadLocationDefault' => 'Standard (App-lagring)',
|
||||
@@ -1769,6 +1780,7 @@ extension on TranslationsSv {
|
||||
'libraries.tabs.browse' => 'Bläddra',
|
||||
'libraries.tabs.collections' => 'Samlingar',
|
||||
'libraries.tabs.playlists' => 'Spellistor',
|
||||
'libraries.groupings.title' => 'Gruppering',
|
||||
'libraries.groupings.all' => 'Alla',
|
||||
'libraries.groupings.movies' => 'Filmer',
|
||||
'libraries.groupings.shows' => 'Serier',
|
||||
@@ -1810,14 +1822,14 @@ extension on TranslationsSv {
|
||||
'liveTv.nowPlaying' => 'Spelas nu',
|
||||
'liveTv.noPrograms' => 'Ingen programdata tillgänglig',
|
||||
'liveTv.channelNumber' => ({required Object number}) => 'Kanal ${number}',
|
||||
_ => null,
|
||||
} ?? switch (path) {
|
||||
'liveTv.live' => 'LIVE',
|
||||
'liveTv.hd' => 'HD',
|
||||
'liveTv.premiere' => 'NY',
|
||||
'liveTv.reloadGuide' => 'Ladda om programguide',
|
||||
'liveTv.allChannels' => 'Alla kanaler',
|
||||
'liveTv.now' => 'Nu',
|
||||
_ => null,
|
||||
} ?? switch (path) {
|
||||
'liveTv.today' => 'Idag',
|
||||
'liveTv.midnight' => 'Midnatt',
|
||||
'liveTv.overnight' => 'Natt',
|
||||
|
||||
@@ -297,6 +297,11 @@ class _TranslationsSettingsZh implements TranslationsSettingsEn {
|
||||
@override String get autoSkipCreditsDescription => '自动跳过片尾并播放下一集';
|
||||
@override String get autoSkipDelay => '自动跳过延迟';
|
||||
@override String autoSkipDelayDescription({required Object seconds}) => '自动跳过前等待 ${seconds} 秒';
|
||||
@override String get introPattern => '片头标记模式';
|
||||
@override String get introPatternDescription => '用于匹配章节标题中片头标记的正则表达式';
|
||||
@override String get creditsPattern => '片尾标记模式';
|
||||
@override String get creditsPatternDescription => '用于匹配章节标题中片尾标记的正则表达式';
|
||||
@override String get invalidRegex => '无效的正则表达式';
|
||||
@override String get downloads => '下载';
|
||||
@override String get downloadLocationDescription => '选择下载内容的存储位置';
|
||||
@override String get downloadLocationDefault => '默认(应用存储)';
|
||||
@@ -1192,6 +1197,7 @@ class _TranslationsLibrariesGroupingsZh implements TranslationsLibrariesGrouping
|
||||
final TranslationsZh _root; // ignore: unused_field
|
||||
|
||||
// Translations
|
||||
@override String get title => '分组';
|
||||
@override String get all => '全部';
|
||||
@override String get movies => '电影';
|
||||
@override String get shows => '剧集';
|
||||
@@ -1472,6 +1478,11 @@ extension on TranslationsZh {
|
||||
'settings.autoSkipCreditsDescription' => '自动跳过片尾并播放下一集',
|
||||
'settings.autoSkipDelay' => '自动跳过延迟',
|
||||
'settings.autoSkipDelayDescription' => ({required Object seconds}) => '自动跳过前等待 ${seconds} 秒',
|
||||
'settings.introPattern' => '片头标记模式',
|
||||
'settings.introPatternDescription' => '用于匹配章节标题中片头标记的正则表达式',
|
||||
'settings.creditsPattern' => '片尾标记模式',
|
||||
'settings.creditsPatternDescription' => '用于匹配章节标题中片尾标记的正则表达式',
|
||||
'settings.invalidRegex' => '无效的正则表达式',
|
||||
'settings.downloads' => '下载',
|
||||
'settings.downloadLocationDescription' => '选择下载内容的存储位置',
|
||||
'settings.downloadLocationDefault' => '默认(应用存储)',
|
||||
@@ -1769,6 +1780,7 @@ extension on TranslationsZh {
|
||||
'libraries.tabs.browse' => '浏览',
|
||||
'libraries.tabs.collections' => '合集',
|
||||
'libraries.tabs.playlists' => '播放列表',
|
||||
'libraries.groupings.title' => '分组',
|
||||
'libraries.groupings.all' => '全部',
|
||||
'libraries.groupings.movies' => '电影',
|
||||
'libraries.groupings.shows' => '剧集',
|
||||
@@ -1810,14 +1822,14 @@ extension on TranslationsZh {
|
||||
'liveTv.nowPlaying' => '正在播放',
|
||||
'liveTv.noPrograms' => '没有可用的节目数据',
|
||||
'liveTv.channelNumber' => ({required Object number}) => '频道 ${number}',
|
||||
_ => null,
|
||||
} ?? switch (path) {
|
||||
'liveTv.live' => '直播',
|
||||
'liveTv.hd' => '高清',
|
||||
'liveTv.premiere' => '新',
|
||||
'liveTv.reloadGuide' => '重新加载节目指南',
|
||||
'liveTv.allChannels' => '所有频道',
|
||||
'liveTv.now' => '现在',
|
||||
_ => null,
|
||||
} ?? switch (path) {
|
||||
'liveTv.today' => '今天',
|
||||
'liveTv.midnight' => '午夜',
|
||||
'liveTv.overnight' => '凌晨',
|
||||
|
||||
@@ -178,6 +178,11 @@
|
||||
"autoSkipCreditsDescription": "Hoppa automatiskt över credits och spela nästa avsnitt",
|
||||
"autoSkipDelay": "Fördröjning Auto Hoppa Över",
|
||||
"autoSkipDelayDescription": "Vänta ${seconds} sekunder innan automatisk överhoppning",
|
||||
"introPattern": "Intromarkörsmönster",
|
||||
"introPatternDescription": "Reguljärt uttryck för att matcha intromarkörer i kapiteltitlar",
|
||||
"creditsPattern": "Eftertextmarkörsmönster",
|
||||
"creditsPatternDescription": "Reguljärt uttryck för att matcha eftertextmarkörer i kapiteltitlar",
|
||||
"invalidRegex": "Ogiltigt reguljärt uttryck",
|
||||
"downloads": "Nedladdningar",
|
||||
"downloadLocationDescription": "Välj var nedladdat innehåll ska lagras",
|
||||
"downloadLocationDefault": "Standard (App-lagring)",
|
||||
@@ -514,6 +519,7 @@
|
||||
"playlists": "Spellistor"
|
||||
},
|
||||
"groupings": {
|
||||
"title": "Gruppering",
|
||||
"all": "Alla",
|
||||
"movies": "Filmer",
|
||||
"shows": "Serier",
|
||||
|
||||
@@ -178,6 +178,11 @@
|
||||
"autoSkipCreditsDescription": "自动跳过片尾并播放下一集",
|
||||
"autoSkipDelay": "自动跳过延迟",
|
||||
"autoSkipDelayDescription": "自动跳过前等待 ${seconds} 秒",
|
||||
"introPattern": "片头标记模式",
|
||||
"introPatternDescription": "用于匹配章节标题中片头标记的正则表达式",
|
||||
"creditsPattern": "片尾标记模式",
|
||||
"creditsPatternDescription": "用于匹配章节标题中片尾标记的正则表达式",
|
||||
"invalidRegex": "无效的正则表达式",
|
||||
"downloads": "下载",
|
||||
"downloadLocationDescription": "选择下载内容的存储位置",
|
||||
"downloadLocationDefault": "默认(应用存储)",
|
||||
@@ -514,6 +519,7 @@
|
||||
"playlists": "播放列表"
|
||||
},
|
||||
"groupings": {
|
||||
"title": "分组",
|
||||
"all": "全部",
|
||||
"movies": "电影",
|
||||
"shows": "剧集",
|
||||
|
||||
+43
-9
@@ -28,6 +28,7 @@ import 'providers/offline_mode_provider.dart';
|
||||
import 'providers/offline_watch_provider.dart';
|
||||
import 'providers/companion_remote_provider.dart';
|
||||
import 'providers/shader_provider.dart';
|
||||
import 'utils/snackbar_helper.dart';
|
||||
import 'watch_together/watch_together.dart';
|
||||
import 'services/multi_server_manager.dart';
|
||||
import 'services/offline_watch_sync_service.dart';
|
||||
@@ -53,6 +54,7 @@ import 'utils/log_redaction_manager.dart';
|
||||
import 'package:package_info_plus/package_info_plus.dart';
|
||||
|
||||
const bool _enableSentry = bool.fromEnvironment('ENABLE_SENTRY', defaultValue: false);
|
||||
const String _gitCommit = String.fromEnvironment('GIT_COMMIT');
|
||||
|
||||
// Workaround for Flutter bug #177992: iPadOS 26.1+ misinterprets fake touch events
|
||||
// at (0,0) as barrier taps, causing modals to dismiss immediately.
|
||||
@@ -80,7 +82,9 @@ Future<void> main() async {
|
||||
|
||||
await SentryFlutter.init((options) {
|
||||
options.dsn = 'https://6a1a6ef8c72140099b2798973c1bfb2f@bugs.plezy.app/1';
|
||||
options.release = 'plezy@${packageInfo.version}+${packageInfo.buildNumber}';
|
||||
options.release = _gitCommit.isNotEmpty
|
||||
? 'plezy@${_gitCommit.substring(0, 7)}'
|
||||
: 'plezy@${packageInfo.version}+${packageInfo.buildNumber}';
|
||||
options.tracesSampleRate = 0;
|
||||
options.attachStacktrace = true;
|
||||
options.enableAutoSessionTracking = false;
|
||||
@@ -194,6 +198,11 @@ FutureOr<SentryEvent?> _beforeSend(SentryEvent event, Hint _) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// Drop DBusServiceUnknownException from Linux without NetworkManager
|
||||
if (exceptions != null && exceptions.any((e) => e.type == 'DBusServiceUnknownException')) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// Scrub Plex tokens and server URLs from exception messages
|
||||
if (exceptions != null) {
|
||||
exceptions = exceptions.map((e) {
|
||||
@@ -292,6 +301,9 @@ class _MainAppState extends State<MainApp> with WidgetsBindingObserver {
|
||||
late final DownloadManagerService _downloadManager;
|
||||
late final OfflineWatchSyncService _offlineWatchSyncService;
|
||||
|
||||
/// Last time server health probes ran from a resume event (cooldown for desktop)
|
||||
DateTime _lastResumeProbe = DateTime(0);
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
@@ -326,9 +338,18 @@ class _MainAppState extends State<MainApp> with WidgetsBindingObserver {
|
||||
// App came back to foreground - trigger sync check and start new session
|
||||
_offlineWatchSyncService.onAppResumed();
|
||||
InAppReviewService.instance.startSession();
|
||||
// Re-probe servers — mobile OS may have dropped TCP connections during doze/sleep
|
||||
_serverManager.checkServerHealth();
|
||||
_serverManager.reconnectOfflineServers();
|
||||
// Re-probe servers — mobile OS may have dropped TCP connections during doze/sleep.
|
||||
// On desktop, resumed fires on every window focus (alt-tab), so apply a cooldown
|
||||
// to avoid piling up network probes from rapid alt-tabbing.
|
||||
final now = DateTime.now();
|
||||
final cooldown = (Platform.isIOS || Platform.isAndroid)
|
||||
? const Duration(seconds: 10)
|
||||
: const Duration(minutes: 2);
|
||||
if (now.difference(_lastResumeProbe) >= cooldown) {
|
||||
_lastResumeProbe = now;
|
||||
_serverManager.checkServerHealth();
|
||||
_serverManager.reconnectOfflineServers();
|
||||
}
|
||||
case AppLifecycleState.paused:
|
||||
case AppLifecycleState.detached:
|
||||
// App went to background or is closing - end session
|
||||
@@ -408,6 +429,13 @@ class _MainAppState extends State<MainApp> with WidgetsBindingObserver {
|
||||
themeMode: themeProvider.materialThemeMode,
|
||||
navigatorObservers: [routeObserver, BackKeySuppressorObserver()],
|
||||
home: const OrientationAwareSetup(),
|
||||
builder: (context, child) => ScaffoldMessenger(
|
||||
key: rootScaffoldMessengerKey,
|
||||
child: Scaffold(
|
||||
backgroundColor: Colors.transparent,
|
||||
body: child,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
@@ -472,11 +500,17 @@ class _SetupScreenState extends State<SetupScreen> {
|
||||
|
||||
// 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);
|
||||
bool hasNetwork;
|
||||
try {
|
||||
final connectivityResult = await Connectivity().checkConnectivity().timeout(
|
||||
const Duration(seconds: 3),
|
||||
onTimeout: () => [ConnectivityResult.other],
|
||||
);
|
||||
hasNetwork = !connectivityResult.contains(ConnectivityResult.none);
|
||||
} catch (e) {
|
||||
// connectivity_plus throws DBusServiceUnknownException on Linux without NetworkManager
|
||||
hasNetwork = true;
|
||||
}
|
||||
|
||||
if (hasNetwork) {
|
||||
_setStatus(t.common.refreshingServers);
|
||||
|
||||
@@ -10,47 +10,65 @@ RemoteDevice _$RemoteDeviceFromJson(Map<String, dynamic> json) => RemoteDevice(
|
||||
id: json['id'] as String,
|
||||
name: json['name'] as String,
|
||||
platform: json['platform'] as String,
|
||||
connectedAt: json['connectedAt'] == null ? null : DateTime.parse(json['connectedAt'] as String),
|
||||
capabilities: (json['capabilities'] as Map<String, dynamic>?)?.map((k, e) => MapEntry(k, e as bool)),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$RemoteDeviceToJson(RemoteDevice instance) => <String, dynamic>{
|
||||
'id': instance.id,
|
||||
'name': instance.name,
|
||||
'platform': instance.platform,
|
||||
'connectedAt': instance.connectedAt.toIso8601String(),
|
||||
'capabilities': instance.capabilities,
|
||||
};
|
||||
|
||||
RemoteSession _$RemoteSessionFromJson(Map<String, dynamic> json) => RemoteSession(
|
||||
sessionId: json['sessionId'] as String,
|
||||
pin: json['pin'] as String,
|
||||
role: $enumDecode(_$RemoteSessionRoleEnumMap, json['role'], unknownValue: RemoteSessionRole.remote),
|
||||
status:
|
||||
$enumDecodeNullable(
|
||||
_$RemoteSessionStatusEnumMap,
|
||||
json['status'],
|
||||
unknownValue: RemoteSessionStatus.disconnected,
|
||||
) ??
|
||||
RemoteSessionStatus.disconnected,
|
||||
connectedDevice: json['connectedDevice'] == null
|
||||
connectedAt: json['connectedAt'] == null
|
||||
? null
|
||||
: RemoteDevice.fromJson(json['connectedDevice'] as Map<String, dynamic>),
|
||||
createdAt: json['createdAt'] == null ? null : DateTime.parse(json['createdAt'] as String),
|
||||
errorMessage: json['errorMessage'] as String?,
|
||||
: DateTime.parse(json['connectedAt'] as String),
|
||||
capabilities: (json['capabilities'] as Map<String, dynamic>?)?.map(
|
||||
(k, e) => MapEntry(k, e as bool),
|
||||
),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$RemoteSessionToJson(RemoteSession instance) => <String, dynamic>{
|
||||
'sessionId': instance.sessionId,
|
||||
'pin': instance.pin,
|
||||
'role': _$RemoteSessionRoleEnumMap[instance.role]!,
|
||||
'status': _$RemoteSessionStatusEnumMap[instance.status]!,
|
||||
'connectedDevice': instance.connectedDevice,
|
||||
'createdAt': instance.createdAt.toIso8601String(),
|
||||
'errorMessage': instance.errorMessage,
|
||||
};
|
||||
Map<String, dynamic> _$RemoteDeviceToJson(RemoteDevice instance) =>
|
||||
<String, dynamic>{
|
||||
'id': instance.id,
|
||||
'name': instance.name,
|
||||
'platform': instance.platform,
|
||||
'connectedAt': instance.connectedAt.toIso8601String(),
|
||||
'capabilities': instance.capabilities,
|
||||
};
|
||||
|
||||
const _$RemoteSessionRoleEnumMap = {RemoteSessionRole.host: 'host', RemoteSessionRole.remote: 'remote'};
|
||||
RemoteSession _$RemoteSessionFromJson(Map<String, dynamic> json) =>
|
||||
RemoteSession(
|
||||
sessionId: json['sessionId'] as String,
|
||||
pin: json['pin'] as String,
|
||||
role: $enumDecode(
|
||||
_$RemoteSessionRoleEnumMap,
|
||||
json['role'],
|
||||
unknownValue: RemoteSessionRole.remote,
|
||||
),
|
||||
status:
|
||||
$enumDecodeNullable(
|
||||
_$RemoteSessionStatusEnumMap,
|
||||
json['status'],
|
||||
unknownValue: RemoteSessionStatus.disconnected,
|
||||
) ??
|
||||
RemoteSessionStatus.disconnected,
|
||||
connectedDevice: json['connectedDevice'] == null
|
||||
? null
|
||||
: RemoteDevice.fromJson(
|
||||
json['connectedDevice'] as Map<String, dynamic>,
|
||||
),
|
||||
createdAt: json['createdAt'] == null
|
||||
? null
|
||||
: DateTime.parse(json['createdAt'] as String),
|
||||
errorMessage: json['errorMessage'] as String?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$RemoteSessionToJson(RemoteSession instance) =>
|
||||
<String, dynamic>{
|
||||
'sessionId': instance.sessionId,
|
||||
'pin': instance.pin,
|
||||
'role': _$RemoteSessionRoleEnumMap[instance.role]!,
|
||||
'status': _$RemoteSessionStatusEnumMap[instance.status]!,
|
||||
'connectedDevice': instance.connectedDevice,
|
||||
'createdAt': instance.createdAt.toIso8601String(),
|
||||
'errorMessage': instance.errorMessage,
|
||||
};
|
||||
|
||||
const _$RemoteSessionRoleEnumMap = {
|
||||
RemoteSessionRole.host: 'host',
|
||||
RemoteSessionRole.remote: 'remote',
|
||||
};
|
||||
|
||||
const _$RemoteSessionStatusEnumMap = {
|
||||
RemoteSessionStatus.disconnected: 'disconnected',
|
||||
|
||||
@@ -6,15 +6,23 @@ part of 'play_queue_response.dart';
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
PlayQueueResponse _$PlayQueueResponseFromJson(Map<String, dynamic> json) => PlayQueueResponse(
|
||||
playQueueID: (json['playQueueID'] as num).toInt(),
|
||||
playQueueSelectedItemID: (json['playQueueSelectedItemID'] as num?)?.toInt(),
|
||||
playQueueSelectedItemOffset: (json['playQueueSelectedItemOffset'] as num?)?.toInt(),
|
||||
playQueueSelectedMetadataItemID: json['playQueueSelectedMetadataItemID'] as String?,
|
||||
playQueueShuffled: const BoolOrIntConverter().fromJson(json['playQueueShuffled'] as Object),
|
||||
playQueueSourceURI: json['playQueueSourceURI'] as String?,
|
||||
playQueueTotalCount: (json['playQueueTotalCount'] as num?)?.toInt(),
|
||||
playQueueVersion: (json['playQueueVersion'] as num).toInt(),
|
||||
size: (json['size'] as num?)?.toInt(),
|
||||
items: (json['Metadata'] as List<dynamic>?)?.map((e) => PlexMetadata.fromJson(e as Map<String, dynamic>)).toList(),
|
||||
);
|
||||
PlayQueueResponse _$PlayQueueResponseFromJson(Map<String, dynamic> json) =>
|
||||
PlayQueueResponse(
|
||||
playQueueID: (json['playQueueID'] as num).toInt(),
|
||||
playQueueSelectedItemID: (json['playQueueSelectedItemID'] as num?)
|
||||
?.toInt(),
|
||||
playQueueSelectedItemOffset: (json['playQueueSelectedItemOffset'] as num?)
|
||||
?.toInt(),
|
||||
playQueueSelectedMetadataItemID:
|
||||
json['playQueueSelectedMetadataItemID'] as String?,
|
||||
playQueueShuffled: const BoolOrIntConverter().fromJson(
|
||||
json['playQueueShuffled'] as Object,
|
||||
),
|
||||
playQueueSourceURI: json['playQueueSourceURI'] as String?,
|
||||
playQueueTotalCount: (json['playQueueTotalCount'] as num?)?.toInt(),
|
||||
playQueueVersion: (json['playQueueVersion'] as num).toInt(),
|
||||
size: (json['size'] as num?)?.toInt(),
|
||||
items: (json['Metadata'] as List<dynamic>?)
|
||||
?.map((e) => PlexMetadata.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
);
|
||||
|
||||
@@ -19,15 +19,16 @@ PlexLibrary _$PlexLibraryFromJson(Map<String, dynamic> json) => PlexLibrary(
|
||||
hidden: (json['hidden'] as num?)?.toInt(),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$PlexLibraryToJson(PlexLibrary instance) => <String, dynamic>{
|
||||
'key': instance.key,
|
||||
'title': instance.title,
|
||||
'type': instance.type,
|
||||
'agent': instance.agent,
|
||||
'scanner': instance.scanner,
|
||||
'language': instance.language,
|
||||
'uuid': instance.uuid,
|
||||
'updatedAt': instance.updatedAt,
|
||||
'createdAt': instance.createdAt,
|
||||
'hidden': instance.hidden,
|
||||
};
|
||||
Map<String, dynamic> _$PlexLibraryToJson(PlexLibrary instance) =>
|
||||
<String, dynamic>{
|
||||
'key': instance.key,
|
||||
'title': instance.title,
|
||||
'type': instance.type,
|
||||
'agent': instance.agent,
|
||||
'scanner': instance.scanner,
|
||||
'language': instance.language,
|
||||
'uuid': instance.uuid,
|
||||
'updatedAt': instance.updatedAt,
|
||||
'createdAt': instance.createdAt,
|
||||
'hidden': instance.hidden,
|
||||
};
|
||||
|
||||
@@ -227,29 +227,42 @@ class PlaybackExtras {
|
||||
|
||||
PlaybackExtras({required this.chapters, required this.markers});
|
||||
|
||||
static final _introPattern = RegExp(
|
||||
r'(?:^|\b)(?:intro(?:duction)?|opening)(?:\b|$)|^op(?:\s?\d+)?$',
|
||||
caseSensitive: false,
|
||||
);
|
||||
static final _creditsPattern = RegExp(
|
||||
r'(?:^|\b)(?:outro|closing|credits?|ending)(?:\b|$)|^ed(?:\s?\d+)?$',
|
||||
caseSensitive: false,
|
||||
);
|
||||
|
||||
static String? _classifyChapterTitle(String title) {
|
||||
if (_introPattern.hasMatch(title)) return 'intro';
|
||||
if (_creditsPattern.hasMatch(title)) return 'credits';
|
||||
static String? _classifyChapterTitle(String title, RegExp introPattern, RegExp creditsPattern) {
|
||||
if (introPattern.hasMatch(title)) return 'intro';
|
||||
if (creditsPattern.hasMatch(title)) return 'credits';
|
||||
return null;
|
||||
}
|
||||
|
||||
/// Returns [PlaybackExtras] using real markers when available, otherwise
|
||||
/// synthesises markers from chapter titles matching intro/credits patterns.
|
||||
/// When real markers exist, reclassifies markers with unknown types against
|
||||
/// the patterns so non-standard type strings (e.g. "OP-Song") get recognized.
|
||||
factory PlaybackExtras.withChapterFallback({
|
||||
required List<PlexChapter> chapters,
|
||||
required List<PlexMarker> markers,
|
||||
String? introPatternStr,
|
||||
String? creditsPatternStr,
|
||||
}) {
|
||||
final introPattern = RegExp(
|
||||
introPatternStr ?? r'(?:^|\b)(?:intro(?:duction)?|opening)(?:\b|$)|^op(?:\s?\d+)?$',
|
||||
caseSensitive: false,
|
||||
);
|
||||
final creditsPattern = RegExp(
|
||||
creditsPatternStr ?? r'(?:^|\b)(?:outro|closing|credits?|ending)(?:\b|$)|^ed(?:\s?\d+)?$',
|
||||
caseSensitive: false,
|
||||
);
|
||||
|
||||
if (markers.isNotEmpty) {
|
||||
return PlaybackExtras(chapters: chapters, markers: markers);
|
||||
// Reclassify markers with non-standard types against the patterns
|
||||
final reclassified = markers.map((m) {
|
||||
if (m.type == 'intro' || m.type == 'credits') return m;
|
||||
final newType = _classifyChapterTitle(m.type, introPattern, creditsPattern);
|
||||
if (newType != null) {
|
||||
return PlexMarker(id: m.id, type: newType, startTimeOffset: m.startTimeOffset, endTimeOffset: m.endTimeOffset);
|
||||
}
|
||||
return m;
|
||||
}).toList();
|
||||
return PlaybackExtras(chapters: chapters, markers: reclassified);
|
||||
}
|
||||
|
||||
final synthetic = <PlexMarker>[];
|
||||
@@ -258,7 +271,7 @@ class PlaybackExtras {
|
||||
final title = ch.title;
|
||||
if (title == null || title.isEmpty) continue;
|
||||
|
||||
final type = _classifyChapterTitle(title);
|
||||
final type = _classifyChapterTitle(title, introPattern, creditsPattern);
|
||||
if (type == null) continue;
|
||||
|
||||
final start = ch.startTimeOffset;
|
||||
|
||||
@@ -9,6 +9,15 @@ import '../utils/global_key_utils.dart';
|
||||
|
||||
part 'plex_metadata.g.dart';
|
||||
|
||||
Object? _readRatingKey(Map json, String key) =>
|
||||
json['ratingKey'] ?? json['key'] ?? '';
|
||||
|
||||
int? _flexibleInt(Object? v) => switch (v) {
|
||||
num n => n.toInt(),
|
||||
String s => int.tryParse(s),
|
||||
_ => null,
|
||||
};
|
||||
|
||||
/// Media type enum for type-safe media type handling
|
||||
enum PlexMediaType {
|
||||
movie,
|
||||
@@ -51,12 +60,13 @@ enum PlexMediaType {
|
||||
|
||||
@JsonSerializable()
|
||||
class PlexMetadata with MultiServerFields {
|
||||
@JsonKey(readValue: _readRatingKey)
|
||||
final String ratingKey;
|
||||
final String key;
|
||||
final String? key;
|
||||
final String? guid;
|
||||
final String? studio;
|
||||
final String type;
|
||||
final String title;
|
||||
final String? type;
|
||||
final String? title;
|
||||
final String? titleSort;
|
||||
final String? contentRating;
|
||||
final String? summary;
|
||||
@@ -85,11 +95,13 @@ class PlexMetadata with MultiServerFields {
|
||||
final int? viewCount;
|
||||
final int? leafCount; // Total number of episodes in a series/season
|
||||
final int? viewedLeafCount; // Number of watched episodes in a series/season
|
||||
@JsonKey(fromJson: _flexibleInt)
|
||||
final int? childCount; // Number of items in a collection or playlist
|
||||
@JsonKey(name: 'Role')
|
||||
final List<PlexRole>? role; // Cast members
|
||||
final String? audioLanguage; // Per-media preferred audio language
|
||||
final String? subtitleLanguage; // Per-media preferred subtitle language
|
||||
@JsonKey(fromJson: _flexibleInt)
|
||||
final int? subtitleMode; // Per-media subtitle mode (0=manual, 1=foreign audio, 2=always, -1=account default)
|
||||
final int? playlistItemID; // Playlist item ID (for dumb playlists only)
|
||||
final int? playQueueItemID; // Play queue item ID (unique even for duplicates)
|
||||
@@ -123,7 +135,8 @@ class PlexMetadata with MultiServerFields {
|
||||
|
||||
/// Parsed media type enum for type-safe comparisons
|
||||
PlexMediaType get mediaType {
|
||||
return switch (type.toLowerCase()) {
|
||||
if (type == null) return PlexMediaType.unknown;
|
||||
return switch (type!.toLowerCase()) {
|
||||
'movie' => PlexMediaType.movie,
|
||||
'show' => PlexMediaType.show,
|
||||
'season' => PlexMediaType.season,
|
||||
@@ -141,11 +154,11 @@ class PlexMetadata with MultiServerFields {
|
||||
|
||||
PlexMetadata({
|
||||
required this.ratingKey,
|
||||
required this.key,
|
||||
this.key,
|
||||
this.guid,
|
||||
this.studio,
|
||||
required this.type,
|
||||
required this.title,
|
||||
this.type,
|
||||
this.title,
|
||||
this.titleSort,
|
||||
this.contentRating,
|
||||
this.summary,
|
||||
@@ -354,7 +367,7 @@ class PlexMetadata with MultiServerFields {
|
||||
|
||||
// Helper to get the display title (show name for episodes/seasons, title otherwise)
|
||||
String get displayTitle {
|
||||
final itemType = type.toLowerCase();
|
||||
final itemType = type?.toLowerCase();
|
||||
|
||||
// For episodes and seasons, prefer grandparent title (show name)
|
||||
if ((itemType == 'episode' || itemType == 'season') && grandparentTitle != null) {
|
||||
@@ -364,12 +377,12 @@ class PlexMetadata with MultiServerFields {
|
||||
if (itemType == 'season' && parentTitle != null) {
|
||||
return parentTitle!;
|
||||
}
|
||||
return title;
|
||||
return title ?? '';
|
||||
}
|
||||
|
||||
// Helper to get the subtitle (episode/season title)
|
||||
String? get displaySubtitle {
|
||||
final itemType = type.toLowerCase();
|
||||
final itemType = type?.toLowerCase();
|
||||
|
||||
if (itemType == 'episode' || itemType == 'season') {
|
||||
// If we showed grandparent/parent as title, show this item's title as subtitle
|
||||
@@ -389,7 +402,7 @@ class PlexMetadata with MultiServerFields {
|
||||
/// For movies/shows/seasons in mixed hub context: returns art (16:9 background)
|
||||
/// For other types: returns thumb
|
||||
String? posterThumb({EpisodePosterMode mode = EpisodePosterMode.seriesPoster, bool mixedHubContext = false}) {
|
||||
final itemType = type.toLowerCase();
|
||||
final itemType = type?.toLowerCase();
|
||||
|
||||
if (itemType == 'episode') {
|
||||
switch (mode) {
|
||||
@@ -424,7 +437,7 @@ class PlexMetadata with MultiServerFields {
|
||||
/// Clips (trailers, extras) always use 16:9.
|
||||
/// Movies, shows, and seasons use 16:9 in mixed hub context with episodeThumbnail mode.
|
||||
bool usesWideAspectRatio(EpisodePosterMode mode, {bool mixedHubContext = false}) {
|
||||
final itemType = type.toLowerCase();
|
||||
final itemType = type?.toLowerCase();
|
||||
// Clips (trailers, extras) are always 16:9
|
||||
if (itemType == 'clip') return true;
|
||||
if (itemType == 'episode' && mode == EpisodePosterMode.episodeThumbnail) {
|
||||
@@ -458,10 +471,6 @@ class PlexMetadata with MultiServerFields {
|
||||
}
|
||||
|
||||
factory PlexMetadata.fromJson(Map<String, dynamic> json) {
|
||||
// Plex API returns subtitleMode as a string
|
||||
if (json['subtitleMode'] is String) {
|
||||
json = {...json, 'subtitleMode': num.tryParse(json['subtitleMode'] as String)};
|
||||
}
|
||||
try {
|
||||
return _$PlexMetadataFromJson(kBlurArtwork ? _obfuscateJson(json) : json);
|
||||
} on TypeError catch (e, st) {
|
||||
|
||||
@@ -7,12 +7,12 @@ part of 'plex_metadata.dart';
|
||||
// **************************************************************************
|
||||
|
||||
PlexMetadata _$PlexMetadataFromJson(Map<String, dynamic> json) => PlexMetadata(
|
||||
ratingKey: json['ratingKey'] as String? ?? '',
|
||||
key: json['key'] as String? ?? '',
|
||||
ratingKey: _readRatingKey(json, 'ratingKey') as String,
|
||||
key: json['key'] as String?,
|
||||
guid: json['guid'] as String?,
|
||||
studio: json['studio'] as String?,
|
||||
type: json['type'] as String? ?? 'folder',
|
||||
title: json['title'] as String? ?? '',
|
||||
type: json['type'] as String?,
|
||||
title: json['title'] as String?,
|
||||
titleSort: json['titleSort'] as String?,
|
||||
contentRating: json['contentRating'] as String?,
|
||||
summary: json['summary'] as String?,
|
||||
@@ -41,11 +41,13 @@ PlexMetadata _$PlexMetadataFromJson(Map<String, dynamic> json) => PlexMetadata(
|
||||
viewCount: (json['viewCount'] as num?)?.toInt(),
|
||||
leafCount: (json['leafCount'] as num?)?.toInt(),
|
||||
viewedLeafCount: (json['viewedLeafCount'] as num?)?.toInt(),
|
||||
childCount: (json['childCount'] as num?)?.toInt(),
|
||||
role: (json['Role'] as List<dynamic>?)?.map((e) => PlexRole.fromJson(e as Map<String, dynamic>)).toList(),
|
||||
childCount: _flexibleInt(json['childCount']),
|
||||
role: (json['Role'] as List<dynamic>?)
|
||||
?.map((e) => PlexRole.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
audioLanguage: json['audioLanguage'] as String?,
|
||||
subtitleLanguage: json['subtitleLanguage'] as String?,
|
||||
subtitleMode: (json['subtitleMode'] as num?)?.toInt(),
|
||||
subtitleMode: _flexibleInt(json['subtitleMode']),
|
||||
playlistItemID: (json['playlistItemID'] as num?)?.toInt(),
|
||||
playQueueItemID: (json['playQueueItemID'] as num?)?.toInt(),
|
||||
librarySectionID: (json['librarySectionID'] as num?)?.toInt(),
|
||||
@@ -62,58 +64,59 @@ PlexMetadata _$PlexMetadataFromJson(Map<String, dynamic> json) => PlexMetadata(
|
||||
backgroundSquare: json['backgroundSquare'] as String?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$PlexMetadataToJson(PlexMetadata instance) => <String, dynamic>{
|
||||
'ratingKey': instance.ratingKey,
|
||||
'key': instance.key,
|
||||
'guid': instance.guid,
|
||||
'studio': instance.studio,
|
||||
'type': instance.type,
|
||||
'title': instance.title,
|
||||
'titleSort': instance.titleSort,
|
||||
'contentRating': instance.contentRating,
|
||||
'summary': instance.summary,
|
||||
'rating': instance.rating,
|
||||
'audienceRating': instance.audienceRating,
|
||||
'userRating': instance.userRating,
|
||||
'year': instance.year,
|
||||
'originallyAvailableAt': instance.originallyAvailableAt,
|
||||
'thumb': instance.thumb,
|
||||
'art': instance.art,
|
||||
'duration': instance.duration,
|
||||
'addedAt': instance.addedAt,
|
||||
'updatedAt': instance.updatedAt,
|
||||
'lastViewedAt': instance.lastViewedAt,
|
||||
'grandparentTitle': instance.grandparentTitle,
|
||||
'grandparentThumb': instance.grandparentThumb,
|
||||
'grandparentArt': instance.grandparentArt,
|
||||
'grandparentRatingKey': instance.grandparentRatingKey,
|
||||
'parentTitle': instance.parentTitle,
|
||||
'parentThumb': instance.parentThumb,
|
||||
'parentRatingKey': instance.parentRatingKey,
|
||||
'parentIndex': instance.parentIndex,
|
||||
'index': instance.index,
|
||||
'grandparentTheme': instance.grandparentTheme,
|
||||
'viewOffset': instance.viewOffset,
|
||||
'viewCount': instance.viewCount,
|
||||
'leafCount': instance.leafCount,
|
||||
'viewedLeafCount': instance.viewedLeafCount,
|
||||
'childCount': instance.childCount,
|
||||
'Role': instance.role,
|
||||
'audioLanguage': instance.audioLanguage,
|
||||
'subtitleLanguage': instance.subtitleLanguage,
|
||||
'subtitleMode': instance.subtitleMode,
|
||||
'playlistItemID': instance.playlistItemID,
|
||||
'playQueueItemID': instance.playQueueItemID,
|
||||
'librarySectionID': instance.librarySectionID,
|
||||
'librarySectionTitle': instance.librarySectionTitle,
|
||||
'ratingImage': instance.ratingImage,
|
||||
'audienceRatingImage': instance.audienceRatingImage,
|
||||
'tagline': instance.tagline,
|
||||
'originalTitle': instance.originalTitle,
|
||||
'editionTitle': instance.editionTitle,
|
||||
'subtype': instance.subtype,
|
||||
'extraType': instance.extraType,
|
||||
'primaryExtraKey': instance.primaryExtraKey,
|
||||
'clearLogo': instance.clearLogo,
|
||||
'backgroundSquare': instance.backgroundSquare,
|
||||
};
|
||||
Map<String, dynamic> _$PlexMetadataToJson(PlexMetadata instance) =>
|
||||
<String, dynamic>{
|
||||
'ratingKey': instance.ratingKey,
|
||||
'key': instance.key,
|
||||
'guid': instance.guid,
|
||||
'studio': instance.studio,
|
||||
'type': instance.type,
|
||||
'title': instance.title,
|
||||
'titleSort': instance.titleSort,
|
||||
'contentRating': instance.contentRating,
|
||||
'summary': instance.summary,
|
||||
'rating': instance.rating,
|
||||
'audienceRating': instance.audienceRating,
|
||||
'userRating': instance.userRating,
|
||||
'year': instance.year,
|
||||
'originallyAvailableAt': instance.originallyAvailableAt,
|
||||
'thumb': instance.thumb,
|
||||
'art': instance.art,
|
||||
'duration': instance.duration,
|
||||
'addedAt': instance.addedAt,
|
||||
'updatedAt': instance.updatedAt,
|
||||
'lastViewedAt': instance.lastViewedAt,
|
||||
'grandparentTitle': instance.grandparentTitle,
|
||||
'grandparentThumb': instance.grandparentThumb,
|
||||
'grandparentArt': instance.grandparentArt,
|
||||
'grandparentRatingKey': instance.grandparentRatingKey,
|
||||
'parentTitle': instance.parentTitle,
|
||||
'parentThumb': instance.parentThumb,
|
||||
'parentRatingKey': instance.parentRatingKey,
|
||||
'parentIndex': instance.parentIndex,
|
||||
'index': instance.index,
|
||||
'grandparentTheme': instance.grandparentTheme,
|
||||
'viewOffset': instance.viewOffset,
|
||||
'viewCount': instance.viewCount,
|
||||
'leafCount': instance.leafCount,
|
||||
'viewedLeafCount': instance.viewedLeafCount,
|
||||
'childCount': instance.childCount,
|
||||
'Role': instance.role,
|
||||
'audioLanguage': instance.audioLanguage,
|
||||
'subtitleLanguage': instance.subtitleLanguage,
|
||||
'subtitleMode': instance.subtitleMode,
|
||||
'playlistItemID': instance.playlistItemID,
|
||||
'playQueueItemID': instance.playQueueItemID,
|
||||
'librarySectionID': instance.librarySectionID,
|
||||
'librarySectionTitle': instance.librarySectionTitle,
|
||||
'ratingImage': instance.ratingImage,
|
||||
'audienceRatingImage': instance.audienceRatingImage,
|
||||
'tagline': instance.tagline,
|
||||
'originalTitle': instance.originalTitle,
|
||||
'editionTitle': instance.editionTitle,
|
||||
'subtype': instance.subtype,
|
||||
'extraType': instance.extraType,
|
||||
'primaryExtraKey': instance.primaryExtraKey,
|
||||
'clearLogo': instance.clearLogo,
|
||||
'backgroundSquare': instance.backgroundSquare,
|
||||
};
|
||||
|
||||
@@ -26,22 +26,23 @@ PlexPlaylist _$PlexPlaylistFromJson(Map<String, dynamic> json) => PlexPlaylist(
|
||||
thumb: json['thumb'] as String?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$PlexPlaylistToJson(PlexPlaylist instance) => <String, dynamic>{
|
||||
'ratingKey': instance.ratingKey,
|
||||
'key': instance.key,
|
||||
'type': instance.type,
|
||||
'title': instance.title,
|
||||
'summary': instance.summary,
|
||||
'smart': instance.smart,
|
||||
'playlistType': instance.playlistType,
|
||||
'duration': instance.duration,
|
||||
'leafCount': instance.leafCount,
|
||||
'composite': instance.composite,
|
||||
'addedAt': instance.addedAt,
|
||||
'updatedAt': instance.updatedAt,
|
||||
'lastViewedAt': instance.lastViewedAt,
|
||||
'viewCount': instance.viewCount,
|
||||
'content': instance.content,
|
||||
'guid': instance.guid,
|
||||
'thumb': instance.thumb,
|
||||
};
|
||||
Map<String, dynamic> _$PlexPlaylistToJson(PlexPlaylist instance) =>
|
||||
<String, dynamic>{
|
||||
'ratingKey': instance.ratingKey,
|
||||
'key': instance.key,
|
||||
'type': instance.type,
|
||||
'title': instance.title,
|
||||
'summary': instance.summary,
|
||||
'smart': instance.smart,
|
||||
'playlistType': instance.playlistType,
|
||||
'duration': instance.duration,
|
||||
'leafCount': instance.leafCount,
|
||||
'composite': instance.composite,
|
||||
'addedAt': instance.addedAt,
|
||||
'updatedAt': instance.updatedAt,
|
||||
'lastViewedAt': instance.lastViewedAt,
|
||||
'viewCount': instance.viewCount,
|
||||
'content': instance.content,
|
||||
'guid': instance.guid,
|
||||
'thumb': instance.thumb,
|
||||
};
|
||||
|
||||
@@ -515,10 +515,10 @@ class DownloadProvider extends ChangeNotifier {
|
||||
}
|
||||
|
||||
// We have metadata, check type
|
||||
final type = meta.type.toLowerCase();
|
||||
if (type == 'show') {
|
||||
final mt = meta.mediaType;
|
||||
if (mt == PlexMediaType.show) {
|
||||
return getAggregateProgressForShow(serverId, ratingKey);
|
||||
} else if (type == 'season') {
|
||||
} else if (mt == PlexMediaType.season) {
|
||||
return getAggregateProgressForSeason(serverId, ratingKey);
|
||||
}
|
||||
|
||||
@@ -606,19 +606,19 @@ class DownloadProvider extends ChangeNotifier {
|
||||
_queueing.add(globalKey);
|
||||
notifyListeners();
|
||||
|
||||
final type = metadata.type.toLowerCase();
|
||||
final mt = metadata.mediaType;
|
||||
|
||||
if (type == 'movie' || type == 'episode') {
|
||||
if (mt == PlexMediaType.movie || mt == PlexMediaType.episode) {
|
||||
// Direct download of a single item
|
||||
await _queueSingleDownload(metadata, client);
|
||||
return 1;
|
||||
} else if (type == 'show') {
|
||||
} else if (mt == PlexMediaType.show) {
|
||||
// Store show metadata so getProgress() can identify it as a show
|
||||
_metadata[globalKey] = metadata;
|
||||
|
||||
// Download all episodes from all seasons
|
||||
return await _queueShowDownload(metadata, client);
|
||||
} else if (type == 'season') {
|
||||
} else if (mt == PlexMediaType.season) {
|
||||
// Store season metadata so getProgress() can identify it as a season
|
||||
_metadata[globalKey] = metadata;
|
||||
|
||||
@@ -765,11 +765,11 @@ class DownloadProvider extends ChangeNotifier {
|
||||
/// Used for resuming partial downloads
|
||||
/// Returns the number of episodes queued
|
||||
Future<int> queueMissingEpisodes(PlexMetadata metadata, PlexClient client) async {
|
||||
final type = metadata.type.toLowerCase();
|
||||
final mt = metadata.mediaType;
|
||||
|
||||
if (type == 'show') {
|
||||
if (mt == PlexMediaType.show) {
|
||||
return await _queueMissingShowEpisodes(metadata, client);
|
||||
} else if (type == 'season') {
|
||||
} else if (mt == PlexMediaType.season) {
|
||||
return await _queueMissingSeasonEpisodes(metadata, client);
|
||||
} else {
|
||||
throw Exception('queueMissingEpisodes only supports shows/seasons');
|
||||
|
||||
@@ -48,9 +48,9 @@ class OfflineModeProvider extends ChangeNotifier {
|
||||
// Check initial connectivity
|
||||
await _updateConnectionFlags();
|
||||
|
||||
// Monitor connectivity changes — wrapped in try-catch because
|
||||
// connectivity_plus can throw synchronously on Windows (NetworkManager::StartListen)
|
||||
try {
|
||||
// Monitor connectivity changes — runZonedGuarded catches async errors from
|
||||
// connectivity_plus (e.g. DBusServiceUnknownException on Linux without NetworkManager)
|
||||
runZonedGuarded(() {
|
||||
_connectivitySubscription = Connectivity().onConnectivityChanged.listen(
|
||||
(results) {
|
||||
final wasOffline = isOffline;
|
||||
@@ -61,14 +61,13 @@ class OfflineModeProvider extends ChangeNotifier {
|
||||
}
|
||||
},
|
||||
onError: (e) {
|
||||
// Assume network available on stream error
|
||||
_hasNetworkConnection = true;
|
||||
},
|
||||
);
|
||||
} catch (e) {
|
||||
// Assume network available if stream activation fails
|
||||
}, (error, stack) {
|
||||
// connectivity_plus throws DBusServiceUnknownException on Linux without NetworkManager
|
||||
_hasNetworkConnection = true;
|
||||
}
|
||||
});
|
||||
|
||||
// Monitor server status from MultiServerManager
|
||||
_serverStatusSubscription = _serverManager.statusStream.listen((statusMap) {
|
||||
|
||||
@@ -31,7 +31,7 @@ class _CollectionDetailScreenState extends BaseMediaListDetailScreen<CollectionD
|
||||
PlexMetadata get mediaItem => widget.collection;
|
||||
|
||||
@override
|
||||
String get title => widget.collection.title;
|
||||
String get title => widget.collection.title!;
|
||||
|
||||
@override
|
||||
String get emptyMessage => t.collections.empty;
|
||||
@@ -93,7 +93,7 @@ class _CollectionDetailScreenState extends BaseMediaListDetailScreen<CollectionD
|
||||
final confirmed = await showDeleteConfirmation(
|
||||
context,
|
||||
title: t.collections.deleteCollection,
|
||||
message: t.collections.deleteConfirm(title: widget.collection.title),
|
||||
message: t.collections.deleteConfirm(title: widget.collection.displayTitle),
|
||||
);
|
||||
|
||||
if (!confirmed) return;
|
||||
@@ -134,7 +134,7 @@ class _CollectionDetailScreenState extends BaseMediaListDetailScreen<CollectionD
|
||||
body: CustomScrollView(
|
||||
controller: scrollController,
|
||||
slivers: [
|
||||
CustomAppBar(title: Text(widget.collection.title), actions: buildFocusableAppBarActions()),
|
||||
CustomAppBar(title: Text(widget.collection.title!), actions: buildFocusableAppBarActions()),
|
||||
...buildStateSlivers(),
|
||||
if (items.isNotEmpty)
|
||||
buildFocusableGrid(
|
||||
|
||||
@@ -1263,7 +1263,7 @@ class _DiscoverScreenState extends State<DiscoverScreen>
|
||||
|
||||
Widget _buildHeroItem(PlexMetadata heroItem, double heroHeight) {
|
||||
final isEpisode = heroItem.isEpisode;
|
||||
final showName = heroItem.grandparentTitle ?? heroItem.title;
|
||||
final showName = heroItem.grandparentTitle ?? heroItem.displayTitle;
|
||||
final screenWidth = MediaQuery.of(context).size.width;
|
||||
final isLargeScreen = ScreenBreakpoints.isWideTabletOrLarger(screenWidth);
|
||||
|
||||
|
||||
@@ -180,7 +180,7 @@ class _HubDetailScreenState extends State<HubDetailScreen>
|
||||
switch (sortKey) {
|
||||
case 'titleSort':
|
||||
case 'title':
|
||||
comparison = a.title.compareTo(b.title);
|
||||
comparison = (a.title ?? '').compareTo(b.title ?? '');
|
||||
break;
|
||||
case 'addedAt':
|
||||
comparison = (a.addedAt ?? 0).compareTo(b.addedAt ?? 0);
|
||||
@@ -193,7 +193,7 @@ class _HubDetailScreenState extends State<HubDetailScreen>
|
||||
comparison = (a.rating ?? 0).compareTo(b.rating ?? 0);
|
||||
break;
|
||||
default:
|
||||
comparison = a.title.compareTo(b.title);
|
||||
comparison = (a.title ?? '').compareTo(b.title ?? '');
|
||||
}
|
||||
|
||||
return _isSortDescending ? -comparison : comparison;
|
||||
|
||||
@@ -42,21 +42,14 @@ class FolderTreeItem extends StatelessWidget {
|
||||
}
|
||||
|
||||
// File icons based on type
|
||||
final type = item.type.toLowerCase();
|
||||
switch (type) {
|
||||
case 'movie':
|
||||
return Symbols.movie_rounded;
|
||||
case 'show':
|
||||
return Symbols.tv_rounded;
|
||||
case 'season':
|
||||
return Symbols.video_library_rounded;
|
||||
case 'episode':
|
||||
return Symbols.play_circle_rounded;
|
||||
case 'collection':
|
||||
return Symbols.collections_rounded;
|
||||
default:
|
||||
return Symbols.insert_drive_file_rounded;
|
||||
}
|
||||
return switch (item.mediaType) {
|
||||
PlexMediaType.movie => Symbols.movie_rounded,
|
||||
PlexMediaType.show => Symbols.tv_rounded,
|
||||
PlexMediaType.season => Symbols.video_library_rounded,
|
||||
PlexMediaType.episode => Symbols.play_circle_rounded,
|
||||
PlexMediaType.collection => Symbols.collections_rounded,
|
||||
_ => Symbols.insert_drive_file_rounded,
|
||||
};
|
||||
}
|
||||
|
||||
void _handleTap() {
|
||||
@@ -104,7 +97,7 @@ class FolderTreeItem extends StatelessWidget {
|
||||
// Item title
|
||||
Expanded(
|
||||
child: Text(
|
||||
item.title,
|
||||
item.displayTitle,
|
||||
style: TextStyle(fontSize: 14, fontWeight: isFolder ? FontWeight.w500 : FontWeight.w400),
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
|
||||
@@ -87,32 +87,32 @@ class _FolderTreeViewState extends State<FolderTreeView> {
|
||||
|
||||
Future<void> _loadFolderChildren(PlexMetadata folder) async {
|
||||
// Already loading this folder
|
||||
if (_loadingFolders.contains(folder.key)) return;
|
||||
if (_loadingFolders.contains(folder.key!)) return;
|
||||
|
||||
// Already loaded and cached
|
||||
if (_childrenCache.containsKey(folder.key)) {
|
||||
if (_childrenCache.containsKey(folder.key!)) {
|
||||
setState(() {
|
||||
_expandedFolders.add(folder.key);
|
||||
_expandedFolders.add(folder.key!);
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
setState(() {
|
||||
_loadingFolders.add(folder.key);
|
||||
_loadingFolders.add(folder.key!);
|
||||
});
|
||||
|
||||
try {
|
||||
final client = context.getClientForServer(widget.serverId!);
|
||||
|
||||
// Items are automatically tagged with server info by PlexClient
|
||||
final children = await client.getFolderChildren(folder.key);
|
||||
final children = await client.getFolderChildren(folder.key!);
|
||||
|
||||
if (!mounted) return;
|
||||
|
||||
setState(() {
|
||||
_childrenCache[folder.key] = children;
|
||||
_expandedFolders.add(folder.key);
|
||||
_loadingFolders.remove(folder.key);
|
||||
_childrenCache[folder.key!] = children;
|
||||
_expandedFolders.add(folder.key!);
|
||||
_loadingFolders.remove(folder.key!);
|
||||
});
|
||||
|
||||
appLogger.d('Loaded ${children.length} children for folder: ${folder.title}');
|
||||
@@ -121,7 +121,7 @@ class _FolderTreeViewState extends State<FolderTreeView> {
|
||||
|
||||
appLogger.e('Failed to load folder children', error: e);
|
||||
setState(() {
|
||||
_loadingFolders.remove(folder.key);
|
||||
_loadingFolders.remove(folder.key!);
|
||||
});
|
||||
|
||||
if (mounted) {
|
||||
@@ -131,9 +131,9 @@ class _FolderTreeViewState extends State<FolderTreeView> {
|
||||
}
|
||||
|
||||
void _toggleFolder(PlexMetadata folder) {
|
||||
if (_expandedFolders.contains(folder.key)) {
|
||||
if (_expandedFolders.contains(folder.key!)) {
|
||||
setState(() {
|
||||
_expandedFolders.remove(folder.key);
|
||||
_expandedFolders.remove(folder.key!);
|
||||
});
|
||||
} else {
|
||||
_loadFolderChildren(folder);
|
||||
@@ -147,19 +147,19 @@ class _FolderTreeViewState extends State<FolderTreeView> {
|
||||
Future<void> _handleFolderPlay(PlexMetadata folder) async {
|
||||
final client = context.getClientForServer(widget.serverId!);
|
||||
final launcher = PlayQueueLauncher(context: context, client: client, serverId: widget.serverId);
|
||||
await launcher.launchFromFolder(folderKey: folder.key, shuffle: false);
|
||||
await launcher.launchFromFolder(folderKey: folder.key!, shuffle: false);
|
||||
}
|
||||
|
||||
Future<void> _handleFolderShuffle(PlexMetadata folder) async {
|
||||
final client = context.getClientForServer(widget.serverId!);
|
||||
final launcher = PlayQueueLauncher(context: context, client: client, serverId: widget.serverId);
|
||||
await launcher.launchFromFolder(folderKey: folder.key, shuffle: true);
|
||||
await launcher.launchFromFolder(folderKey: folder.key!, shuffle: true);
|
||||
}
|
||||
|
||||
bool _isFolder(PlexMetadata item) {
|
||||
// Folders typically don't have a specific type or might have special indicators
|
||||
// Check for common folder indicators
|
||||
return item.key.contains('/folder') || item.type.isEmpty || item.type.toLowerCase() == 'folder';
|
||||
return item.key?.contains('/folder') == true || item.type == null || item.type!.isEmpty || item.mediaType == PlexMediaType.unknown;
|
||||
}
|
||||
|
||||
List<Widget> _buildTreeItems(List<PlexMetadata> items, int depth, [String parentPath = '']) {
|
||||
|
||||
@@ -219,6 +219,9 @@ class _LibrariesScreenState extends State<LibrariesScreen>
|
||||
if (tabController.indexIsChanging) {
|
||||
return;
|
||||
}
|
||||
// On mobile (touch mode), skip auto-focus to prevent ensureVisible()
|
||||
// from interfering with TabBarView page animations
|
||||
if (!InputModeTracker.isKeyboardMode(context)) return;
|
||||
|
||||
// Re-enable auto-focus since user is navigating into tab content
|
||||
// Only call setState if the value actually changes to avoid unnecessary rebuilds
|
||||
@@ -1064,38 +1067,50 @@ class _LibrariesScreenState extends State<LibrariesScreen>
|
||||
// Disable swipe on desktop - trackpad scrolling triggers accidental tab switches
|
||||
// See: https://github.com/flutter/flutter/issues/11132
|
||||
physics: PlatformDetector.isDesktop(context) ? const NeverScrollableScrollPhysics() : null,
|
||||
// Wrap each tab in ClipRect so horizontal overflow (e.g. hub rows
|
||||
// with Clip.none) doesn't bleed into adjacent tabs during swipe transitions.
|
||||
// The TabBarView's own clipBehavior only clips at the viewport level,
|
||||
// not per-page, so we need per-child clipping.
|
||||
children: [
|
||||
LibraryRecommendedTab(
|
||||
key: _recommendedTabKey,
|
||||
library: allLibraries.firstWhere((lib) => lib.globalKey == _selectedLibraryGlobalKey),
|
||||
isActive: tabController.index == 0,
|
||||
suppressAutoFocus: suppressAutoFocus,
|
||||
onDataLoaded: () => _handleTabDataLoaded(0),
|
||||
onBack: focusTabBar,
|
||||
ClipRect(
|
||||
child: LibraryRecommendedTab(
|
||||
key: _recommendedTabKey,
|
||||
library: allLibraries.firstWhere((lib) => lib.globalKey == _selectedLibraryGlobalKey),
|
||||
isActive: tabController.index == 0,
|
||||
suppressAutoFocus: suppressAutoFocus,
|
||||
onDataLoaded: () => _handleTabDataLoaded(0),
|
||||
onBack: focusTabBar,
|
||||
),
|
||||
),
|
||||
LibraryBrowseTab(
|
||||
key: _browseTabKey,
|
||||
library: allLibraries.firstWhere((lib) => lib.globalKey == _selectedLibraryGlobalKey),
|
||||
isActive: tabController.index == 1,
|
||||
suppressAutoFocus: suppressAutoFocus,
|
||||
onDataLoaded: () => _handleTabDataLoaded(1),
|
||||
onBack: focusTabBar,
|
||||
ClipRect(
|
||||
child: LibraryBrowseTab(
|
||||
key: _browseTabKey,
|
||||
library: allLibraries.firstWhere((lib) => lib.globalKey == _selectedLibraryGlobalKey),
|
||||
isActive: tabController.index == 1,
|
||||
suppressAutoFocus: suppressAutoFocus,
|
||||
onDataLoaded: () => _handleTabDataLoaded(1),
|
||||
onBack: focusTabBar,
|
||||
),
|
||||
),
|
||||
LibraryCollectionsTab(
|
||||
key: _collectionsTabKey,
|
||||
library: allLibraries.firstWhere((lib) => lib.globalKey == _selectedLibraryGlobalKey),
|
||||
isActive: tabController.index == 2,
|
||||
suppressAutoFocus: suppressAutoFocus,
|
||||
onDataLoaded: () => _handleTabDataLoaded(2),
|
||||
onBack: focusTabBar,
|
||||
ClipRect(
|
||||
child: LibraryCollectionsTab(
|
||||
key: _collectionsTabKey,
|
||||
library: allLibraries.firstWhere((lib) => lib.globalKey == _selectedLibraryGlobalKey),
|
||||
isActive: tabController.index == 2,
|
||||
suppressAutoFocus: suppressAutoFocus,
|
||||
onDataLoaded: () => _handleTabDataLoaded(2),
|
||||
onBack: focusTabBar,
|
||||
),
|
||||
),
|
||||
LibraryPlaylistsTab(
|
||||
key: _playlistsTabKey,
|
||||
library: allLibraries.firstWhere((lib) => lib.globalKey == _selectedLibraryGlobalKey),
|
||||
isActive: tabController.index == 3,
|
||||
suppressAutoFocus: suppressAutoFocus,
|
||||
onDataLoaded: () => _handleTabDataLoaded(3),
|
||||
onBack: focusTabBar,
|
||||
ClipRect(
|
||||
child: LibraryPlaylistsTab(
|
||||
key: _playlistsTabKey,
|
||||
library: allLibraries.firstWhere((lib) => lib.globalKey == _selectedLibraryGlobalKey),
|
||||
isActive: tabController.index == 3,
|
||||
suppressAutoFocus: suppressAutoFocus,
|
||||
onDataLoaded: () => _handleTabDataLoaded(3),
|
||||
onBack: focusTabBar,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
@@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
|
||||
import 'package:plezy/widgets/app_icon.dart';
|
||||
import 'package:material_symbols_icons/symbols.dart';
|
||||
import '../../focus/dpad_navigator.dart';
|
||||
import '../../focus/input_mode_tracker.dart';
|
||||
import '../../models/plex_sort.dart';
|
||||
import '../../widgets/bottom_sheet_header.dart';
|
||||
import '../../widgets/focusable_list_tile.dart';
|
||||
@@ -41,6 +42,7 @@ class _SortBottomSheetState extends State<SortBottomSheet> {
|
||||
_initialFocusNode = FocusNode(debugLabel: 'SortBottomSheetInitialFocus');
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
if (!mounted) return;
|
||||
if (!InputModeTracker.isKeyboardMode(context)) return;
|
||||
final ctx = _initialFocusNode.context;
|
||||
if (ctx != null) {
|
||||
Scrollable.ensureVisible(ctx, alignment: 0.5);
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import 'dart:async';
|
||||
import 'package:flutter/material.dart';
|
||||
import '../../../focus/input_mode_tracker.dart';
|
||||
import '../../../models/plex_library.dart';
|
||||
import '../../../utils/app_logger.dart';
|
||||
import '../../../mixins/library_tab_state.dart';
|
||||
@@ -164,6 +165,9 @@ abstract class BaseLibraryTabState<T, W extends BaseLibraryTab<T>> extends State
|
||||
void tryFocus() {
|
||||
// Don't auto-focus if suppressed (e.g., when navigating via tab bar)
|
||||
if (widget.suppressAutoFocus) return;
|
||||
// On mobile (touch mode), skip auto-focus to prevent ensureVisible()
|
||||
// from interfering with TabBarView page animations
|
||||
if (!InputModeTracker.isKeyboardMode(context)) return;
|
||||
|
||||
if (widget.isActive && _hasLoadedData && !hasFocused && _items.isNotEmpty) {
|
||||
hasFocused = true;
|
||||
|
||||
@@ -5,6 +5,7 @@ import 'package:material_symbols_icons/symbols.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:dio/dio.dart';
|
||||
import '../../../focus/dpad_navigator.dart';
|
||||
import '../../../focus/input_mode_tracker.dart';
|
||||
import '../../../../services/plex_client.dart';
|
||||
import '../../../models/plex_metadata.dart';
|
||||
import '../../../models/plex_filter.dart';
|
||||
@@ -26,6 +27,8 @@ import '../../../mixins/library_tab_focus_mixin.dart';
|
||||
import '../folder_tree_view.dart';
|
||||
import '../filters_bottom_sheet.dart';
|
||||
import '../sort_bottom_sheet.dart';
|
||||
import '../../../widgets/app_icon.dart';
|
||||
import '../../../widgets/focusable_list_tile.dart';
|
||||
import '../state_messages.dart';
|
||||
import '../../../services/storage_service.dart';
|
||||
import '../../../services/settings_service.dart' show ViewMode, EpisodePosterMode;
|
||||
@@ -224,6 +227,9 @@ class _LibraryBrowseTabState extends BaseLibraryTabState<PlexMetadata, LibraryBr
|
||||
@override
|
||||
void tryFocus() {
|
||||
if (widget.suppressAutoFocus) return;
|
||||
// On mobile (touch mode), skip auto-focus to prevent ensureVisible()
|
||||
// from interfering with TabBarView page animations
|
||||
if (!InputModeTracker.isKeyboardMode(context)) return;
|
||||
if (widget.isActive && hasLoadedData && !hasFocused && _loadedItems.isNotEmpty) {
|
||||
hasFocused = true;
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
@@ -605,49 +611,54 @@ class _LibraryBrowseTabState extends BaseLibraryTabState<PlexMetadata, LibraryBr
|
||||
|
||||
void _showGroupingBottomSheet() {
|
||||
SelectKeyUpSuppressor.suppressSelectUntilKeyUp();
|
||||
var pendingGrouping = _selectedGrouping;
|
||||
OverlaySheetController.of(context)
|
||||
.show(
|
||||
builder: (sheetContext) {
|
||||
final options = _getGroupingOptions();
|
||||
return StatefulBuilder(
|
||||
builder: (context, setSheetState) {
|
||||
return RadioGroup<String>(
|
||||
groupValue: pendingGrouping,
|
||||
onChanged: (value) {
|
||||
if (value == null) return;
|
||||
setSheetState(() {
|
||||
pendingGrouping = value;
|
||||
});
|
||||
},
|
||||
child: ListView.builder(
|
||||
shrinkWrap: true,
|
||||
itemCount: options.length,
|
||||
itemBuilder: (context, index) {
|
||||
final grouping = options[index];
|
||||
return RadioListTile<String>(
|
||||
title: Text(_getGroupingLabel(grouping)),
|
||||
value: grouping,
|
||||
);
|
||||
},
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
},
|
||||
)
|
||||
.then((_) {
|
||||
if (!mounted) return;
|
||||
if (pendingGrouping == _selectedGrouping) return;
|
||||
setState(() {
|
||||
_selectedGrouping = pendingGrouping;
|
||||
});
|
||||
StorageService.getInstance().then((storage) {
|
||||
storage.saveLibraryGrouping(widget.library.globalKey, pendingGrouping);
|
||||
});
|
||||
_loadItems();
|
||||
_loadFirstCharacters();
|
||||
});
|
||||
final options = _getGroupingOptions();
|
||||
final controller = OverlaySheetController.of(context);
|
||||
controller.show<String>(
|
||||
showDragHandle: true,
|
||||
builder: (sheetContext) => Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.fromLTRB(16, 4, 16, 8),
|
||||
child: Text(
|
||||
t.libraries.groupings.title,
|
||||
style: Theme.of(sheetContext).textTheme.titleMedium,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
),
|
||||
Flexible(
|
||||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: options.map((grouping) {
|
||||
final isSelected = _selectedGrouping == grouping;
|
||||
return FocusableListTile(
|
||||
dense: true,
|
||||
leading: AppIcon(
|
||||
isSelected ? Symbols.radio_button_checked_rounded : Symbols.radio_button_unchecked_rounded,
|
||||
fill: 1,
|
||||
),
|
||||
title: Text(_getGroupingLabel(grouping)),
|
||||
onTap: () => controller.close(grouping),
|
||||
);
|
||||
}).toList(),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
).then((value) {
|
||||
if (!mounted || value == null || value == _selectedGrouping) return;
|
||||
setState(() {
|
||||
_selectedGrouping = value;
|
||||
});
|
||||
StorageService.getInstance().then((storage) {
|
||||
storage.saveLibraryGrouping(widget.library.globalKey, value);
|
||||
});
|
||||
_loadItems();
|
||||
_loadFirstCharacters();
|
||||
});
|
||||
}
|
||||
|
||||
void _showFiltersBottomSheet() {
|
||||
|
||||
@@ -970,7 +970,8 @@ class GuideTabState extends State<GuideTab> {
|
||||
channel,
|
||||
program,
|
||||
theme,
|
||||
isLast: program == programs.last,
|
||||
isFirst: progStart == gridStartEpoch,
|
||||
isLast: program == programs.last && progEnd != gridEndEpoch,
|
||||
isFocused: identical(program, focusProg),
|
||||
),
|
||||
),
|
||||
@@ -990,6 +991,7 @@ class GuideTabState extends State<GuideTab> {
|
||||
LiveTvChannel channel,
|
||||
LiveTvProgram program,
|
||||
ThemeData theme, {
|
||||
bool isFirst = false,
|
||||
bool isLast = false,
|
||||
bool isFocused = false,
|
||||
}) {
|
||||
@@ -998,11 +1000,11 @@ class GuideTabState extends State<GuideTab> {
|
||||
|
||||
Color materialColor;
|
||||
if (isFocused) {
|
||||
materialColor = theme.colorScheme.primary.withValues(alpha: 0.25);
|
||||
materialColor = theme.colorScheme.primary.withValues(alpha: 0.15);
|
||||
} else if (isCurrentlyAiring) {
|
||||
materialColor = theme.colorScheme.onSurface.withValues(alpha: 0.3);
|
||||
} else {
|
||||
materialColor = theme.colorScheme.onSurface.withValues(alpha: 0.12);
|
||||
} else {
|
||||
materialColor = theme.colorScheme.onSurface.withValues(alpha: 0.05);
|
||||
}
|
||||
|
||||
Color titleColor;
|
||||
@@ -1036,7 +1038,7 @@ class GuideTabState extends State<GuideTab> {
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
border: Border(
|
||||
left: BorderSide(color: theme.dividerColor.withValues(alpha: 0.3)),
|
||||
left: isFirst ? BorderSide.none : BorderSide(color: theme.dividerColor.withValues(alpha: 0.3)),
|
||||
right: isLast ? BorderSide(color: theme.dividerColor.withValues(alpha: 0.3)) : BorderSide.none,
|
||||
),
|
||||
),
|
||||
@@ -1049,8 +1051,8 @@ class GuideTabState extends State<GuideTab> {
|
||||
children: [
|
||||
Text(
|
||||
program.grandparentTitle ?? program.title,
|
||||
style: theme.textTheme.bodySmall?.copyWith(
|
||||
fontWeight: isCurrentlyAiring ? FontWeight.w600 : FontWeight.normal,
|
||||
style: theme.textTheme.bodyMedium?.copyWith(
|
||||
fontWeight: FontWeight.w600,
|
||||
color: titleColor,
|
||||
),
|
||||
maxLines: 1,
|
||||
|
||||
@@ -11,6 +11,7 @@ import '../../../focus/locked_hub_controller.dart';
|
||||
import '../../../i18n/strings.g.dart';
|
||||
import '../../../models/livetv_channel.dart';
|
||||
import '../../../models/livetv_hub_result.dart';
|
||||
import '../../../models/plex_metadata.dart';
|
||||
import '../../../providers/multi_server_provider.dart';
|
||||
import '../../../providers/settings_provider.dart';
|
||||
import '../../../services/settings_service.dart' show LibraryDensity;
|
||||
@@ -168,12 +169,12 @@ class WhatsOnTabState extends State<WhatsOnTab> {
|
||||
if (entry.program.isCurrentlyAiring && channel != null) {
|
||||
// Live → play directly
|
||||
_tuneChannel(channel);
|
||||
} else if (entry.metadata.type.toLowerCase() == 'show') {
|
||||
} else if (entry.metadata.mediaType == PlexMediaType.show) {
|
||||
// Show with upcoming episodes → show full schedule
|
||||
Navigator.of(context).push(
|
||||
MaterialPageRoute(
|
||||
builder: (_) => LiveTvShowScheduleScreen(
|
||||
showTitle: entry.metadata.title,
|
||||
showTitle: entry.metadata.displayTitle,
|
||||
serverId: entry.metadata.serverId ?? '',
|
||||
channels: widget.channels,
|
||||
),
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -237,9 +237,9 @@ class _PlaylistItemCardState extends State<PlaylistItemCard> {
|
||||
}
|
||||
|
||||
String _buildSubtitle() {
|
||||
final itemType = widget.item.type.toLowerCase();
|
||||
final itemType = widget.item.mediaType;
|
||||
|
||||
if (itemType == 'episode') {
|
||||
if (itemType == PlexMediaType.episode) {
|
||||
// For episodes, show "S#E# - Episode Title"
|
||||
final season = widget.item.parentIndex;
|
||||
final episode = widget.item.index;
|
||||
@@ -247,7 +247,7 @@ class _PlaylistItemCardState extends State<PlaylistItemCard> {
|
||||
return 'S${season}E$episode${widget.item.displaySubtitle != null ? ' - ${widget.item.displaySubtitle}' : ''}';
|
||||
}
|
||||
return widget.item.displaySubtitle ?? t.discover.tvShow;
|
||||
} else if (itemType == 'movie') {
|
||||
} else if (itemType == PlexMediaType.movie) {
|
||||
// For movies, show year and edition
|
||||
final year = widget.item.year?.toString();
|
||||
if (year != null && widget.item.editionTitle != null) {
|
||||
@@ -257,6 +257,6 @@ class _PlaylistItemCardState extends State<PlaylistItemCard> {
|
||||
}
|
||||
|
||||
// Default to type
|
||||
return widget.item.type;
|
||||
return widget.item.mediaType.name;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -98,6 +98,8 @@ class _SettingsScreenState extends State<SettingsScreen> with FocusableTab {
|
||||
static const _kAutoSkipIntro = 'auto_skip_intro';
|
||||
static const _kAutoSkipCredits = 'auto_skip_credits';
|
||||
static const _kAutoSkipDelay = 'auto_skip_delay';
|
||||
static const _kIntroPattern = 'intro_pattern';
|
||||
static const _kCreditsPattern = 'credits_pattern';
|
||||
static const _kDownloadLocation = 'download_location';
|
||||
static const _kDownloadOnWifiOnly = 'download_on_wifi_only';
|
||||
static const _kVideoPlayerControls = 'video_player_controls';
|
||||
@@ -125,6 +127,8 @@ class _SettingsScreenState extends State<SettingsScreen> with FocusableTab {
|
||||
bool _autoSkipIntro = false;
|
||||
bool _autoSkipCredits = false;
|
||||
int _autoSkipDelay = 5;
|
||||
String _introPattern = settings.SettingsService.defaultIntroPattern;
|
||||
String _creditsPattern = settings.SettingsService.defaultCreditsPattern;
|
||||
bool _downloadOnWifiOnly = false;
|
||||
bool _videoPlayerNavigationEnabled = false;
|
||||
int _maxVolume = 100;
|
||||
@@ -202,6 +206,8 @@ class _SettingsScreenState extends State<SettingsScreen> with FocusableTab {
|
||||
_autoSkipIntro = _settingsService.getAutoSkipIntro();
|
||||
_autoSkipCredits = _settingsService.getAutoSkipCredits();
|
||||
_autoSkipDelay = _settingsService.getAutoSkipDelay();
|
||||
_introPattern = _settingsService.getIntroPattern();
|
||||
_creditsPattern = _settingsService.getCreditsPattern();
|
||||
_downloadOnWifiOnly = _settingsService.getDownloadOnWifiOnly();
|
||||
_videoPlayerNavigationEnabled = _settingsService.getVideoPlayerNavigationEnabled();
|
||||
_maxVolume = _settingsService.getMaxVolume();
|
||||
@@ -874,6 +880,38 @@ class _SettingsScreenState extends State<SettingsScreen> with FocusableTab {
|
||||
trailing: const AppIcon(Symbols.chevron_right_rounded, fill: 1),
|
||||
onTap: () => _showAutoSkipDelayDialog(),
|
||||
),
|
||||
ListTile(
|
||||
focusNode: _focusTracker.get(_kIntroPattern),
|
||||
leading: const AppIcon(Symbols.match_case_rounded, fill: 1),
|
||||
title: Text(t.settings.introPattern),
|
||||
subtitle: Text(t.settings.introPatternDescription),
|
||||
trailing: const AppIcon(Symbols.chevron_right_rounded, fill: 1),
|
||||
onTap: () => _showTextInputDialog(
|
||||
title: t.settings.introPattern,
|
||||
currentValue: _introPattern,
|
||||
defaultValue: settings.SettingsService.defaultIntroPattern,
|
||||
onSave: (value) async {
|
||||
setState(() => _introPattern = value);
|
||||
await _settingsService.setIntroPattern(value);
|
||||
},
|
||||
),
|
||||
),
|
||||
ListTile(
|
||||
focusNode: _focusTracker.get(_kCreditsPattern),
|
||||
leading: const AppIcon(Symbols.match_case_rounded, fill: 1),
|
||||
title: Text(t.settings.creditsPattern),
|
||||
subtitle: Text(t.settings.creditsPatternDescription),
|
||||
trailing: const AppIcon(Symbols.chevron_right_rounded, fill: 1),
|
||||
onTap: () => _showTextInputDialog(
|
||||
title: t.settings.creditsPattern,
|
||||
currentValue: _creditsPattern,
|
||||
defaultValue: settings.SettingsService.defaultCreditsPattern,
|
||||
onSave: (value) async {
|
||||
setState(() => _creditsPattern = value);
|
||||
await _settingsService.setCreditsPattern(value);
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
@@ -1602,6 +1640,69 @@ class _SettingsScreenState extends State<SettingsScreen> with FocusableTab {
|
||||
);
|
||||
}
|
||||
|
||||
void _showTextInputDialog({
|
||||
required String title,
|
||||
required String currentValue,
|
||||
required String defaultValue,
|
||||
required Future<void> Function(String value) onSave,
|
||||
}) {
|
||||
final controller = TextEditingController(text: currentValue);
|
||||
String? errorText;
|
||||
final saveFocusNode = FocusNode();
|
||||
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (BuildContext dialogContext) {
|
||||
return StatefulBuilder(
|
||||
builder: (context, setDialogState) {
|
||||
return AlertDialog(
|
||||
title: Text(title),
|
||||
content: TextField(
|
||||
controller: controller,
|
||||
decoration: InputDecoration(
|
||||
labelText: 'Regex',
|
||||
errorText: errorText,
|
||||
),
|
||||
autofocus: true,
|
||||
textInputAction: TextInputAction.done,
|
||||
onEditingComplete: () => saveFocusNode.requestFocus(),
|
||||
onChanged: (value) {
|
||||
setDialogState(() {
|
||||
try {
|
||||
RegExp(value, caseSensitive: false);
|
||||
errorText = null;
|
||||
} catch (_) {
|
||||
errorText = t.settings.invalidRegex;
|
||||
}
|
||||
});
|
||||
},
|
||||
),
|
||||
actions: [
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
controller.text = defaultValue;
|
||||
setDialogState(() => errorText = null);
|
||||
},
|
||||
child: Text(t.settings.resetToDefault),
|
||||
),
|
||||
TextButton(onPressed: () => Navigator.pop(dialogContext), child: Text(t.common.cancel)),
|
||||
TextButton(
|
||||
focusNode: saveFocusNode,
|
||||
onPressed: () async {
|
||||
if (errorText != null) return;
|
||||
await onSave(controller.text);
|
||||
if (dialogContext.mounted) Navigator.pop(dialogContext);
|
||||
},
|
||||
child: Text(t.common.save),
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
);
|
||||
},
|
||||
).then((_) => saveFocusNode.dispose());
|
||||
}
|
||||
|
||||
void _showMaxVolumeDialog() {
|
||||
_showNumericInputDialog(
|
||||
title: t.settings.maxVolume,
|
||||
|
||||
@@ -152,11 +152,13 @@ class VideoPlayerScreenState extends State<VideoPlayerScreen> with WidgetsBindin
|
||||
StreamSubscription<Duration>? _positionSubscription;
|
||||
StreamSubscription<void>? _playbackRestartSubscription;
|
||||
StreamSubscription<void>? _backendSwitchedSubscription;
|
||||
StreamSubscription<PlayerLog>? _logSubscription;
|
||||
StreamSubscription<void>? _sleepTimerSubscription;
|
||||
StreamSubscription<bool>? _mediaControlsPlayingSubscription;
|
||||
StreamSubscription<Duration>? _mediaControlsPositionSubscription;
|
||||
StreamSubscription<double>? _mediaControlsRateSubscription;
|
||||
StreamSubscription<bool>? _mediaControlsSeekableSubscription;
|
||||
StreamSubscription<Map<String, bool>>? _serverStatusSubscription;
|
||||
bool _isReplacingWithVideo = false; // Flag to skip orientation restoration during video-to-video navigation
|
||||
bool _isDisposingForNavigation = false;
|
||||
bool _waitingForExternalSubsTrackSelection = false;
|
||||
@@ -581,6 +583,11 @@ class VideoPlayerScreenState extends State<VideoPlayerScreen> with WidgetsBindin
|
||||
// Listen to MPV errors
|
||||
_errorSubscription = player!.streams.error.listen(_onPlayerError);
|
||||
|
||||
// Listen to error-level log messages for user-visible snackbars
|
||||
_logSubscription = player!.streams.log
|
||||
.where((log) => log.level == PlayerLogLevel.error || log.level == PlayerLogLevel.fatal)
|
||||
.listen(_onPlayerLogError);
|
||||
|
||||
// Listen for backend switched event (ExoPlayer -> MPV fallback on Android)
|
||||
if (Platform.isAndroid && useExoPlayer) {
|
||||
_backendSwitchedSubscription = player!.streams.backendSwitched.listen((_) => _onBackendSwitched());
|
||||
@@ -591,8 +598,28 @@ class VideoPlayerScreenState extends State<VideoPlayerScreen> with WidgetsBindin
|
||||
_isBuffering.value = isBuffering;
|
||||
});
|
||||
|
||||
// When server comes back online while buffering, force mpv to reconnect
|
||||
// immediately instead of waiting for ffmpeg's exponential backoff
|
||||
if (!widget.isOffline && !widget.isLive) {
|
||||
final serverId = widget.metadata.serverId;
|
||||
if (serverId != null) {
|
||||
final serverManager = context.read<MultiServerProvider>().serverManager;
|
||||
bool wasOffline = false;
|
||||
_serverStatusSubscription = serverManager.statusStream.listen((statusMap) {
|
||||
final isOnline = statusMap[serverId] == true;
|
||||
if (!isOnline) {
|
||||
wasOffline = true;
|
||||
} else if (wasOffline && _isBuffering.value) {
|
||||
wasOffline = false;
|
||||
_forceStreamReconnect();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// Listen to playback restart to detect first frame ready
|
||||
_playbackRestartSubscription = player!.streams.playbackRestart.listen((_) async {
|
||||
_lastLogError = null;
|
||||
if (!_hasFirstFrame.value) {
|
||||
_hasFirstFrame.value = true;
|
||||
Sentry.addBreadcrumb(Breadcrumb(message: 'First frame ready', category: 'player'));
|
||||
@@ -742,37 +769,36 @@ class VideoPlayerScreenState extends State<VideoPlayerScreen> with WidgetsBindin
|
||||
|
||||
// Set up media control event handling
|
||||
_mediaControlSubscription = _mediaControlsManager!.controlEvents.listen((event) {
|
||||
final currentPlayer = player;
|
||||
if (currentPlayer == null && event is! NextTrackEvent && event is! PreviousTrackEvent) return;
|
||||
|
||||
if (event is PlayEvent) {
|
||||
appLogger.d('Media control: Play event received');
|
||||
if (player != null) {
|
||||
player!.play();
|
||||
_wasPlayingBeforeInactive = false;
|
||||
appLogger.d('Cleared _wasPlayingBeforeInactive due to manual play via media controls');
|
||||
_updateMediaControlsPlaybackState();
|
||||
}
|
||||
currentPlayer!.play();
|
||||
_wasPlayingBeforeInactive = false;
|
||||
_updateMediaControlsPlaybackState();
|
||||
} else if (event is PauseEvent) {
|
||||
appLogger.d('Media control: Pause event received');
|
||||
if (player != null) {
|
||||
player!.pause();
|
||||
appLogger.d('Video paused via media controls');
|
||||
_updateMediaControlsPlaybackState();
|
||||
currentPlayer!.pause();
|
||||
_updateMediaControlsPlaybackState();
|
||||
} else if (event is TogglePlayPauseEvent) {
|
||||
appLogger.d('Media control: Toggle play/pause event received');
|
||||
if (currentPlayer!.state.playing) {
|
||||
currentPlayer.pause();
|
||||
} else {
|
||||
currentPlayer.play();
|
||||
_wasPlayingBeforeInactive = false;
|
||||
}
|
||||
_updateMediaControlsPlaybackState();
|
||||
} else if (event is SeekEvent) {
|
||||
appLogger.d('Media control: Seek event received to ${event.position}');
|
||||
final currentPlayer = player;
|
||||
if (currentPlayer != null) {
|
||||
unawaited(currentPlayer.seek(clampSeekPosition(currentPlayer, event.position)));
|
||||
}
|
||||
unawaited(currentPlayer!.seek(clampSeekPosition(currentPlayer, event.position)));
|
||||
} else if (event is NextTrackEvent) {
|
||||
appLogger.d('Media control: Next track event received');
|
||||
if (_nextEpisode != null) {
|
||||
_playNext();
|
||||
}
|
||||
if (_nextEpisode != null) _playNext();
|
||||
} else if (event is PreviousTrackEvent) {
|
||||
appLogger.d('Media control: Previous track event received');
|
||||
if (_previousEpisode != null) {
|
||||
_playPrevious();
|
||||
}
|
||||
if (_previousEpisode != null) _playPrevious();
|
||||
}
|
||||
});
|
||||
|
||||
@@ -1055,10 +1081,8 @@ class VideoPlayerScreenState extends State<VideoPlayerScreen> with WidgetsBindin
|
||||
|
||||
// Enable FFmpeg auto-reconnect for VOD streams (covers network drops up to 10 min)
|
||||
if (!widget.isOffline && !widget.isLive) {
|
||||
await player!.setProperty('stream-lavf-o-append', 'reconnect=1');
|
||||
await player!.setProperty('stream-lavf-o-append', 'reconnect_on_network_error=1');
|
||||
await player!.setProperty('stream-lavf-o-append', 'reconnect_streamed=1');
|
||||
await player!.setProperty('stream-lavf-o-append', 'reconnect_delay_max=600');
|
||||
await player!.setProperty('stream-lavf-o',
|
||||
'reconnect=1,reconnect_on_network_error=1,reconnect_streamed=1,reconnect_delay_max=600');
|
||||
}
|
||||
|
||||
// If we have external subtitles, open paused to add them before playback starts.
|
||||
@@ -1461,7 +1485,7 @@ class VideoPlayerScreenState extends State<VideoPlayerScreen> with WidgetsBindin
|
||||
watchTogether.setCurrentMedia(
|
||||
ratingKey: targetMetadata.ratingKey,
|
||||
serverId: targetMetadata.serverId!,
|
||||
mediaTitle: targetMetadata.title,
|
||||
mediaTitle: targetMetadata.displayTitle,
|
||||
);
|
||||
}
|
||||
} catch (e) {
|
||||
@@ -1742,11 +1766,13 @@ class VideoPlayerScreenState extends State<VideoPlayerScreen> with WidgetsBindin
|
||||
_positionSubscription?.cancel();
|
||||
_playbackRestartSubscription?.cancel();
|
||||
_backendSwitchedSubscription?.cancel();
|
||||
_logSubscription?.cancel();
|
||||
_sleepTimerSubscription?.cancel();
|
||||
_mediaControlsPlayingSubscription?.cancel();
|
||||
_mediaControlsPositionSubscription?.cancel();
|
||||
_mediaControlsRateSubscription?.cancel();
|
||||
_mediaControlsSeekableSubscription?.cancel();
|
||||
_serverStatusSubscription?.cancel();
|
||||
|
||||
// Cancel auto-play timer
|
||||
_autoPlayTimer?.cancel();
|
||||
@@ -1901,9 +1927,16 @@ class VideoPlayerScreenState extends State<VideoPlayerScreen> with WidgetsBindin
|
||||
|
||||
void _onPlayerError(String error) {
|
||||
appLogger.e('[Player ERROR] $error');
|
||||
if (!mounted) return;
|
||||
if (!mounted || _isExiting.value) return;
|
||||
showGlobalErrorSnackBar(_lastLogError ?? error);
|
||||
_handleBackButton();
|
||||
}
|
||||
|
||||
showErrorSnackBar(context, t.messages.failedPlayback(action: 'play', error: error));
|
||||
String? _lastLogError;
|
||||
|
||||
void _onPlayerLogError(PlayerLog log) {
|
||||
appLogger.e('[Player LOG ERROR] [${log.prefix}] ${log.text}');
|
||||
_lastLogError = log.text.trim();
|
||||
}
|
||||
|
||||
/// Handle notification when native player switched from ExoPlayer to MPV
|
||||
@@ -2069,16 +2102,24 @@ class VideoPlayerScreenState extends State<VideoPlayerScreen> with WidgetsBindin
|
||||
}
|
||||
}
|
||||
|
||||
/// Force mpv to reconnect its HTTP stream by seeking to the current position.
|
||||
/// This bypasses ffmpeg's exponential reconnect backoff when the app detects
|
||||
/// that network connectivity has been restored.
|
||||
void _forceStreamReconnect() {
|
||||
final p = player;
|
||||
if (p == null || !_isPlayerInitialized) return;
|
||||
final pos = p.state.position;
|
||||
appLogger.i('Network restored while buffering, forcing stream reconnect at ${pos.inSeconds}s');
|
||||
p.seek(pos);
|
||||
}
|
||||
|
||||
/// Configure MPV/FFmpeg options for live streaming resilience.
|
||||
/// Enables automatic reconnection on EOF and network errors.
|
||||
Future<void> _setLiveStreamOptions() async {
|
||||
final p = player!;
|
||||
// FFmpeg HTTP protocol reconnection
|
||||
await p.setProperty('stream-lavf-o-append', 'reconnect=1');
|
||||
await p.setProperty('stream-lavf-o-append', 'reconnect_at_eof=1');
|
||||
await p.setProperty('stream-lavf-o-append', 'reconnect_streamed=1');
|
||||
await p.setProperty('stream-lavf-o-append', 'reconnect_on_network_error=1');
|
||||
await p.setProperty('stream-lavf-o-append', 'reconnect_delay_max=30');
|
||||
await p.setProperty('stream-lavf-o',
|
||||
'reconnect=1,reconnect_at_eof=1,reconnect_streamed=1,reconnect_on_network_error=1,reconnect_delay_max=30');
|
||||
// Demuxer: retry up to 1000 times on stream reload failures
|
||||
await p.setProperty('demuxer-lavf-o', 'max_reload=1000');
|
||||
await p.setProperty('force-seekable', 'no');
|
||||
@@ -2857,7 +2898,7 @@ class VideoPlayerScreenState extends State<VideoPlayerScreen> with WidgetsBindin
|
||||
)
|
||||
else
|
||||
Text(
|
||||
_nextEpisode!.title,
|
||||
_nextEpisode!.title!,
|
||||
style: const TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 14,
|
||||
|
||||
@@ -351,7 +351,7 @@ class DiscordRPCService {
|
||||
timestamps: _buildTimestamps(),
|
||||
statusDisplayType: DiscordStatusDisplayType.details,
|
||||
largeAsset: _cachedThumbnailUrl != null
|
||||
? DiscordAsset(url: _cachedThumbnailUrl!, text: metadata.grandparentTitle ?? metadata.title)
|
||||
? DiscordAsset(url: _cachedThumbnailUrl!, text: metadata.grandparentTitle ?? metadata.title!)
|
||||
: null,
|
||||
),
|
||||
);
|
||||
@@ -392,14 +392,14 @@ class DiscordRPCService {
|
||||
switch (metadata.mediaType) {
|
||||
case PlexMediaType.movie:
|
||||
final year = metadata.year != null ? ' (${metadata.year})' : '';
|
||||
return metadata.title + year;
|
||||
return metadata.title! + year;
|
||||
|
||||
case PlexMediaType.episode:
|
||||
// Show: "Show Name" or just episode title if no show name
|
||||
return metadata.grandparentTitle ?? metadata.title;
|
||||
return metadata.grandparentTitle ?? metadata.title!;
|
||||
|
||||
default:
|
||||
return metadata.title;
|
||||
return metadata.title!;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -411,9 +411,9 @@ class DiscordRPCService {
|
||||
final season = metadata.parentIndex;
|
||||
final episode = metadata.index;
|
||||
if (season != null && episode != null) {
|
||||
return 'S$season E$episode - ${metadata.title}';
|
||||
return 'S$season E$episode - ${metadata.title!}';
|
||||
}
|
||||
return metadata.title;
|
||||
return metadata.title!;
|
||||
|
||||
case PlexMediaType.movie:
|
||||
return metadata.studio;
|
||||
|
||||
@@ -341,7 +341,7 @@ class DownloadManagerService {
|
||||
serverId: metadata.serverId!,
|
||||
ratingKey: metadata.ratingKey,
|
||||
globalKey: globalKey,
|
||||
type: metadata.type,
|
||||
type: metadata.type ?? '',
|
||||
parentRatingKey: metadata.parentRatingKey,
|
||||
grandparentRatingKey: metadata.grandparentRatingKey,
|
||||
status: DownloadStatus.queued.index,
|
||||
@@ -446,8 +446,8 @@ class DownloadManagerService {
|
||||
|
||||
// Build display name for notifications
|
||||
final displayName = metadata.type == 'episode'
|
||||
? '${metadata.grandparentTitle ?? metadata.title} - ${metadata.title}'
|
||||
: metadata.title;
|
||||
? '${metadata.grandparentTitle ?? metadata.displayTitle} - ${metadata.displayTitle}'
|
||||
: metadata.displayTitle;
|
||||
|
||||
// Get WiFi-only setting for native enforcement
|
||||
final settings = await SettingsService.getInstance();
|
||||
@@ -1234,7 +1234,7 @@ class DownloadManagerService {
|
||||
|
||||
// Emit initial progress
|
||||
_emitDeletionProgress(
|
||||
DeletionProgress(globalKey: globalKey, itemTitle: metadata.title, currentItem: 0, totalItems: totalItems),
|
||||
DeletionProgress(globalKey: globalKey, itemTitle: metadata.displayTitle, currentItem: 0, totalItems: totalItems),
|
||||
);
|
||||
|
||||
// Delete files from storage (with progress updates)
|
||||
@@ -1250,7 +1250,7 @@ class DownloadManagerService {
|
||||
_emitDeletionProgress(
|
||||
DeletionProgress(
|
||||
globalKey: globalKey,
|
||||
itemTitle: metadata.title,
|
||||
itemTitle: metadata.displayTitle,
|
||||
currentItem: totalItems,
|
||||
totalItems: totalItems,
|
||||
),
|
||||
@@ -1264,17 +1264,14 @@ class DownloadManagerService {
|
||||
|
||||
/// Calculate total items to delete (for progress tracking)
|
||||
Future<int> _getTotalItemsToDelete(PlexMetadata metadata, String _) async {
|
||||
switch (metadata.type.toLowerCase()) {
|
||||
case 'episode':
|
||||
return 1; // Single episode
|
||||
case 'movie':
|
||||
return 1; // Single movie
|
||||
case 'season':
|
||||
// Count episodes in season
|
||||
switch (metadata.mediaType) {
|
||||
case PlexMediaType.episode:
|
||||
case PlexMediaType.movie:
|
||||
return 1;
|
||||
case PlexMediaType.season:
|
||||
final episodes = await _database.getEpisodesBySeason(metadata.ratingKey);
|
||||
return episodes.length;
|
||||
case 'show':
|
||||
// Count all episodes in show
|
||||
case PlexMediaType.show:
|
||||
final episodes = await _database.getEpisodesByShow(metadata.ratingKey);
|
||||
return episodes.length;
|
||||
default:
|
||||
@@ -1301,17 +1298,17 @@ class DownloadManagerService {
|
||||
}
|
||||
|
||||
// Delete based on type
|
||||
switch (metadata.type.toLowerCase()) {
|
||||
case 'episode':
|
||||
switch (metadata.mediaType) {
|
||||
case PlexMediaType.episode:
|
||||
await _deleteEpisodeFiles(metadata, serverId);
|
||||
break;
|
||||
case 'season':
|
||||
case PlexMediaType.season:
|
||||
await _deleteSeasonFiles(metadata, serverId);
|
||||
break;
|
||||
case 'show':
|
||||
case PlexMediaType.show:
|
||||
await _deleteShowFiles(metadata, serverId);
|
||||
break;
|
||||
case 'movie':
|
||||
case PlexMediaType.movie:
|
||||
await _deleteMovieFiles(metadata, serverId);
|
||||
break;
|
||||
default:
|
||||
@@ -1447,7 +1444,7 @@ class DownloadManagerService {
|
||||
episodes: episodesInSeason,
|
||||
serverId: serverId,
|
||||
parentKey: season.ratingKey,
|
||||
parentTitle: season.title,
|
||||
parentTitle: season.displayTitle,
|
||||
);
|
||||
|
||||
final seasonDir = await _storageService.getSeasonDirectory(season, showYear: showYear);
|
||||
@@ -1510,7 +1507,7 @@ class DownloadManagerService {
|
||||
episodes: episodesInShow,
|
||||
serverId: serverId,
|
||||
parentKey: show.ratingKey,
|
||||
parentTitle: show.title,
|
||||
parentTitle: show.displayTitle,
|
||||
);
|
||||
|
||||
final showDir = await _storageService.getShowDirectory(show);
|
||||
|
||||
@@ -65,7 +65,7 @@ class DownloadStorageService {
|
||||
String _formatEpisodeFileName(PlexMetadata episode) {
|
||||
final season = padNumber(episode.parentIndex ?? 0, 2);
|
||||
final ep = padNumber(episode.index ?? 0, 2);
|
||||
final episodeName = _sanitizeFileName(episode.title);
|
||||
final episodeName = _sanitizeFileName(episode.title!);
|
||||
return 'S${season}E$ep - $episodeName';
|
||||
}
|
||||
|
||||
@@ -246,13 +246,13 @@ class DownloadStorageService {
|
||||
|
||||
/// Get the folder name for a movie: "Movie Name (YYYY)"
|
||||
String _getMovieFolderName(PlexMetadata movie) {
|
||||
return _formatTitleWithYear(movie.title, movie.year);
|
||||
return _formatTitleWithYear(movie.title!, movie.year);
|
||||
}
|
||||
|
||||
/// Get the folder name for a TV show: "Show Name (YYYY)"
|
||||
/// [showYear]: Pass explicitly for episodes (episode.year may differ from show's year)
|
||||
String _getShowFolderName(PlexMetadata metadata, {int? showYear}) {
|
||||
final title = metadata.grandparentTitle ?? metadata.title;
|
||||
final title = metadata.grandparentTitle ?? metadata.title!;
|
||||
final year = showYear ?? metadata.year;
|
||||
return _formatTitleWithYear(title, year);
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ class MediaControlsManager {
|
||||
// Update OS media controls
|
||||
await OsMediaControls.setMetadata(
|
||||
MediaMetadata(
|
||||
title: metadata.title,
|
||||
title: metadata.title!,
|
||||
artist: _buildArtist(metadata),
|
||||
artworkUrl: artworkUrl,
|
||||
duration: duration,
|
||||
|
||||
@@ -38,6 +38,15 @@ class MultiServerManager {
|
||||
/// Debounce timers for endpoint-exhaustion-triggered reconnection (per server)
|
||||
final Map<String, Timer> _reconnectDebounce = {};
|
||||
|
||||
/// Coalescing guard for checkServerHealth — prevents concurrent health checks
|
||||
Future<void>? _activeHealthCheck;
|
||||
|
||||
/// Coalescing guard for reconnectOfflineServers — prevents concurrent reconnect sweeps
|
||||
Future<void>? _activeReconnect;
|
||||
|
||||
/// Debounce timer for connectivity events — collapses rapid network flapping
|
||||
Timer? _connectivityDebounce;
|
||||
|
||||
/// Get all registered server IDs
|
||||
List<String> get serverIds => _servers.keys.toList();
|
||||
|
||||
@@ -292,6 +301,18 @@ class MultiServerManager {
|
||||
/// Uses [PlexClient.isHealthy] which checks for HTTP 200, so servers with
|
||||
/// invalid tokens (401) are correctly reported as offline.
|
||||
Future<void> checkServerHealth() async {
|
||||
// Coalesce concurrent calls — return the in-flight future if one exists
|
||||
if (_activeHealthCheck != null) return _activeHealthCheck!;
|
||||
|
||||
_activeHealthCheck = _doCheckServerHealth();
|
||||
try {
|
||||
await _activeHealthCheck;
|
||||
} finally {
|
||||
_activeHealthCheck = null;
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> _doCheckServerHealth() async {
|
||||
appLogger.d('Checking health for ${_clients.length} servers');
|
||||
|
||||
final healthChecks = _clients.entries.map((entry) async {
|
||||
@@ -316,39 +337,51 @@ class MultiServerManager {
|
||||
}
|
||||
|
||||
appLogger.i('Starting network monitoring for all servers');
|
||||
final connectivity = Connectivity();
|
||||
_connectivitySubscription = connectivity.onConnectivityChanged.listen(
|
||||
(results) {
|
||||
final status = results.isNotEmpty ? results.first : ConnectivityResult.none;
|
||||
runZonedGuarded(() {
|
||||
final connectivity = Connectivity();
|
||||
_connectivitySubscription = connectivity.onConnectivityChanged.listen(
|
||||
(results) {
|
||||
final status = results.isNotEmpty ? results.first : ConnectivityResult.none;
|
||||
|
||||
if (status == ConnectivityResult.none) {
|
||||
appLogger.w('Connectivity lost, pausing optimization until network returns');
|
||||
return;
|
||||
}
|
||||
if (status == ConnectivityResult.none) {
|
||||
appLogger.w('Connectivity lost, pausing optimization until network returns');
|
||||
return;
|
||||
}
|
||||
|
||||
appLogger.d(
|
||||
'Connectivity change detected, re-optimizing all servers',
|
||||
error: {
|
||||
'status': status.name,
|
||||
'interfaces': results.map((r) => r.name).toList(),
|
||||
'serverCount': _servers.length,
|
||||
},
|
||||
);
|
||||
// Debounce rapid connectivity events (e.g. WiFi flapping) into a single trigger
|
||||
_connectivityDebounce?.cancel();
|
||||
_connectivityDebounce = Timer(const Duration(seconds: 2), () {
|
||||
_connectivityDebounce = null;
|
||||
|
||||
// Re-optimize all servers and re-probe offline ones
|
||||
_reoptimizeAllServers(reason: 'connectivity:${status.name}');
|
||||
checkServerHealth();
|
||||
},
|
||||
onError: (error, stackTrace) {
|
||||
appLogger.w('Connectivity listener error', error: error, stackTrace: stackTrace);
|
||||
},
|
||||
);
|
||||
appLogger.d(
|
||||
'Connectivity change detected, re-optimizing all servers',
|
||||
error: {
|
||||
'status': status.name,
|
||||
'interfaces': results.map((r) => r.name).toList(),
|
||||
'serverCount': _servers.length,
|
||||
},
|
||||
);
|
||||
|
||||
// Re-optimize all servers and re-probe offline ones
|
||||
_reoptimizeAllServers(reason: 'connectivity:${status.name}');
|
||||
checkServerHealth();
|
||||
});
|
||||
},
|
||||
onError: (error, stackTrace) {
|
||||
appLogger.w('Connectivity listener error', error: error, stackTrace: stackTrace);
|
||||
},
|
||||
);
|
||||
}, (error, stack) {
|
||||
appLogger.w('Connectivity monitoring unavailable', error: error);
|
||||
});
|
||||
}
|
||||
|
||||
/// Stop monitoring network connectivity
|
||||
void stopNetworkMonitoring() {
|
||||
_connectivitySubscription?.cancel();
|
||||
_connectivitySubscription = null;
|
||||
_connectivityDebounce?.cancel();
|
||||
_connectivityDebounce = null;
|
||||
appLogger.i('Stopped network monitoring');
|
||||
}
|
||||
|
||||
@@ -437,6 +470,18 @@ class MultiServerManager {
|
||||
|
||||
/// Attempt reconnection for all offline servers
|
||||
Future<void> reconnectOfflineServers() async {
|
||||
// Coalesce concurrent calls — return the in-flight future if one exists
|
||||
if (_activeReconnect != null) return _activeReconnect!;
|
||||
|
||||
_activeReconnect = _doReconnectOfflineServers();
|
||||
try {
|
||||
await _activeReconnect;
|
||||
} finally {
|
||||
_activeReconnect = null;
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> _doReconnectOfflineServers() async {
|
||||
final offline = offlineServerIds;
|
||||
if (offline.isEmpty) return;
|
||||
|
||||
@@ -497,6 +542,8 @@ class MultiServerManager {
|
||||
timer.cancel();
|
||||
}
|
||||
_reconnectDebounce.clear();
|
||||
_activeHealthCheck = null;
|
||||
_activeReconnect = null;
|
||||
_clients.clear();
|
||||
_servers.clear();
|
||||
_serverStatus.clear();
|
||||
|
||||
@@ -954,7 +954,7 @@ class PlexClient {
|
||||
|
||||
/// Get chapters and markers from cached metadata or fetch if needed
|
||||
/// Uses same cache key as other metadata methods for consistency
|
||||
Future<PlaybackExtras> getPlaybackExtras(String ratingKey) async {
|
||||
Future<PlaybackExtras> getPlaybackExtras(String ratingKey, {String? introPattern, String? creditsPattern}) async {
|
||||
try {
|
||||
final data = await _fetchWithCacheFirst<Map<String, dynamic>>(
|
||||
cacheKey: '/library/metadata/$ratingKey',
|
||||
@@ -964,7 +964,7 @@ class PlexClient {
|
||||
parseResponse: (response) => response.data as Map<String, dynamic>?,
|
||||
);
|
||||
final metadataJson = _getFirstMetadataJsonFromData(data);
|
||||
return _parsePlaybackExtrasFromMetadataJson(metadataJson);
|
||||
return _parsePlaybackExtrasFromMetadataJson(metadataJson, introPattern: introPattern, creditsPattern: creditsPattern);
|
||||
} catch (e) {
|
||||
appLogger.w('Failed to get playback extras', error: e);
|
||||
return PlaybackExtras(chapters: [], markers: []);
|
||||
@@ -972,10 +972,12 @@ class PlexClient {
|
||||
}
|
||||
|
||||
/// Parse PlaybackExtras from metadata JSON
|
||||
PlaybackExtras _parsePlaybackExtrasFromMetadataJson(Map<String, dynamic>? metadataJson) {
|
||||
PlaybackExtras _parsePlaybackExtrasFromMetadataJson(Map<String, dynamic>? metadataJson, {String? introPattern, String? creditsPattern}) {
|
||||
return PlaybackExtras.withChapterFallback(
|
||||
chapters: _parseChapters(metadataJson),
|
||||
markers: _parseMarkers(metadataJson),
|
||||
introPatternStr: introPattern,
|
||||
creditsPatternStr: creditsPattern,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1224,6 +1226,19 @@ class PlexClient {
|
||||
return response.data;
|
||||
}
|
||||
|
||||
/// Get preferences for a library section.
|
||||
///
|
||||
/// Returns a map of setting id --> value for all settings in the library.
|
||||
Future<Map<String, dynamic>> getLibrarySectionPrefs(String sectionId) async {
|
||||
final response = await _dio.get('/library/sections/$sectionId/prefs');
|
||||
final container = _getMediaContainer(response);
|
||||
if (container == null) return {};
|
||||
final settings = container['Setting'];
|
||||
if (settings == null) return {};
|
||||
final list = settings is List ? settings : [settings];
|
||||
return {for (final s in list) s['id'] as String: s['value']};
|
||||
}
|
||||
|
||||
/// Get sessions (currently playing)
|
||||
Future<List<dynamic>> getSessions() async {
|
||||
final response = await _dio.get('/status/sessions');
|
||||
@@ -2165,8 +2180,8 @@ class PlexClient {
|
||||
if (providers.isEmpty) return [];
|
||||
|
||||
final queryParams = <String, dynamic>{};
|
||||
if (beginsAt != null) queryParams['beginsAt>'] = beginsAt;
|
||||
if (endsAt != null) queryParams['endsAt<'] = endsAt;
|
||||
if (beginsAt != null) queryParams['endsAt>'] = beginsAt;
|
||||
if (endsAt != null) queryParams['beginsAt<'] = endsAt;
|
||||
|
||||
final allPrograms = <LiveTvProgram>[];
|
||||
|
||||
|
||||
@@ -57,6 +57,13 @@ class SettingsService extends BaseSharedPreferencesService {
|
||||
static const String _keyAutoSkipIntro = 'auto_skip_intro';
|
||||
static const String _keyAutoSkipCredits = 'auto_skip_credits';
|
||||
static const String _keyAutoSkipDelay = 'auto_skip_delay';
|
||||
static const String _keyIntroPattern = 'intro_pattern';
|
||||
static const String _keyCreditsPattern = 'credits_pattern';
|
||||
|
||||
static const String defaultIntroPattern =
|
||||
r'(?:^|\b)(?:intro(?:duction)?|opening)(?:\b|$)|^op(?:\s?\d+)?$';
|
||||
static const String defaultCreditsPattern =
|
||||
r'(?:^|\b)(?:outro|closing|credits?|ending)(?:\b|$)|^ed(?:\s?\d+)?$';
|
||||
static const String _keyCustomDownloadPath = 'custom_download_path';
|
||||
static const String _keyCustomDownloadPathType = 'custom_download_path_type';
|
||||
static const String _keyDownloadOnWifiOnly = 'download_on_wifi_only';
|
||||
@@ -894,6 +901,24 @@ class SettingsService extends BaseSharedPreferencesService {
|
||||
return prefs.getInt(_keyAutoSkipDelay) ?? 5; // Default: 5 seconds
|
||||
}
|
||||
|
||||
// Intro Pattern
|
||||
Future<void> setIntroPattern(String value) async {
|
||||
await prefs.setString(_keyIntroPattern, value);
|
||||
}
|
||||
|
||||
String getIntroPattern() {
|
||||
return prefs.getString(_keyIntroPattern) ?? defaultIntroPattern;
|
||||
}
|
||||
|
||||
// Credits Pattern
|
||||
Future<void> setCreditsPattern(String value) async {
|
||||
await prefs.setString(_keyCreditsPattern, value);
|
||||
}
|
||||
|
||||
String getCreditsPattern() {
|
||||
return prefs.getString(_keyCreditsPattern) ?? defaultCreditsPattern;
|
||||
}
|
||||
|
||||
// Custom Download Path
|
||||
Future<void> setCustomDownloadPath(String? path, {String type = 'file'}) async {
|
||||
if (path == null) {
|
||||
@@ -1381,6 +1406,8 @@ class SettingsService extends BaseSharedPreferencesService {
|
||||
'autoSkipIntro': getAutoSkipIntro(),
|
||||
'autoSkipCredits': getAutoSkipCredits(),
|
||||
'autoSkipDelay': getAutoSkipDelay(),
|
||||
'introPattern': getIntroPattern(),
|
||||
'creditsPattern': getCreditsPattern(),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -134,7 +134,7 @@ class WatchNextService {
|
||||
title = item.grandparentTitle!;
|
||||
episodeTitle = item.title;
|
||||
} else {
|
||||
title = item.title;
|
||||
title = item.title!;
|
||||
episodeTitle = null;
|
||||
}
|
||||
|
||||
@@ -148,7 +148,7 @@ class WatchNextService {
|
||||
'episodeTitle': episodeTitle,
|
||||
'description': item.summary,
|
||||
'posterUri': posterUri,
|
||||
'type': item.type.toLowerCase(),
|
||||
'type': item.mediaType.name,
|
||||
'duration': item.duration ?? 0,
|
||||
'lastPlaybackPosition': item.viewOffset ?? 0,
|
||||
'lastEngagementTime': lastEngagementTime,
|
||||
|
||||
@@ -86,7 +86,7 @@ String formatContentRating(String? contentRating) {
|
||||
|
||||
/// Extension on PlexMetadata for type checking convenience methods
|
||||
extension PlexMetadataType on PlexMetadata {
|
||||
String get _lowerType => type.toLowerCase();
|
||||
String get _lowerType => type?.toLowerCase() ?? '';
|
||||
|
||||
bool get isShow => _lowerType == ContentTypes.show;
|
||||
bool get isMovie => _lowerType == ContentTypes.movie;
|
||||
|
||||
@@ -80,7 +80,7 @@ class DeletionNotifier extends BaseNotifier<DeletionEvent> {
|
||||
ratingKey: metadata.ratingKey,
|
||||
serverId: metadata.serverId ?? '',
|
||||
parentChain: _buildParentChain(metadata),
|
||||
mediaType: metadata.type,
|
||||
mediaType: metadata.type ?? '',
|
||||
leafCount: metadata.leafCount ?? 1,
|
||||
isDownloadOnly: isDownloadOnly,
|
||||
),
|
||||
|
||||
@@ -3,7 +3,6 @@ import '../models/plex_metadata.dart';
|
||||
import '../models/plex_playlist.dart';
|
||||
import '../screens/collection_detail_screen.dart';
|
||||
import '../screens/media_detail_screen.dart';
|
||||
import '../screens/season_detail_screen.dart';
|
||||
import '../screens/playlist/playlist_detail_screen.dart';
|
||||
import 'video_player_navigation.dart';
|
||||
|
||||
@@ -96,14 +95,34 @@ Future<MediaNavigationResult> navigateToMediaItem(
|
||||
continue defaultCase;
|
||||
|
||||
case PlexMediaType.season:
|
||||
await Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => SeasonDetailScreen(season: metadata, isOffline: isOffline),
|
||||
),
|
||||
);
|
||||
onRefresh?.call(metadata.ratingKey);
|
||||
return MediaNavigationResult.navigated;
|
||||
// Navigate to the parent show with the season tab pre-selected
|
||||
if (metadata.parentRatingKey != null) {
|
||||
final showStub = PlexMetadata(
|
||||
ratingKey: metadata.parentRatingKey!,
|
||||
key: '/library/metadata/${metadata.parentRatingKey}',
|
||||
type: 'show',
|
||||
title: metadata.grandparentTitle ?? metadata.parentTitle ?? metadata.displayTitle,
|
||||
thumb: metadata.grandparentThumb ?? metadata.parentThumb,
|
||||
art: metadata.grandparentArt,
|
||||
serverId: metadata.serverId,
|
||||
serverName: metadata.serverName,
|
||||
);
|
||||
final result = await Navigator.push<bool>(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => MediaDetailScreen(
|
||||
metadata: showStub,
|
||||
isOffline: isOffline,
|
||||
initialSeasonIndex: metadata.index,
|
||||
),
|
||||
),
|
||||
);
|
||||
if (result == true) {
|
||||
onRefresh?.call(metadata.ratingKey);
|
||||
}
|
||||
return MediaNavigationResult.navigated;
|
||||
}
|
||||
continue defaultCase;
|
||||
|
||||
defaultCase:
|
||||
default:
|
||||
|
||||
@@ -1,5 +1,17 @@
|
||||
import 'package:flutter/widgets.dart';
|
||||
|
||||
/// Scroll the nearest scrollable ancestor so [context] is centered.
|
||||
///
|
||||
/// Uses [Scrollable.ensureVisible] with alignment 0.5 (center).
|
||||
/// Runs in a post-frame callback to ensure layout is complete.
|
||||
void scrollContextToCenter(BuildContext? context) {
|
||||
if (context == null) return;
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
if (!context.mounted) return;
|
||||
Scrollable.ensureVisible(context, alignment: 0.5, duration: const Duration(milliseconds: 200), curve: Curves.easeOut);
|
||||
});
|
||||
}
|
||||
|
||||
/// Scroll a horizontal list to center the item at the given index.
|
||||
///
|
||||
/// Assumes items are laid out with [leadingPadding] before the first item,
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
/// Global key for the root ScaffoldMessenger, allowing snackbars to survive navigation.
|
||||
final rootScaffoldMessengerKey = GlobalKey<ScaffoldMessengerState>();
|
||||
|
||||
/// Types of snackbars available in the app
|
||||
enum SnackBarType {
|
||||
/// Standard informational snackbar
|
||||
@@ -51,6 +54,13 @@ void showErrorSnackBar(BuildContext context, String message) {
|
||||
showSnackBar(context, message, type: SnackBarType.error);
|
||||
}
|
||||
|
||||
/// Shows an error snackbar using the root ScaffoldMessenger (survives navigation).
|
||||
void showGlobalErrorSnackBar(String message) {
|
||||
rootScaffoldMessengerKey.currentState?.showSnackBar(
|
||||
SnackBar(content: Text(message), backgroundColor: Colors.red, duration: const Duration(seconds: 4)),
|
||||
);
|
||||
}
|
||||
|
||||
/// Shows a success snackbar with a message
|
||||
///
|
||||
/// [context] The build context
|
||||
|
||||
@@ -86,7 +86,7 @@ class WatchStateNotifier extends BaseNotifier<WatchStateEvent> {
|
||||
serverId: metadata.serverId ?? '',
|
||||
changeType: isNowWatched ? WatchStateChangeType.watched : WatchStateChangeType.unwatched,
|
||||
parentChain: _buildParentChain(metadata),
|
||||
mediaType: metadata.type,
|
||||
mediaType: metadata.type ?? '',
|
||||
isNowWatched: isNowWatched,
|
||||
),
|
||||
);
|
||||
@@ -103,7 +103,7 @@ class WatchStateNotifier extends BaseNotifier<WatchStateEvent> {
|
||||
serverId: metadata.serverId ?? '',
|
||||
changeType: WatchStateChangeType.progressUpdate,
|
||||
parentChain: _buildParentChain(metadata),
|
||||
mediaType: metadata.type,
|
||||
mediaType: metadata.type ?? '',
|
||||
viewOffset: viewOffset,
|
||||
isNowWatched: isNowWatched,
|
||||
),
|
||||
|
||||
@@ -145,7 +145,7 @@ class _DownloadTreeViewState extends State<DownloadTreeView> {
|
||||
movies.add(
|
||||
DownloadTreeNode(
|
||||
key: globalKey,
|
||||
title: meta.title,
|
||||
title: meta.displayTitle,
|
||||
type: DownloadNodeType.movie,
|
||||
progress: download.progressPercent,
|
||||
status: download.status,
|
||||
@@ -202,7 +202,7 @@ class _DownloadTreeViewState extends State<DownloadTreeView> {
|
||||
if (meta == null) continue;
|
||||
|
||||
final episodeNumber = meta.index;
|
||||
final episodeTitle = episodeNumber != null ? 'Episode $episodeNumber - ${meta.title}' : meta.title;
|
||||
final episodeTitle = episodeNumber != null ? 'Episode $episodeNumber - ${meta.title!}' : meta.title!;
|
||||
|
||||
episodeNodes.add(
|
||||
DownloadTreeNode(
|
||||
|
||||
@@ -2,337 +2,27 @@ import 'dart:io';
|
||||
import 'dart:ui';
|
||||
|
||||
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 'package:provider/provider.dart';
|
||||
import '../../services/plex_client.dart';
|
||||
import '../main.dart';
|
||||
import '../focus/focus_theme.dart';
|
||||
import '../focus/focusable_wrapper.dart';
|
||||
import '../focus/key_event_utils.dart';
|
||||
import '../focus/dpad_navigator.dart';
|
||||
import '../focus/input_mode_tracker.dart';
|
||||
import '../models/download_models.dart';
|
||||
import '../providers/download_provider.dart';
|
||||
import '../providers/settings_provider.dart';
|
||||
import '../utils/content_utils.dart';
|
||||
import '../services/download_storage_service.dart';
|
||||
import '../widgets/collapsible_text.dart';
|
||||
import '../widgets/plex_optimized_image.dart';
|
||||
import '../models/plex_metadata.dart';
|
||||
import '../utils/platform_detector.dart';
|
||||
import '../utils/video_player_navigation.dart';
|
||||
import '../utils/formatters.dart';
|
||||
import '../widgets/desktop_app_bar.dart';
|
||||
import '../widgets/media_context_menu.dart';
|
||||
import '../widgets/placeholder_container.dart';
|
||||
import '../mixins/item_updatable.dart';
|
||||
import '../mixins/watch_state_aware.dart';
|
||||
import '../mixins/deletion_aware.dart';
|
||||
import '../mixins/mounted_set_state_mixin.dart';
|
||||
import '../mixins/server_bound_media_mixin.dart';
|
||||
import '../utils/watch_state_notifier.dart';
|
||||
import '../utils/deletion_notifier.dart';
|
||||
import '../theme/mono_tokens.dart';
|
||||
import '../i18n/strings.g.dart';
|
||||
|
||||
class SeasonDetailScreen extends StatefulWidget {
|
||||
final PlexMetadata season;
|
||||
final bool isOffline;
|
||||
|
||||
const SeasonDetailScreen({super.key, required this.season, this.isOffline = false});
|
||||
|
||||
@override
|
||||
State<SeasonDetailScreen> createState() => _SeasonDetailScreenState();
|
||||
}
|
||||
|
||||
class _SeasonDetailScreenState extends State<SeasonDetailScreen>
|
||||
with ItemUpdatable, WatchStateAware, DeletionAware, RouteAware, MountedSetStateMixin, ServerBoundMediaMixin {
|
||||
PlexClient? _client;
|
||||
|
||||
@override
|
||||
PlexClient get client {
|
||||
final client = _client;
|
||||
if (client == null) {
|
||||
throw StateError('PlexClient unavailable for season ${widget.season.ratingKey}');
|
||||
}
|
||||
return client;
|
||||
}
|
||||
|
||||
List<PlexMetadata> _episodes = [];
|
||||
bool _isLoadingEpisodes = false;
|
||||
bool _watchStateChanged = false;
|
||||
// Capture keyboard mode once at init to avoid rebuild dependency
|
||||
bool _initialKeyboardMode = false;
|
||||
bool _suppressNextBackKeyUp = false;
|
||||
bool _routeSubscribed = false;
|
||||
|
||||
@override
|
||||
PlexMetadata get serverBoundMetadata => widget.season;
|
||||
|
||||
@override
|
||||
bool get isServerBoundOffline => widget.isOffline;
|
||||
|
||||
// WatchStateAware: watch all episode ratingKeys
|
||||
@override
|
||||
Set<String>? get watchedRatingKeys => _episodes.map((e) => e.ratingKey).toSet();
|
||||
|
||||
@override
|
||||
String? get watchStateServerId => serverBoundServerId;
|
||||
|
||||
@override
|
||||
Set<String>? get watchedGlobalKeys {
|
||||
final serverId = serverBoundServerId;
|
||||
if (serverId == null) return null;
|
||||
|
||||
return _episodes.map((e) => toServerBoundGlobalKey(e.ratingKey, serverId: e.serverId ?? serverId)).toSet();
|
||||
}
|
||||
|
||||
@override
|
||||
void onWatchStateChanged(WatchStateEvent event) {
|
||||
// Update the affected episode
|
||||
if (!widget.isOffline && _client != null) {
|
||||
updateItem(event.ratingKey);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Set<String>? get deletionRatingKeys {
|
||||
final keys = _episodes.map((e) => e.ratingKey).toSet();
|
||||
keys.add(widget.season.ratingKey);
|
||||
return keys;
|
||||
}
|
||||
|
||||
@override
|
||||
String? get deletionServerId => serverBoundServerId;
|
||||
|
||||
@override
|
||||
Set<String>? get deletionGlobalKeys {
|
||||
final serverId = serverBoundServerId;
|
||||
if (serverId == null) return null;
|
||||
|
||||
final keys = _episodes.map((e) => toServerBoundGlobalKey(e.ratingKey, serverId: e.serverId ?? serverId)).toSet();
|
||||
keys.add(toServerBoundGlobalKey(widget.season.ratingKey, serverId: serverId));
|
||||
return keys;
|
||||
}
|
||||
|
||||
@override
|
||||
void onDeletionEvent(DeletionEvent event) {
|
||||
// Download-only deletions should only remove items when viewing offline content
|
||||
if (event.isDownloadOnly && !widget.isOffline) return;
|
||||
|
||||
// If we have an episode that matches the rating key exactly, then remove it from our list
|
||||
final index = _episodes.indexWhere((e) => e.ratingKey == event.ratingKey);
|
||||
if (index != -1) {
|
||||
setState(() {
|
||||
_episodes.removeAt(index);
|
||||
});
|
||||
// If that was the last episode, navigate back to the show view
|
||||
if (_episodes.isEmpty && mounted) {
|
||||
Navigator.of(context).pop();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
// Initialize the client once in initState
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
// Capture keyboard mode once to avoid rebuild dependency when mode changes
|
||||
_initialKeyboardMode = InputModeTracker.isKeyboardMode(context);
|
||||
_client = getServerBoundClient(context);
|
||||
_loadEpisodes();
|
||||
});
|
||||
}
|
||||
|
||||
Future<void> _loadEpisodes() async {
|
||||
setState(() {
|
||||
_isLoadingEpisodes = true;
|
||||
});
|
||||
|
||||
if (widget.isOffline) {
|
||||
// Load episodes from downloads
|
||||
_loadEpisodesFromDownloads();
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
final client = _client;
|
||||
if (client == null) {
|
||||
setStateIfMounted(() {
|
||||
_isLoadingEpisodes = false;
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
// Episodes are automatically tagged with server info by PlexClient
|
||||
final episodes = await client.getChildren(widget.season.ratingKey);
|
||||
|
||||
setStateIfMounted(() {
|
||||
_episodes = episodes;
|
||||
_isLoadingEpisodes = false;
|
||||
});
|
||||
} catch (e) {
|
||||
setStateIfMounted(() {
|
||||
_isLoadingEpisodes = false;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/// Load episodes from downloaded content
|
||||
void _loadEpisodesFromDownloads() {
|
||||
final downloadProvider = context.read<DownloadProvider>();
|
||||
|
||||
// Get all downloaded episodes for the show (grandparentRatingKey)
|
||||
final allEpisodes = downloadProvider.getDownloadedEpisodesForShow(widget.season.parentRatingKey ?? '');
|
||||
|
||||
// Filter to only this season's episodes
|
||||
final seasonEpisodes = allEpisodes.where((ep) => ep.parentIndex == widget.season.index).toList()
|
||||
..sort((a, b) => (a.index ?? 0).compareTo(b.index ?? 0));
|
||||
|
||||
setState(() {
|
||||
_episodes = seasonEpisodes;
|
||||
_isLoadingEpisodes = false;
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> updateItem(String ratingKey) async {
|
||||
if (_client == null) {
|
||||
return;
|
||||
}
|
||||
_watchStateChanged = true;
|
||||
await super.updateItem(ratingKey);
|
||||
}
|
||||
|
||||
@override
|
||||
void updateItemInLists(String ratingKey, PlexMetadata updatedMetadata) {
|
||||
final index = _episodes.indexWhere((item) => item.ratingKey == ratingKey);
|
||||
if (index != -1) {
|
||||
_episodes[index] = updatedMetadata;
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
void didChangeDependencies() {
|
||||
super.didChangeDependencies();
|
||||
if (_routeSubscribed) return;
|
||||
final route = ModalRoute.of(context);
|
||||
if (route is PageRoute) {
|
||||
routeObserver.subscribe(this, route);
|
||||
_routeSubscribed = true;
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
if (_routeSubscribed) {
|
||||
routeObserver.unsubscribe(this);
|
||||
_routeSubscribed = false;
|
||||
}
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
void didPopNext() {
|
||||
// Returning from a child route (e.g., video player).
|
||||
// Suppress the first BACK KeyUp which can otherwise pop this route.
|
||||
_suppressNextBackKeyUp = true;
|
||||
}
|
||||
|
||||
KeyEventResult _handleBackKeyEvent(KeyEvent event) {
|
||||
if (_suppressNextBackKeyUp && event is KeyUpEvent && event.logicalKey.isBackKey) {
|
||||
_suppressNextBackKeyUp = false;
|
||||
return KeyEventResult.handled;
|
||||
}
|
||||
return handleBackKeyNavigation(context, event, result: _watchStateChanged);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final content = Focus(
|
||||
onKeyEvent: (_, event) => _handleBackKeyEvent(event),
|
||||
child: Scaffold(
|
||||
body: CustomScrollView(
|
||||
slivers: [
|
||||
CustomAppBar(
|
||||
title: Text(widget.season.title),
|
||||
pinned: true,
|
||||
onBackPressed: () => Navigator.pop(context, _watchStateChanged),
|
||||
),
|
||||
if (_isLoadingEpisodes)
|
||||
const SliverFillRemaining(child: Center(child: CircularProgressIndicator()))
|
||||
else if (_episodes.isEmpty)
|
||||
SliverFillRemaining(
|
||||
child: Center(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
AppIcon(Symbols.movie_rounded, fill: 1, size: 64, color: tokens(context).textMuted),
|
||||
const SizedBox(height: 16),
|
||||
Text(
|
||||
t.messages.noEpisodesFoundGeneral,
|
||||
style: Theme.of(context).textTheme.titleLarge?.copyWith(color: tokens(context).textMuted),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
)
|
||||
else
|
||||
SliverList(
|
||||
delegate: SliverChildBuilderDelegate((context, index) {
|
||||
final episode = _episodes[index];
|
||||
// Get local poster path for offline mode
|
||||
String? localPosterPath;
|
||||
if (widget.isOffline && episode.serverId != null) {
|
||||
final downloadProvider = context.read<DownloadProvider>();
|
||||
final globalKey = episode.globalKey;
|
||||
// Get the artwork reference and convert to local file path
|
||||
final artworkRef = downloadProvider.getArtworkPaths(globalKey);
|
||||
localPosterPath = artworkRef?.getLocalPath(DownloadStorageService.instance, episode.serverId!);
|
||||
}
|
||||
return _EpisodeCard(
|
||||
episode: episode,
|
||||
client: _client,
|
||||
isOffline: widget.isOffline,
|
||||
localPosterPath: localPosterPath,
|
||||
autofocus: index == 0 && _initialKeyboardMode,
|
||||
onTap: () async {
|
||||
await navigateToVideoPlayerWithRefresh(
|
||||
context,
|
||||
metadata: episode,
|
||||
isOffline: widget.isOffline,
|
||||
onRefresh: _loadEpisodes,
|
||||
);
|
||||
},
|
||||
onRefresh: widget.isOffline ? null : updateItem,
|
||||
onListRefresh: widget.isOffline ? null : _loadEpisodes,
|
||||
);
|
||||
}, childCount: _episodes.length),
|
||||
),
|
||||
SliverPadding(padding: EdgeInsets.only(bottom: MediaQuery.of(context).padding.bottom)),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
final blockSystemBack = Platform.isAndroid && InputModeTracker.isKeyboardMode(context);
|
||||
if (!blockSystemBack) {
|
||||
return content;
|
||||
}
|
||||
|
||||
return PopScope(
|
||||
canPop: false, // Prevent system back from double-popping on Android keyboard/TV
|
||||
// ignore: no-empty-block - required callback, blocks system back on Android TV
|
||||
onPopInvokedWithResult: (didPop, result) {},
|
||||
child: content,
|
||||
);
|
||||
}
|
||||
}
|
||||
import '../../services/plex_client.dart';
|
||||
|
||||
/// Episode card widget with D-pad long-press support
|
||||
class _EpisodeCard extends StatefulWidget {
|
||||
class EpisodeCard extends StatefulWidget {
|
||||
final PlexMetadata episode;
|
||||
final PlexClient? client;
|
||||
final VoidCallback onTap;
|
||||
@@ -341,8 +31,11 @@ class _EpisodeCard extends StatefulWidget {
|
||||
final bool autofocus;
|
||||
final bool isOffline;
|
||||
final String? localPosterPath;
|
||||
final FocusNode? focusNode;
|
||||
final VoidCallback? onNavigateUp;
|
||||
|
||||
const _EpisodeCard({
|
||||
const EpisodeCard({
|
||||
super.key,
|
||||
required this.episode,
|
||||
this.client,
|
||||
required this.onTap,
|
||||
@@ -351,13 +44,15 @@ class _EpisodeCard extends StatefulWidget {
|
||||
this.autofocus = false,
|
||||
this.isOffline = false,
|
||||
this.localPosterPath,
|
||||
this.focusNode,
|
||||
this.onNavigateUp,
|
||||
});
|
||||
|
||||
@override
|
||||
State<_EpisodeCard> createState() => _EpisodeCardState();
|
||||
State<EpisodeCard> createState() => _EpisodeCardState();
|
||||
}
|
||||
|
||||
class _EpisodeCardState extends State<_EpisodeCard> {
|
||||
class _EpisodeCardState extends State<EpisodeCard> {
|
||||
final _contextMenuKey = GlobalKey<MediaContextMenuState>();
|
||||
Offset? _tapPosition;
|
||||
|
||||
@@ -416,33 +111,37 @@ class _EpisodeCardState extends State<_EpisodeCard> {
|
||||
|
||||
final hasActiveProgress = hasProgress && widget.episode.viewOffset! < widget.episode.duration!;
|
||||
|
||||
return FocusableWrapper(
|
||||
autofocus: widget.autofocus,
|
||||
enableLongPress: true,
|
||||
onSelect: widget.onTap,
|
||||
onLongPress: _showContextMenu,
|
||||
borderRadius: 0, // Episode cards have no border radius
|
||||
useBackgroundFocus: true, // Use background color instead of outline
|
||||
disableScale: true, // No scale animation for list items
|
||||
child: MediaContextMenu(
|
||||
key: _contextMenuKey,
|
||||
item: widget.episode,
|
||||
onRefresh: widget.onRefresh,
|
||||
onListRefresh: widget.onListRefresh,
|
||||
onTap: widget.onTap,
|
||||
child: InkWell(
|
||||
key: Key(widget.episode.ratingKey),
|
||||
return Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 4),
|
||||
child: FocusableWrapper(
|
||||
focusNode: widget.focusNode,
|
||||
autofocus: widget.autofocus,
|
||||
enableLongPress: true,
|
||||
onNavigateUp: widget.onNavigateUp,
|
||||
onSelect: widget.onTap,
|
||||
onLongPress: _showContextMenu,
|
||||
disableScale: true,
|
||||
child: MediaContextMenu(
|
||||
key: _contextMenuKey,
|
||||
item: widget.episode,
|
||||
onRefresh: widget.onRefresh,
|
||||
onListRefresh: widget.onListRefresh,
|
||||
onTap: widget.onTap,
|
||||
onTapDown: _storeTapPosition,
|
||||
onLongPress: _showContextMenu,
|
||||
onSecondaryTapDown: _storeTapPosition,
|
||||
onSecondaryTap: _showContextMenu,
|
||||
hoverColor: Theme.of(context).colorScheme.surface.withValues(alpha: 0.05),
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
border: Border(bottom: BorderSide(color: tokens(context).outline, width: 0.5)),
|
||||
),
|
||||
padding: const EdgeInsets.all(16),
|
||||
child: InkWell(
|
||||
key: Key(widget.episode.ratingKey),
|
||||
borderRadius: BorderRadius.circular(FocusTheme.defaultBorderRadius),
|
||||
onTap: widget.onTap,
|
||||
onTapDown: _storeTapPosition,
|
||||
onLongPress: _showContextMenu,
|
||||
onSecondaryTapDown: _storeTapPosition,
|
||||
onSecondaryTap: _showContextMenu,
|
||||
hoverColor: Theme.of(context).colorScheme.surface.withValues(alpha: 0.05),
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
color: Theme.of(context).colorScheme.surfaceContainerLow,
|
||||
borderRadius: BorderRadius.circular(FocusTheme.defaultBorderRadius),
|
||||
),
|
||||
padding: const EdgeInsets.all(12),
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
@@ -658,7 +357,7 @@ class _EpisodeCardState extends State<_EpisodeCard> {
|
||||
// Episode title
|
||||
Expanded(
|
||||
child: Text(
|
||||
widget.episode.title,
|
||||
widget.episode.title!,
|
||||
style: Theme.of(context).textTheme.titleSmall?.copyWith(fontWeight: FontWeight.bold),
|
||||
maxLines: 2,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
@@ -703,6 +402,7 @@ class _EpisodeCardState extends State<_EpisodeCard> {
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import '../focus/dpad_navigator.dart';
|
||||
import '../utils/scroll_utils.dart';
|
||||
|
||||
/// A ListTile that accepts a FocusNode for keyboard/controller navigation.
|
||||
///
|
||||
@@ -81,6 +82,51 @@ class FocusableListTile extends StatefulWidget {
|
||||
class _FocusableListTileState extends State<FocusableListTile> {
|
||||
bool _suppressionConsumed = false;
|
||||
bool _isHoveredOrFocused = false;
|
||||
late FocusNode _effectiveFocusNode;
|
||||
bool _ownsNode = false;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_initFocusNode();
|
||||
}
|
||||
|
||||
@override
|
||||
void didUpdateWidget(FocusableListTile oldWidget) {
|
||||
super.didUpdateWidget(oldWidget);
|
||||
if (widget.focusNode != oldWidget.focusNode) {
|
||||
_disposeFocusNode();
|
||||
_initFocusNode();
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_disposeFocusNode();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
void _initFocusNode() {
|
||||
if (widget.focusNode != null) {
|
||||
_effectiveFocusNode = widget.focusNode!;
|
||||
_ownsNode = false;
|
||||
} else {
|
||||
_effectiveFocusNode = FocusNode();
|
||||
_ownsNode = true;
|
||||
}
|
||||
_effectiveFocusNode.addListener(_onFocusChange);
|
||||
}
|
||||
|
||||
void _disposeFocusNode() {
|
||||
_effectiveFocusNode.removeListener(_onFocusChange);
|
||||
if (_ownsNode) _effectiveFocusNode.dispose();
|
||||
}
|
||||
|
||||
void _onFocusChange() {
|
||||
if (_effectiveFocusNode.hasFocus) {
|
||||
scrollContextToCenter(context);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -104,7 +150,7 @@ class _FocusableListTileState extends State<FocusableListTile> {
|
||||
enabled: widget.enabled,
|
||||
selected: widget.selected,
|
||||
contentPadding: widget.contentPadding,
|
||||
focusNode: widget.suppressInitialSelect ? null : widget.focusNode,
|
||||
focusNode: widget.suppressInitialSelect ? null : _effectiveFocusNode,
|
||||
autofocus: widget.suppressInitialSelect ? false : widget.autofocus,
|
||||
hoverColor: widget.hoverColor,
|
||||
textColor: textColor,
|
||||
@@ -117,7 +163,7 @@ class _FocusableListTileState extends State<FocusableListTile> {
|
||||
}
|
||||
|
||||
return Focus(
|
||||
focusNode: widget.focusNode,
|
||||
focusNode: _effectiveFocusNode,
|
||||
autofocus: widget.autofocus,
|
||||
onKeyEvent: (node, event) {
|
||||
if (SelectKeyUpSuppressor.consumeIfSuppressed(event)) {
|
||||
@@ -138,7 +184,7 @@ class _FocusableListTileState extends State<FocusableListTile> {
|
||||
///
|
||||
/// Uses Flutter's native RadioListTile focus support - no custom styling wrapper.
|
||||
/// Requires a [RadioGroup] ancestor to manage selection state.
|
||||
class FocusableRadioListTile<T> extends StatelessWidget {
|
||||
class FocusableRadioListTile<T> extends StatefulWidget {
|
||||
/// The primary content of the list tile.
|
||||
final Widget? title;
|
||||
|
||||
@@ -175,18 +221,69 @@ class FocusableRadioListTile<T> extends StatelessWidget {
|
||||
this.enabled,
|
||||
});
|
||||
|
||||
@override
|
||||
State<FocusableRadioListTile<T>> createState() => _FocusableRadioListTileState<T>();
|
||||
}
|
||||
|
||||
class _FocusableRadioListTileState<T> extends State<FocusableRadioListTile<T>> {
|
||||
late FocusNode _effectiveFocusNode;
|
||||
bool _ownsNode = false;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_initFocusNode();
|
||||
}
|
||||
|
||||
@override
|
||||
void didUpdateWidget(FocusableRadioListTile<T> oldWidget) {
|
||||
super.didUpdateWidget(oldWidget);
|
||||
if (widget.focusNode != oldWidget.focusNode) {
|
||||
_disposeFocusNode();
|
||||
_initFocusNode();
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_disposeFocusNode();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
void _initFocusNode() {
|
||||
if (widget.focusNode != null) {
|
||||
_effectiveFocusNode = widget.focusNode!;
|
||||
_ownsNode = false;
|
||||
} else {
|
||||
_effectiveFocusNode = FocusNode();
|
||||
_ownsNode = true;
|
||||
}
|
||||
_effectiveFocusNode.addListener(_onFocusChange);
|
||||
}
|
||||
|
||||
void _disposeFocusNode() {
|
||||
_effectiveFocusNode.removeListener(_onFocusChange);
|
||||
if (_ownsNode) _effectiveFocusNode.dispose();
|
||||
}
|
||||
|
||||
void _onFocusChange() {
|
||||
if (_effectiveFocusNode.hasFocus) {
|
||||
scrollContextToCenter(context);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return RadioListTile<T>(
|
||||
title: title,
|
||||
subtitle: subtitle,
|
||||
secondary: secondary,
|
||||
value: value,
|
||||
title: widget.title,
|
||||
subtitle: widget.subtitle,
|
||||
secondary: widget.secondary,
|
||||
value: widget.value,
|
||||
// groupValue and onChanged provided by RadioGroup ancestor
|
||||
dense: dense,
|
||||
focusNode: focusNode,
|
||||
autofocus: autofocus,
|
||||
enabled: enabled,
|
||||
dense: widget.dense,
|
||||
focusNode: _effectiveFocusNode,
|
||||
autofocus: widget.autofocus,
|
||||
enabled: widget.enabled,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -194,7 +291,7 @@ class FocusableRadioListTile<T> extends StatelessWidget {
|
||||
/// A SwitchListTile that accepts a FocusNode for keyboard/controller navigation.
|
||||
///
|
||||
/// Uses Flutter's native SwitchListTile focus support - no custom styling wrapper.
|
||||
class FocusableSwitchListTile extends StatelessWidget {
|
||||
class FocusableSwitchListTile extends StatefulWidget {
|
||||
/// The primary content of the list tile.
|
||||
final Widget? title;
|
||||
|
||||
@@ -231,17 +328,68 @@ class FocusableSwitchListTile extends StatelessWidget {
|
||||
this.autofocus = false,
|
||||
});
|
||||
|
||||
@override
|
||||
State<FocusableSwitchListTile> createState() => _FocusableSwitchListTileState();
|
||||
}
|
||||
|
||||
class _FocusableSwitchListTileState extends State<FocusableSwitchListTile> {
|
||||
late FocusNode _effectiveFocusNode;
|
||||
bool _ownsNode = false;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_initFocusNode();
|
||||
}
|
||||
|
||||
@override
|
||||
void didUpdateWidget(FocusableSwitchListTile oldWidget) {
|
||||
super.didUpdateWidget(oldWidget);
|
||||
if (widget.focusNode != oldWidget.focusNode) {
|
||||
_disposeFocusNode();
|
||||
_initFocusNode();
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_disposeFocusNode();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
void _initFocusNode() {
|
||||
if (widget.focusNode != null) {
|
||||
_effectiveFocusNode = widget.focusNode!;
|
||||
_ownsNode = false;
|
||||
} else {
|
||||
_effectiveFocusNode = FocusNode();
|
||||
_ownsNode = true;
|
||||
}
|
||||
_effectiveFocusNode.addListener(_onFocusChange);
|
||||
}
|
||||
|
||||
void _disposeFocusNode() {
|
||||
_effectiveFocusNode.removeListener(_onFocusChange);
|
||||
if (_ownsNode) _effectiveFocusNode.dispose();
|
||||
}
|
||||
|
||||
void _onFocusChange() {
|
||||
if (_effectiveFocusNode.hasFocus) {
|
||||
scrollContextToCenter(context);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return SwitchListTile(
|
||||
title: title,
|
||||
subtitle: subtitle,
|
||||
secondary: secondary,
|
||||
value: value,
|
||||
onChanged: onChanged,
|
||||
dense: dense,
|
||||
focusNode: focusNode,
|
||||
autofocus: autofocus,
|
||||
title: widget.title,
|
||||
subtitle: widget.subtitle,
|
||||
secondary: widget.secondary,
|
||||
value: widget.value,
|
||||
onChanged: widget.onChanged,
|
||||
dense: widget.dense,
|
||||
focusNode: _effectiveFocusNode,
|
||||
autofocus: widget.autofocus,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,6 +33,9 @@ class FocusableTabChip extends StatefulWidget {
|
||||
/// Called when the user presses BACK from this chip.
|
||||
final VoidCallback? onBack;
|
||||
|
||||
/// Called when SELECT key is held (D-pad long press).
|
||||
final VoidCallback? onLongPress;
|
||||
|
||||
const FocusableTabChip({
|
||||
super.key,
|
||||
required this.label,
|
||||
@@ -43,6 +46,7 @@ class FocusableTabChip extends StatefulWidget {
|
||||
this.onNavigateRight,
|
||||
this.onNavigateDown,
|
||||
this.onBack,
|
||||
this.onLongPress,
|
||||
});
|
||||
|
||||
@override
|
||||
@@ -80,6 +84,7 @@ class _FocusableTabChipState extends State<FocusableTabChip> with FocusableChipS
|
||||
event,
|
||||
ChipKeyCallbacks(
|
||||
onSelect: widget.onSelect,
|
||||
onLongPress: widget.onLongPress,
|
||||
onNavigateLeft: widget.onNavigateLeft,
|
||||
onNavigateRight: widget.onNavigateRight,
|
||||
onNavigateDown: widget.onNavigateDown,
|
||||
|
||||
+49
-19
@@ -12,7 +12,6 @@ import '../providers/download_provider.dart';
|
||||
import '../services/download_storage_service.dart';
|
||||
import '../providers/settings_provider.dart';
|
||||
import '../screens/media_detail_screen.dart';
|
||||
import '../screens/season_detail_screen.dart';
|
||||
import '../services/settings_service.dart';
|
||||
import '../utils/provider_extensions.dart';
|
||||
import '../utils/formatters.dart';
|
||||
@@ -519,7 +518,7 @@ class _MediaCardList extends StatelessWidget {
|
||||
color: tokens(context).textMuted.withValues(alpha: 0.85),
|
||||
fontSize: _subtitleFontSize,
|
||||
);
|
||||
final episodeTitle = metadata.displaySubtitle ?? metadata.title;
|
||||
final episodeTitle = metadata.displaySubtitle ?? metadata.displayTitle;
|
||||
final episodeNum = metadata.index != null ? ' E${metadata.index}' : '';
|
||||
return Row(
|
||||
children: [
|
||||
@@ -784,7 +783,7 @@ class _MediaCardHelpers {
|
||||
|
||||
// For episodes, show "S# · Episode Title" with clickable season link
|
||||
if (metadata.isEpisode && metadata.parentIndex != null) {
|
||||
final episodeTitle = metadata.displaySubtitle ?? metadata.title;
|
||||
final episodeTitle = metadata.displaySubtitle ?? metadata.displayTitle;
|
||||
if (metadata.parentRatingKey != null) {
|
||||
return Row(
|
||||
children: [
|
||||
@@ -935,28 +934,53 @@ bool _hasClickableTitle(PlexMetadata metadata) {
|
||||
return false;
|
||||
}
|
||||
|
||||
/// Navigate to season detail from episode metadata
|
||||
/// Navigate to a show with the season tab pre-selected from episode metadata
|
||||
void _navigateToSeason(BuildContext context, PlexMetadata episode, {bool isOffline = false}) {
|
||||
if (episode.parentRatingKey == null) return;
|
||||
final seasonStub = PlexMetadata(
|
||||
ratingKey: episode.parentRatingKey!,
|
||||
key: '/library/metadata/${episode.parentRatingKey}',
|
||||
type: 'season',
|
||||
title: episode.parentTitle ?? 'Season ${episode.parentIndex ?? ''}',
|
||||
index: episode.parentIndex,
|
||||
parentRatingKey: episode.grandparentRatingKey,
|
||||
thumb: episode.parentThumb,
|
||||
serverId: episode.serverId,
|
||||
serverName: episode.serverName,
|
||||
);
|
||||
Navigator.push(context, MaterialPageRoute(builder: (_) => SeasonDetailScreen(season: seasonStub, isOffline: isOffline)));
|
||||
if (episode.grandparentRatingKey != null) {
|
||||
// Navigate to the show with the season pre-selected
|
||||
final showStub = PlexMetadata(
|
||||
ratingKey: episode.grandparentRatingKey!,
|
||||
key: '/library/metadata/${episode.grandparentRatingKey}',
|
||||
type: 'show',
|
||||
title: episode.grandparentTitle ?? episode.displayTitle,
|
||||
thumb: episode.grandparentThumb,
|
||||
art: episode.grandparentArt,
|
||||
serverId: episode.serverId,
|
||||
serverName: episode.serverName,
|
||||
);
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (_) => MediaDetailScreen(
|
||||
metadata: showStub,
|
||||
isOffline: isOffline,
|
||||
initialSeasonIndex: episode.parentIndex,
|
||||
),
|
||||
),
|
||||
);
|
||||
} else if (episode.parentRatingKey != null) {
|
||||
// Fallback: navigate to season directly if no grandparent
|
||||
final seasonStub = PlexMetadata(
|
||||
ratingKey: episode.parentRatingKey!,
|
||||
key: '/library/metadata/${episode.parentRatingKey}',
|
||||
type: 'season',
|
||||
title: episode.parentTitle ?? 'Season ${episode.parentIndex ?? ''}',
|
||||
index: episode.parentIndex,
|
||||
parentRatingKey: episode.grandparentRatingKey,
|
||||
thumb: episode.parentThumb,
|
||||
serverId: episode.serverId,
|
||||
serverName: episode.serverName,
|
||||
);
|
||||
Navigator.push(context, MaterialPageRoute(builder: (_) => MediaDetailScreen(metadata: seasonStub, isOffline: isOffline)));
|
||||
}
|
||||
}
|
||||
|
||||
/// Navigate to the detail screen for a metadata item.
|
||||
/// For episodes/seasons: navigates to the parent show.
|
||||
/// For episodes/seasons: navigates to the parent show with season pre-selected.
|
||||
/// For movies and other types: navigates to the item's own detail page.
|
||||
void _navigateToDetail(BuildContext context, PlexMetadata metadata, {bool isOffline = false}) {
|
||||
PlexMetadata target = metadata;
|
||||
int? initialSeasonIndex;
|
||||
|
||||
if (metadata.isEpisode && metadata.grandparentRatingKey != null) {
|
||||
target = PlexMetadata(
|
||||
@@ -970,6 +994,7 @@ void _navigateToDetail(BuildContext context, PlexMetadata metadata, {bool isOffl
|
||||
serverName: metadata.serverName,
|
||||
);
|
||||
} else if (metadata.isSeason && metadata.parentRatingKey != null) {
|
||||
initialSeasonIndex = metadata.index;
|
||||
target = PlexMetadata(
|
||||
ratingKey: metadata.parentRatingKey!,
|
||||
key: '/library/metadata/${metadata.parentRatingKey}',
|
||||
@@ -982,7 +1007,12 @@ void _navigateToDetail(BuildContext context, PlexMetadata metadata, {bool isOffl
|
||||
);
|
||||
}
|
||||
|
||||
Navigator.push(context, MaterialPageRoute(builder: (_) => MediaDetailScreen(metadata: target, isOffline: isOffline)));
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (_) => MediaDetailScreen(metadata: target, isOffline: isOffline, initialSeasonIndex: initialSeasonIndex),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
/// Text widget that shows hover underline + pointer cursor only in pointer mode.
|
||||
|
||||
@@ -7,9 +7,12 @@ import '../services/plex_client.dart';
|
||||
import '../services/play_queue_launcher.dart';
|
||||
import '../models/plex_metadata.dart';
|
||||
import '../models/plex_playlist.dart';
|
||||
import '../utils/content_utils.dart';
|
||||
import '../providers/download_provider.dart';
|
||||
import '../providers/multi_server_provider.dart';
|
||||
import '../providers/offline_mode_provider.dart';
|
||||
import '../providers/offline_watch_provider.dart';
|
||||
import '../providers/user_profile_provider.dart';
|
||||
import '../utils/provider_extensions.dart';
|
||||
import '../utils/app_logger.dart';
|
||||
import '../utils/library_refresh_notifier.dart';
|
||||
@@ -21,7 +24,6 @@ import '../focus/focusable_button.dart';
|
||||
import '../focus/dpad_navigator.dart';
|
||||
import '../screens/media_detail_screen.dart';
|
||||
import '../screens/metadata_edit_screen.dart';
|
||||
import '../screens/season_detail_screen.dart';
|
||||
import '../utils/smart_deletion_handler.dart';
|
||||
import '../utils/deletion_notifier.dart';
|
||||
import '../theme/mono_tokens.dart';
|
||||
@@ -135,6 +137,12 @@ class MediaContextMenuState extends State<MediaContextMenu> {
|
||||
// Check if we should use bottom sheet (on iOS and Android)
|
||||
final useBottomSheet = Platform.isIOS || Platform.isAndroid;
|
||||
|
||||
// Check if user has admin privileges (server owned + admin or single user)
|
||||
final multiServerProvider = Provider.of<MultiServerProvider>(context, listen: false);
|
||||
final server = _itemServerId != null ? multiServerProvider.serverManager.getServer(_itemServerId!) : null;
|
||||
final currentUser = context.read<UserProfileProvider>().currentUser;
|
||||
final isAdmin = server?.owned == true && (currentUser == null || currentUser.admin);
|
||||
|
||||
// Build menu actions
|
||||
final menuActions = <_MenuAction>[];
|
||||
|
||||
@@ -190,11 +198,12 @@ class MediaContextMenuState extends State<MediaContextMenu> {
|
||||
menuActions.add(_MenuAction(value: 'rate', icon: Symbols.star_rounded, label: t.mediaMenu.rate));
|
||||
}
|
||||
|
||||
// Edit Metadata (for movies, shows, seasons, and episodes)
|
||||
if (mediaType == PlexMediaType.movie ||
|
||||
mediaType == PlexMediaType.show ||
|
||||
mediaType == PlexMediaType.season ||
|
||||
mediaType == PlexMediaType.episode) {
|
||||
// Edit Metadata (for movies, shows, seasons, and episodes) — admin only
|
||||
if (isAdmin &&
|
||||
(mediaType == PlexMediaType.movie ||
|
||||
mediaType == PlexMediaType.show ||
|
||||
mediaType == PlexMediaType.season ||
|
||||
mediaType == PlexMediaType.episode)) {
|
||||
menuActions.add(
|
||||
_MenuAction(value: 'edit_metadata', icon: Symbols.edit_rounded, label: t.metadataEdit.editMetadata),
|
||||
);
|
||||
@@ -211,12 +220,12 @@ class MediaContextMenuState extends State<MediaContextMenu> {
|
||||
);
|
||||
}
|
||||
|
||||
// Go to Series (for episodes and seasons) — hide if already on that series' detail screen,
|
||||
// or on a season screen belonging to the same series
|
||||
// Go to Series (for episodes and seasons) — hide if already on that series' detail screen
|
||||
final ancestorMediaDetail = context.findAncestorWidgetOfExactType<MediaDetailScreen>();
|
||||
final ancestorSeasonDetail = context.findAncestorWidgetOfExactType<SeasonDetailScreen>();
|
||||
final ancestorSeriesKey =
|
||||
ancestorMediaDetail?.metadata.ratingKey ?? ancestorSeasonDetail?.season.parentRatingKey;
|
||||
final ancestorMeta = ancestorMediaDetail?.metadata;
|
||||
final ancestorSeriesKey = ancestorMeta != null && ancestorMeta.isSeason
|
||||
? ancestorMeta.parentRatingKey
|
||||
: ancestorMeta?.ratingKey;
|
||||
// For episodes, the show key is grandparentRatingKey; for seasons, it's parentRatingKey
|
||||
final itemSeriesKey =
|
||||
mediaType == PlexMediaType.episode ? metadata.grandparentRatingKey : metadata.parentRatingKey;
|
||||
@@ -226,11 +235,12 @@ class MediaContextMenuState extends State<MediaContextMenu> {
|
||||
menuActions.add(_MenuAction(value: 'series', icon: Symbols.tv_rounded, label: t.mediaMenu.goToSeries));
|
||||
}
|
||||
|
||||
// Go to Season (for episodes) — hide if already on that season's detail screen
|
||||
// Go to Season (for episodes) — hide if already viewing that season's MediaDetailScreen
|
||||
if (mediaType == PlexMediaType.episode &&
|
||||
metadata.parentTitle != null &&
|
||||
context.findAncestorWidgetOfExactType<SeasonDetailScreen>()?.season.ratingKey !=
|
||||
metadata.parentRatingKey) {
|
||||
!(ancestorMeta != null &&
|
||||
ancestorMeta.isSeason &&
|
||||
ancestorMeta.ratingKey == metadata.parentRatingKey)) {
|
||||
menuActions.add(
|
||||
_MenuAction(value: 'season', icon: Symbols.playlist_play_rounded, label: t.mediaMenu.goToSeason),
|
||||
);
|
||||
@@ -289,11 +299,12 @@ class MediaContextMenuState extends State<MediaContextMenu> {
|
||||
menuActions.add(_MenuAction(value: 'add_to', icon: Symbols.add_rounded, label: t.common.addTo));
|
||||
}
|
||||
|
||||
// Delete media item (for episodes, movies, shows, and seasons)
|
||||
if (mediaType == PlexMediaType.episode ||
|
||||
mediaType == PlexMediaType.movie ||
|
||||
mediaType == PlexMediaType.show ||
|
||||
mediaType == PlexMediaType.season) {
|
||||
// Delete media item (for episodes, movies, shows, and seasons) — admin only
|
||||
if (isAdmin &&
|
||||
(mediaType == PlexMediaType.episode ||
|
||||
mediaType == PlexMediaType.movie ||
|
||||
mediaType == PlexMediaType.show ||
|
||||
mediaType == PlexMediaType.season)) {
|
||||
menuActions.add(
|
||||
_MenuAction(
|
||||
value: 'delete_media',
|
||||
@@ -316,7 +327,7 @@ class MediaContextMenuState extends State<MediaContextMenu> {
|
||||
context,
|
||||
showDragHandle: true,
|
||||
builder: (context) => _FocusableContextMenuSheet(
|
||||
title: widget.item.title,
|
||||
title: widget.item.displayTitle,
|
||||
actions: menuActions,
|
||||
focusFirstItem: openedFromKeyboard,
|
||||
),
|
||||
@@ -451,10 +462,15 @@ class MediaContextMenuState extends State<MediaContextMenu> {
|
||||
|
||||
case 'season':
|
||||
didNavigate = true;
|
||||
// Navigate to the show with the season tab pre-selected
|
||||
final seasonParentKey = metadata!.mediaType == PlexMediaType.episode
|
||||
? metadata.grandparentRatingKey
|
||||
: metadata.parentRatingKey;
|
||||
final seasonIndex = metadata.parentIndex;
|
||||
await _navigateToRelated(
|
||||
context,
|
||||
metadata!.parentRatingKey,
|
||||
(metadata) => SeasonDetailScreen(season: metadata),
|
||||
seasonParentKey,
|
||||
(show) => MediaDetailScreen(metadata: show, initialSeasonIndex: seasonIndex),
|
||||
t.messages.errorLoadingSeason,
|
||||
);
|
||||
break;
|
||||
@@ -581,7 +597,7 @@ class MediaContextMenuState extends State<MediaContextMenu> {
|
||||
await OverlaySheetController.showAdaptive(
|
||||
context,
|
||||
isScrollControlled: true,
|
||||
builder: (context) => FileInfoBottomSheet(fileInfo: fileInfo, title: metadata.title),
|
||||
builder: (context) => FileInfoBottomSheet(fileInfo: fileInfo, title: metadata.displayTitle),
|
||||
);
|
||||
} else if (context.mounted) {
|
||||
showErrorSnackBar(context, t.messages.fileInfoNotAvailable);
|
||||
@@ -651,7 +667,7 @@ class MediaContextMenuState extends State<MediaContextMenu> {
|
||||
|
||||
try {
|
||||
final metadata = widget.item as PlexMetadata;
|
||||
final itemType = metadata.type.toLowerCase();
|
||||
final itemType = metadata.mediaType.name;
|
||||
|
||||
// Load playlists
|
||||
final playlists = await client.getPlaylists(playlistType: 'video');
|
||||
@@ -736,7 +752,7 @@ class MediaContextMenuState extends State<MediaContextMenu> {
|
||||
|
||||
try {
|
||||
final metadata = widget.item as PlexMetadata;
|
||||
final itemType = metadata.type.toLowerCase();
|
||||
final itemType = metadata.mediaType;
|
||||
|
||||
// Get the library section ID from the item
|
||||
// First try from the metadata itself
|
||||
@@ -760,8 +776,8 @@ class MediaContextMenuState extends State<MediaContextMenu> {
|
||||
}
|
||||
|
||||
// If still not found, try to extract from the key field
|
||||
if (sectionId == null) {
|
||||
final keyMatch = RegExp(r'/library/sections/(\d+)').firstMatch(metadata.key);
|
||||
if (sectionId == null && metadata.key != null) {
|
||||
final keyMatch = RegExp(r'/library/sections/(\d+)').firstMatch(metadata.key!);
|
||||
if (keyMatch != null) {
|
||||
sectionId = int.tryParse(keyMatch.group(1)!);
|
||||
appLogger.d(' - Extracted from key: $sectionId');
|
||||
@@ -825,18 +841,20 @@ class MediaContextMenuState extends State<MediaContextMenu> {
|
||||
// Determine the collection type based on the item type
|
||||
int? collectionType;
|
||||
switch (itemType) {
|
||||
case 'movie':
|
||||
case PlexMediaType.movie:
|
||||
collectionType = 1;
|
||||
break;
|
||||
case 'show':
|
||||
case PlexMediaType.show:
|
||||
collectionType = 2;
|
||||
break;
|
||||
case 'season':
|
||||
case PlexMediaType.season:
|
||||
collectionType = 3;
|
||||
break;
|
||||
case 'episode':
|
||||
case PlexMediaType.episode:
|
||||
collectionType = 4;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
appLogger.d('Creating collection "$collectionName" with type $collectionType');
|
||||
@@ -935,7 +953,7 @@ class MediaContextMenuState extends State<MediaContextMenu> {
|
||||
final confirmed = await showDeleteConfirmation(
|
||||
context,
|
||||
title: t.collections.removeFromCollection,
|
||||
message: t.collections.removeFromCollectionConfirm(title: metadata.title),
|
||||
message: t.collections.removeFromCollectionConfirm(title: metadata.displayTitle),
|
||||
);
|
||||
|
||||
if (!confirmed || !context.mounted) return;
|
||||
@@ -992,7 +1010,7 @@ class MediaContextMenuState extends State<MediaContextMenu> {
|
||||
Future<void> _handleDelete(BuildContext context, bool isCollection, bool isPlaylist) async {
|
||||
final client = _getClientForItem();
|
||||
|
||||
final itemTitle = widget.item.title;
|
||||
final itemTitle = widget.item.displayTitle;
|
||||
final itemTypeLabel = isCollection ? t.collections.collection : t.playlists.playlist;
|
||||
|
||||
// Show confirmation dialog
|
||||
@@ -1094,7 +1112,7 @@ class MediaContextMenuState extends State<MediaContextMenu> {
|
||||
final confirmed = await showDeleteConfirmation(
|
||||
context,
|
||||
title: t.downloads.deleteDownload,
|
||||
message: t.downloads.deleteConfirm(title: metadata.title),
|
||||
message: t.downloads.deleteConfirm(title: metadata.displayTitle),
|
||||
);
|
||||
|
||||
if (!confirmed || !context.mounted) return;
|
||||
@@ -1248,7 +1266,7 @@ class _CollectionSelectionDialog extends StatelessWidget {
|
||||
final collection = collections[index - 1];
|
||||
return ListTile(
|
||||
leading: const AppIcon(Symbols.collections_rounded, fill: 1),
|
||||
title: Text(collection.title),
|
||||
title: Text(collection.title!),
|
||||
subtitle: collection.childCount != null ? Text('${collection.childCount} items') : null,
|
||||
onTap: () => Navigator.pop(context, collection.ratingKey),
|
||||
);
|
||||
|
||||
@@ -577,6 +577,7 @@ class _OverlaySheetHostState extends State<OverlaySheetHost> with SingleTickerPr
|
||||
|
||||
Widget sheet = FocusScope(
|
||||
node: _sheetFocusScopeNode,
|
||||
onKeyEvent: _handleKeyEvent,
|
||||
child: Focus(
|
||||
canRequestFocus: false,
|
||||
skipTraversal: true,
|
||||
|
||||
@@ -357,10 +357,14 @@ class PlexOptimizedImage extends StatelessWidget {
|
||||
}
|
||||
|
||||
Widget _buildPlaceholder(BuildContext _) {
|
||||
return SkeletonLoader(
|
||||
child: fallbackIcon != null
|
||||
? Center(child: AppIcon(fallbackIcon!, fill: 1, size: 40, color: Colors.white54))
|
||||
: null,
|
||||
return SizedBox(
|
||||
width: width,
|
||||
height: height,
|
||||
child: SkeletonLoader(
|
||||
child: fallbackIcon != null
|
||||
? Center(child: AppIcon(fallbackIcon!, fill: 1, size: 40, color: Colors.white54))
|
||||
: null,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ import 'package:material_symbols_icons/symbols.dart';
|
||||
import '../widgets/app_icon.dart';
|
||||
import '../widgets/overlay_sheet.dart';
|
||||
import '../focus/dpad_navigator.dart';
|
||||
import '../focus/input_mode_tracker.dart';
|
||||
import '../i18n/strings.g.dart';
|
||||
|
||||
class RatingBottomSheet extends StatefulWidget {
|
||||
@@ -59,7 +60,7 @@ class _RatingBottomSheetState extends State<RatingBottomSheet> {
|
||||
const SizedBox(height: 16),
|
||||
Focus(
|
||||
focusNode: _starsFocusNode,
|
||||
autofocus: true,
|
||||
autofocus: InputModeTracker.isKeyboardMode(context),
|
||||
onKeyEvent: _handleStarsKeyEvent,
|
||||
child: LayoutBuilder(
|
||||
builder: (context, constraints) {
|
||||
|
||||
@@ -57,7 +57,7 @@ class QueueSheet extends StatelessWidget {
|
||||
return FocusableListTile(
|
||||
leading: _buildThumbnail(context, item, isCurrent, isTablet: isTablet),
|
||||
title: Text(
|
||||
item.title,
|
||||
item.title!,
|
||||
style: TextStyle(
|
||||
color: isCurrent ? primaryColor : null,
|
||||
fontWeight: isCurrent ? FontWeight.bold : FontWeight.normal,
|
||||
@@ -139,7 +139,7 @@ class QueueSheet extends StatelessWidget {
|
||||
if (item.year != null) {
|
||||
return item.editionTitle != null ? '${item.year} · ${item.editionTitle}' : '${item.year}';
|
||||
}
|
||||
return item.type;
|
||||
return item.mediaType.name;
|
||||
}
|
||||
|
||||
static dynamic _tryGetClient(BuildContext context, PlexMetadata item) {
|
||||
|
||||
@@ -441,14 +441,30 @@ class _PlexVideoControlsState extends State<PlexVideoControls> with WindowListen
|
||||
}
|
||||
|
||||
Future<void> _skipMarker() async {
|
||||
if (_currentMarker != null) {
|
||||
final endTime = _currentMarker!.endTime;
|
||||
if (_currentMarker == null) return;
|
||||
|
||||
final marker = _currentMarker!;
|
||||
final endTime = marker.endTime;
|
||||
final duration = widget.player.state.duration;
|
||||
final isAtEnd = duration > Duration.zero &&
|
||||
(duration - endTime).inMilliseconds <= 1000;
|
||||
|
||||
if (marker.isCredits && isAtEnd) {
|
||||
// Credits extend to end of video — don't seek (unreliable due to
|
||||
// position stream throttling). Go to next episode or exit player.
|
||||
if (widget.onNext != null) {
|
||||
widget.onNext!.call();
|
||||
} else {
|
||||
widget.onBack?.call();
|
||||
}
|
||||
} else {
|
||||
await _seekToPosition(endTime);
|
||||
if (!mounted) return;
|
||||
setState(() {
|
||||
_currentMarker = null;
|
||||
});
|
||||
}
|
||||
|
||||
if (!mounted) return;
|
||||
setState(() {
|
||||
_currentMarker = null;
|
||||
});
|
||||
_cancelAutoSkipTimer();
|
||||
_cancelSkipButtonDismissTimer();
|
||||
}
|
||||
@@ -514,16 +530,7 @@ class _PlexVideoControlsState extends State<PlexVideoControls> with WindowListen
|
||||
/// Perform the appropriate skip action based on marker type and next episode availability
|
||||
void _performAutoSkip() {
|
||||
if (_currentMarker == null) return;
|
||||
|
||||
final isCredits = _currentMarker!.isCredits;
|
||||
final hasNextEpisode = widget.onNext != null;
|
||||
final showNextEpisode = isCredits && hasNextEpisode;
|
||||
|
||||
if (showNextEpisode) {
|
||||
widget.onNext?.call();
|
||||
} else {
|
||||
unawaited(_skipMarker());
|
||||
}
|
||||
unawaited(_skipMarker());
|
||||
}
|
||||
|
||||
/// Check if auto-skip should be active for the current marker
|
||||
@@ -664,9 +671,12 @@ class _PlexVideoControlsState extends State<PlexVideoControls> with WindowListen
|
||||
}
|
||||
// Remove lifecycle observer
|
||||
WidgetsBinding.instance.removeObserver(this);
|
||||
// Remove window listener
|
||||
// Remove window listener and reset always-on-top if it was enabled
|
||||
if (Platform.isWindows || Platform.isLinux || Platform.isMacOS) {
|
||||
windowManager.removeListener(this);
|
||||
if (_isAlwaysOnTop) {
|
||||
windowManager.setAlwaysOnTop(false);
|
||||
}
|
||||
}
|
||||
if (Platform.isMacOS) {
|
||||
_pipService.isPipActive.removeListener(_onMacPipChanged);
|
||||
@@ -929,7 +939,10 @@ class _PlexVideoControlsState extends State<PlexVideoControls> with WindowListen
|
||||
final client = _getClientForMetadata();
|
||||
appLogger.d('_loadPlaybackExtras: got client with serverId=${client.serverId}');
|
||||
|
||||
final extras = await client.getPlaybackExtras(widget.metadata.ratingKey);
|
||||
final settings = await SettingsService.getInstance();
|
||||
final introPattern = settings.getIntroPattern();
|
||||
final creditsPattern = settings.getCreditsPattern();
|
||||
final extras = await client.getPlaybackExtras(widget.metadata.ratingKey, introPattern: introPattern, creditsPattern: creditsPattern);
|
||||
appLogger.d('_loadPlaybackExtras: got ${extras.chapters.length} chapters');
|
||||
|
||||
if (mounted) {
|
||||
@@ -948,7 +961,7 @@ class _PlexVideoControlsState extends State<PlexVideoControls> with WindowListen
|
||||
final cacheKey = '/library/metadata/${widget.metadata.ratingKey}';
|
||||
final cached = await PlexApiCache.instance.get(serverId, cacheKey);
|
||||
if (cached != null) {
|
||||
final extras = _parsePlaybackExtrasFromCache(cached);
|
||||
final extras = await _parsePlaybackExtrasFromCache(cached);
|
||||
appLogger.d('_loadPlaybackExtras: loaded ${extras.chapters.length} chapters from cache');
|
||||
if (mounted) {
|
||||
setState(() {
|
||||
@@ -966,7 +979,7 @@ class _PlexVideoControlsState extends State<PlexVideoControls> with WindowListen
|
||||
}
|
||||
|
||||
/// Parse PlaybackExtras from cached API response (for offline playback)
|
||||
PlaybackExtras _parsePlaybackExtrasFromCache(Map<String, dynamic> cached) {
|
||||
Future<PlaybackExtras> _parsePlaybackExtrasFromCache(Map<String, dynamic> cached) async {
|
||||
final chapters = <PlexChapter>[];
|
||||
final markers = <PlexMarker>[];
|
||||
|
||||
@@ -1003,7 +1016,13 @@ class _PlexVideoControlsState extends State<PlexVideoControls> with WindowListen
|
||||
}
|
||||
}
|
||||
|
||||
return PlaybackExtras.withChapterFallback(chapters: chapters, markers: markers);
|
||||
final settings = await SettingsService.getInstance();
|
||||
return PlaybackExtras.withChapterFallback(
|
||||
chapters: chapters,
|
||||
markers: markers,
|
||||
introPatternStr: settings.getIntroPattern(),
|
||||
creditsPatternStr: settings.getCreditsPattern(),
|
||||
);
|
||||
}
|
||||
|
||||
TrackControlsState _buildTrackControlsState({
|
||||
@@ -2097,8 +2116,11 @@ class _PlexVideoControlsState extends State<PlexVideoControls> with WindowListen
|
||||
final isCredits = _currentMarker!.isCredits;
|
||||
final hasNextEpisode = widget.onNext != null;
|
||||
|
||||
// Show "Next Episode" for credits when next episode is available
|
||||
final bool showNextEpisode = isCredits && hasNextEpisode;
|
||||
// Show "Next Episode" only when credits extend to end AND there's a next episode
|
||||
final bool creditsAtEnd = isCredits &&
|
||||
widget.player.state.duration > Duration.zero &&
|
||||
(widget.player.state.duration - _currentMarker!.endTime).inMilliseconds <= 1000;
|
||||
final bool showNextEpisode = creditsAtEnd && hasNextEpisode;
|
||||
String baseButtonText;
|
||||
if (showNextEpisode) {
|
||||
baseButtonText = 'Next Episode';
|
||||
|
||||
@@ -474,7 +474,7 @@ class ContentStripState extends State<ContentStrip> {
|
||||
const AppIcon(Symbols.image_rounded, fill: 1, color: Colors.white54, size: 34),
|
||||
)
|
||||
: null,
|
||||
title: item.title,
|
||||
title: item.title!,
|
||||
subtitle: _buildQueueSubtitle(item),
|
||||
onTap: onTap,
|
||||
);
|
||||
@@ -511,7 +511,7 @@ class ContentStripState extends State<ContentStrip> {
|
||||
}
|
||||
if (item.grandparentTitle != null) return item.grandparentTitle!;
|
||||
if (item.year != null) return item.editionTitle != null ? '${item.year} · ${item.editionTitle}' : '${item.year}';
|
||||
return item.type;
|
||||
return item.mediaType.name;
|
||||
}
|
||||
|
||||
Widget _buildStripItem({
|
||||
|
||||
+10
-1
@@ -33,6 +33,8 @@ class PerformanceStatsService {
|
||||
int _frameCount = 0;
|
||||
DateTime _lastFpsUpdate = DateTime.now();
|
||||
double? _currentUiFps;
|
||||
bool _fpsTrackingActive = false;
|
||||
bool _fpsCallbackRegistered = false;
|
||||
|
||||
// Track runtime player type for logging (can differ from Dart object type after fallback)
|
||||
// Values: 'exoplayer', 'mpv', or 'unknown'
|
||||
@@ -77,11 +79,16 @@ class PerformanceStatsService {
|
||||
void _startFpsTracking() {
|
||||
_frameCount = 0;
|
||||
_lastFpsUpdate = DateTime.now();
|
||||
SchedulerBinding.instance.addPersistentFrameCallback(_onFrame);
|
||||
_fpsTrackingActive = true;
|
||||
if (!_fpsCallbackRegistered) {
|
||||
_fpsCallbackRegistered = true;
|
||||
SchedulerBinding.instance.addPersistentFrameCallback(_onFrame);
|
||||
}
|
||||
}
|
||||
|
||||
/// Called every frame to count FPS.
|
||||
void _onFrame(Duration timestamp) {
|
||||
if (!_fpsTrackingActive) return;
|
||||
_frameCount++;
|
||||
final now = DateTime.now();
|
||||
final elapsed = now.difference(_lastFpsUpdate);
|
||||
@@ -96,6 +103,8 @@ class PerformanceStatsService {
|
||||
void stopPolling() {
|
||||
_pollingTimer?.cancel();
|
||||
_pollingTimer = null;
|
||||
_fpsTrackingActive = false;
|
||||
_currentUiFps = null;
|
||||
}
|
||||
|
||||
/// Fetch all performance stats from the player.
|
||||
|
||||
@@ -54,14 +54,14 @@ class VideoControlsHeader extends StatelessWidget {
|
||||
|
||||
Widget _buildSingleLineTitle() {
|
||||
// Build single-line title combining series and episode info
|
||||
final seriesName = metadata.grandparentTitle ?? metadata.title;
|
||||
final seriesName = metadata.grandparentTitle ?? metadata.title!;
|
||||
final hasEpisodeInfo = metadata.parentIndex != null && metadata.index != null;
|
||||
|
||||
List<String> parts = [seriesName];
|
||||
|
||||
if (hasEpisodeInfo) {
|
||||
parts.add('S${metadata.parentIndex}E${metadata.index}');
|
||||
parts.add(metadata.title);
|
||||
parts.add(metadata.title!);
|
||||
}
|
||||
|
||||
return Text(
|
||||
@@ -78,7 +78,7 @@ class VideoControlsHeader extends StatelessWidget {
|
||||
if (metadata.parentIndex != null && metadata.index != null) {
|
||||
secondLineParts.add('S${metadata.parentIndex}');
|
||||
secondLineParts.add('E${metadata.index}');
|
||||
secondLineParts.add(metadata.title);
|
||||
secondLineParts.add(metadata.title!);
|
||||
}
|
||||
|
||||
if (metadata.duration != null) {
|
||||
@@ -89,7 +89,7 @@ class VideoControlsHeader extends StatelessWidget {
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
metadata.grandparentTitle ?? metadata.title,
|
||||
metadata.grandparentTitle ?? metadata.title!,
|
||||
style: const TextStyle(color: Colors.white, fontSize: 16, fontWeight: FontWeight.bold),
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user