watchlist: only set updated_at when marking anime as completed

This commit is contained in:
2026-04-26 18:15:41 +02:00
parent 73c49f6649
commit 098b4a1fc0
3 changed files with 9 additions and 10 deletions

View File

@@ -31,19 +31,17 @@ SELECT * FROM anime WHERE id = ? LIMIT 1;
-- name: UpsertWatchListEntry :one
INSERT INTO watch_list_entry (id, user_id, anime_id, status, current_episode, current_time_seconds, updated_at)
VALUES (?, ?, ?, ?, ?, ?, CURRENT_TIMESTAMP)
VALUES (?, ?, ?, ?, ?, ?, NULL)
ON CONFLICT (user_id, anime_id) DO UPDATE SET
status = excluded.status,
current_episode = excluded.current_episode,
current_time_seconds = excluded.current_time_seconds,
updated_at = CURRENT_TIMESTAMP
current_time_seconds = excluded.current_time_seconds
RETURNING *;
-- name: SaveWatchProgress :exec
UPDATE watch_list_entry
SET current_episode = ?,
current_time_seconds = ?,
updated_at = CURRENT_TIMESTAMP
current_time_seconds = ?
WHERE user_id = ? AND anime_id = ?;
-- name: UpsertContinueWatchingEntry :one