chore(player): report marker counts when loading playback extras

The extras loader logged only the chapter count, so a user report of
"auto skip never fires" could not be told apart from "the server has no
intro marker for this item" — the two need opposite fixes. Log the
marker count and types on all three load paths, including the cache-only
one that previously logged nothing at all.

Drop PlexVideoPlaybackData.markers while here: the playback-start parse
filled it on every item and no caller ever read it, because the player
controls fetch their own PlaybackExtras.

Document why getPlaybackExtras may serve the shared metadata cache row
without a freshness check: getPlaybackInitialization refreshes that row
network-first before the controls mount. That ordering is what makes
cache-first correct, and nothing said so.
This commit is contained in:
edde746
2026-08-02 04:55:54 +02:00
parent 957711a650
commit f78f65faf5
4 changed files with 35 additions and 10 deletions
+17 -2
View File
@@ -1665,8 +1665,23 @@ class PlexClient
}
}
/// Get chapters and markers from cached metadata or fetch if needed
/// Uses same cache key as other metadata methods for consistency
/// Chapters and markers for [ratingKey], from the shared
/// `/library/metadata/{id}` cache row.
///
/// Cache-first is safe here because of an ordering contract, not because
/// markers are static: in the normal online player flow
/// [getPlaybackInitialization] runs [getVideoPlaybackData] — a
/// network-first read of this same cache key with a superset of the query
/// params — before the controls mount and load extras, so the row this
/// serves was refreshed seconds earlier. Offline, and when that read fell
/// back to cache, the row is as old as the cache; a caller that needs the
/// current server state (e.g. after a PMS intro-detection pass finished)
/// must pass [forceRefresh].
///
/// The network call here deliberately stays lean (no `checkFiles` /
/// `includeStreams`) and runs only on a cache miss or [forceRefresh], so it
/// rarely overwrites the shared row with a payload thin enough to force the
/// re-fetch in [_fetchFileInfo].
Future<PlaybackExtras> getPlaybackExtras(
String ratingKey, {
String? introPattern,