Fix: Improve playback progress saving and retrieval (#51)
Co-authored-by: Cursor Agent <[email protected]>
This commit was merged in pull request #51.
This commit is contained in:
co-authored by
Cursor Agent
parent
d933d69b5f
commit
a75a024249
@@ -59,7 +59,11 @@ async function savePlaybackProgress(movieId, token, { time, duration, imdbId, ke
|
||||
try {
|
||||
// Retry once on rare upsert races (409).
|
||||
for (let attempt = 0; attempt < 2; attempt += 1) {
|
||||
const payload = { time, duration };
|
||||
const payload = { time };
|
||||
// Don't send duration when unknown; avoids wiping server-side duration.
|
||||
if (typeof duration === 'number' && Number.isFinite(duration) && duration > 0) {
|
||||
payload.duration = duration;
|
||||
}
|
||||
const safeImdb = typeof imdbId === 'string' ? imdbId.trim() : '';
|
||||
if (safeImdb) payload.imdb_id = safeImdb;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user