M2-U3+U4 완성: 이어보기 위치 동기화(POST/GET /api/position + PositionStore JSON 영속, 플레이어 5초 주기·종료 저장·재개 시크) + 폰 오프라인 저장(ApiClient.DownloadFileAsync .part 스트리밍, OfflineStore manifest, 라이브러리 💾 버튼, 저장 탭 오프라인 재생/삭제). 서버 RED→GREEN E2E + 에뮬레이터 E2E(위치 13.3→35.2초 이어재생, 서버 정지 후 오프라인 재생 프레임 실증). 104 tests GREEN

This commit is contained in:
Yun Chan 2026-08-15 17:40:28 +09:00
parent 17f3e41cd2
commit 27c91c04dd
9 changed files with 356 additions and 8 deletions

View file

@ -113,6 +113,17 @@ public sealed class ServerHost : IAsyncDisposable
return file == null ? Results.NotFound() : Results.File(file.Value.FullPath, "application/octet-stream", file.Value.FileName);
});
// ── 이어보기 위치 동기화 (U3) ──
var positions = new PositionStore(options.LibraryFolder);
app.MapGet("/api/position/{id}", (string id) => Results.Json(new PositionDto(positions.Get(id))));
app.MapPost("/api/position/{id}", async (string id, HttpContext ctx) =>
{
var body = await ctx.Request.ReadFromJsonAsync<PositionDto>();
if (body == null) return Results.BadRequest();
positions.Set(id, body.PositionSec);
return Results.Ok();
});
// ── 웹 컴패니언 (제로 설치 클라이언트) ──
app.MapGet("/", () => Results.Text(WebCompanion.Html, "text/html; charset=utf-8"));