chore: update Angular cache files and TypeScript build info

This commit is contained in:
2025-09-17 21:27:20 -04:00
parent 3dbfb04b15
commit f3a78b7d7e
12 changed files with 60 additions and 19 deletions
+11 -4
View File
@@ -279,11 +279,17 @@ function ensureTag(userId, name) {
return id;
}
export function likeVideo({ userId, provider, videoId }) {
export function likeVideo({ userId, provider, videoId, title, thumbnail }) {
const tagId = ensureTag(userId, 'like');
// Upsert-like behavior; ignore if exists
db.prepare(`INSERT OR IGNORE INTO video_tags (user_id, provider, video_id, tag_id) VALUES (?, ?, ?, ?)`)
.run(userId, provider, videoId, tagId);
db.prepare(`INSERT OR IGNORE INTO video_tags (user_id, provider, video_id, tag_id, created_at) VALUES (?, ?, ?, ?, ?)`)
.run(userId, provider, videoId, tagId, nowIso());
// Also update the watch_history table with the title and thumbnail
if (title || thumbnail) {
upsertWatchHistory({ userId, provider, videoId, title, thumbnail });
}
return { provider, video_id: videoId };
}
@@ -350,6 +356,7 @@ export function listLikedVideos({ userId, limit = 100, q }) {
SELECT
vt.provider,
vt.video_id,
vt.created_at,
COALESCE(wh.title, '') AS title,
COALESCE(wh.thumbnail, '') AS thumbnail,
wh.last_watched_at AS last_watched_at
@@ -361,7 +368,7 @@ export function listLikedVideos({ userId, limit = 100, q }) {
WHERE vt.user_id = ? AND vt.tag_id = ?
`;
const orderLimit = `
ORDER BY COALESCE(wh.last_watched_at, wh.watched_at) DESC
ORDER BY vt.created_at DESC
LIMIT ?
`;
const query = hasQ