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:
@@ -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,
|
||||
|
||||
@@ -74,7 +74,6 @@ PlexVideoPlaybackData parsePlexVideoPlaybackDataFromJson(
|
||||
List<MediaVersion> availableVersions = [];
|
||||
var selectedMediaIndex = 0;
|
||||
var selectedPartIndex = 0;
|
||||
final markers = plexMarkersFromCacheJson(metadataJson);
|
||||
|
||||
if (metadataJson != null) {
|
||||
final mediaList = _mapList(metadataJson['Media']);
|
||||
@@ -148,7 +147,6 @@ PlexVideoPlaybackData parsePlexVideoPlaybackDataFromJson(
|
||||
videoUrl: videoUrl,
|
||||
mediaInfo: mediaInfo,
|
||||
availableVersions: availableVersions,
|
||||
markers: markers,
|
||||
selectedMediaIndex: selectedMediaIndex,
|
||||
selectedPartIndex: selectedPartIndex,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user