aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/server-commands/miscs
diff options
context:
space:
mode:
Diffstat (limited to 'shared/server-commands/miscs')
-rw-r--r--shared/server-commands/miscs/sql-command.ts8
1 files changed, 7 insertions, 1 deletions
diff --git a/shared/server-commands/miscs/sql-command.ts b/shared/server-commands/miscs/sql-command.ts
index 09a99f834..f163cc8c9 100644
--- a/shared/server-commands/miscs/sql-command.ts
+++ b/shared/server-commands/miscs/sql-command.ts
@@ -1,4 +1,5 @@
1import { QueryTypes, Sequelize } from 'sequelize' 1import { QueryTypes, Sequelize } from 'sequelize'
2import { forceNumber } from '@shared/core-utils'
2import { AbstractCommand } from '../shared' 3import { AbstractCommand } from '../shared'
3 4
4export class SQLCommand extends AbstractCommand { 5export class SQLCommand extends AbstractCommand {
@@ -23,6 +24,11 @@ export class SQLCommand extends AbstractCommand {
23 return parseInt(total, 10) 24 return parseInt(total, 10)
24 } 25 }
25 26
27 async getInternalFileUrl (fileId: number) {
28 return this.selectQuery(`SELECT "fileUrl" FROM "videoFile" WHERE id = ${fileId}`)
29 .then(rows => rows[0].fileUrl as string)
30 }
31
26 setActorField (to: string, field: string, value: string) { 32 setActorField (to: string, field: string, value: string) {
27 const seq = this.getSequelize() 33 const seq = this.getSequelize()
28 34
@@ -58,7 +64,7 @@ export class SQLCommand extends AbstractCommand {
58 64
59 if (!total) return 0 65 if (!total) return 0
60 66
61 return parseInt(total + '', 10) 67 return forceNumber(total)
62 } 68 }
63 69
64 getActorImage (filename: string) { 70 getActorImage (filename: string) {