perf(player): 续看点加载与进度写盘改为并行且复用同一请求

进播放页与首次准备播放会各要一次续看点,同一次请求跑两遍还串在首帧前;
现在并发请求复用同一 Future,并与上一条进度写盘并行等待,少一个网络往返的起播延迟。
剧场网格海报按布局宽度限制解码尺寸,半屏卡片不再按原图解码。
This commit is contained in:
Vicky authored and trae-solo-agent committed 2026-10-29 11:25:47 +08:00
1 parent 0f777b19f2
commit 63191b4692
3 files changed
+51 -12

No files matched your search

+12
View File
@@ -158,6 +158,18 @@ void main() {
logic.dispose();
});
test('should_share_one_request_when_resume_point_loads_concurrently', () async {
final history = FakeWatchHistory()..saved = const Duration(seconds: 20);
final logic = _logic(history, drama: _drama('signal'));
// 进页与首次准备播放会同时要续看点,只应发一次请求。
await Future.wait([logic.loadResumePoint(), logic.loadResumePoint()]);
expect(logic.resumeLoaded, isTrue);
expect(history.reads, ['signal']);
logic.dispose();
});
test('should_not_seek_when_position_is_zero', () async {
final history = FakeWatchHistory()
..records['signal'] = const WatchProgress(