Phase 3: Add filmstrip column to DB and update runner

This commit is contained in:
2025-12-28 10:29:40 +11:00
parent 039e126d9a
commit 9cd5cac287
3 changed files with 39 additions and 4 deletions

View File

@@ -201,8 +201,8 @@ async function _executeTest(url, options) {
const userIp = options.userIp || '0.0.0.0';
const insertQuery = `
INSERT INTO test_results (id, url, timestamp, is_mobile, scores, metrics, user_uuid, user_ip)
VALUES ($1, $2, $3, $4, $5, $6, $7, $8)
INSERT INTO test_results (id, url, timestamp, is_mobile, scores, metrics, user_uuid, user_ip, filmstrip)
VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9)
`;
const values = [
testId,
@@ -212,7 +212,8 @@ async function _executeTest(url, options) {
summary.scores,
summary.metrics,
userUuid,
userIp
userIp,
JSON.stringify(summary.filmstrip) // Ensure it's a JSON string
];
try {
@@ -277,7 +278,8 @@ async function getHistory(userUuid, userIp) {
timestamp: row.timestamp, // JS Date
isMobile: row.is_mobile,
scores: row.scores,
metrics: row.metrics
metrics: row.metrics,
filmstrip: row.filmstrip || [] // Return filmstrip if available
}));
} catch (err) {
console.error('Error fetching history from DB:', err);