From 1ba1450e9cf8277e9dfcd49409d45103971abca7 Mon Sep 17 00:00:00 2001 From: Michael C Date: Tue, 13 Jul 2021 15:45:24 -0400 Subject: [PATCH] string literal fixes & npm run postgres:docker --- package.json | 1 + src/routes/dumpDatabase.ts | 14 +++++++------- src/routes/postSkipSegments.ts | 32 ++++++++++++++++---------------- src/routes/voteOnSponsorTime.ts | 18 +++++++++--------- 4 files changed, 33 insertions(+), 32 deletions(-) diff --git a/package.json b/package.json index fcba30c..bcced54 100644 --- a/package.json +++ b/package.json @@ -7,6 +7,7 @@ "test": "npm run tsc && ts-node test/test.ts", "dev": "nodemon", "dev:bash": "nodemon -x 'npm test ; npm start'", + "postgres:docker": "docker run --rm -p 5432:5432 -e POSTGRES_USER=ci_db_user -e POSTGRES_PASSWORD=ci_db_pass postgres:alpine", "start": "ts-node src/index.ts", "tsc": "tsc -p tsconfig.json", "lint": "eslint src test", diff --git a/src/routes/dumpDatabase.ts b/src/routes/dumpDatabase.ts index fa1d262..5a05dba 100644 --- a/src/routes/dumpDatabase.ts +++ b/src/routes/dumpDatabase.ts @@ -127,13 +127,13 @@ export default async function dumpDatabase(req: Request, res: Response, showPage - ${latestDumpFiles.map((item:any) => { - return ` - - ${item.tableName} - ${item.tableName}.csv - - `; + ${latestDumpFiles.map((item:any) => { + return ` + + ${item.tableName} + ${item.tableName}.csv + + `; }).join("")} ${latestDumpFiles.length === 0 ? 'Please wait: Generating files' : ""} diff --git a/src/routes/postSkipSegments.ts b/src/routes/postSkipSegments.ts index 5535dd0..d160218 100644 --- a/src/routes/postSkipSegments.ts +++ b/src/routes/postSkipSegments.ts @@ -71,10 +71,10 @@ async function sendWebhooks(apiVideoInfo: APIVideoInfo, userID: string, videoID: "embeds": [{ "title": data?.title, "url": `https://www.youtube.com/watch?v=${videoID}&t=${(parseInt(startTime.toFixed(0)) - 2)}`, - "description": "Submission ID: " + UUID + - "\n\nTimestamp: " + - getFormattedTime(startTime) + " to " + getFormattedTime(endTime) + - "\n\nCategory: " + segmentInfo.category, + "description": `Submission ID: ${UUID}\ + \n\nTimestamp: \ + ${getFormattedTime(startTime)} to ${getFormattedTime(endTime)}\ + \n\nCategory: ${segmentInfo.category}`, "color": 10813440, "author": { "name": userID, @@ -127,13 +127,13 @@ async function sendWebhooksNB(userID: string, videoID: string, UUID: string, sta "embeds": [{ "title": ytData.items[0].snippet.title, "url": `https://www.youtube.com/watch?v=${videoID}&t=${(parseFloat(startTime.toFixed(0)) - 2)}`, - "description": "**Submission ID:** " + UUID + - "\n**Timestamp:** " + getFormattedTime(startTime) + " to " + getFormattedTime(endTime) + - "\n**Predicted Probability:** " + probability + - "\n**Category:** " + category + - "\n**Submitted by:** " + submittedBy + - "\n**Total User Submissions:** " + submissionInfoRow.count + - "\n**Ignored User Submissions:** " + submissionInfoRow.disregarded, + "description": `**Submission ID:** ${UUID}\ + \n**Timestamp:** ${getFormattedTime(startTime)} to ${getFormattedTime(endTime)}\ + \n**Predicted Probability:** ${probability}\ + \n**Category:** ${category}\ + \n**Submitted by:** ${submittedBy}\ + \n**Total User Submissions:** ${submissionInfoRow.count}\ + \n**Ignored User Submissions:** ${submissionInfoRow.disregarded}`, "color": 10813440, "thumbnail": { "url": ytData.items[0].snippet.thumbnails.maxres ? ytData.items[0].snippet.thumbnails.maxres.url : "", @@ -419,11 +419,11 @@ export async function postSkipSegments(req: Request, res: Response): Promise