diff options
Diffstat (limited to 'shared/utils/miscs/sql.ts')
-rw-r--r-- | shared/utils/miscs/sql.ts | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/shared/utils/miscs/sql.ts b/shared/utils/miscs/sql.ts index bb3f63837..1ce3d801a 100644 --- a/shared/utils/miscs/sql.ts +++ b/shared/utils/miscs/sql.ts | |||
@@ -40,6 +40,14 @@ function setVideoField (serverNumber: number, uuid: string, field: string, value | |||
40 | return seq.query(`UPDATE video SET "${field}" = '${value}' WHERE uuid = '${uuid}'`, options) | 40 | return seq.query(`UPDATE video SET "${field}" = '${value}' WHERE uuid = '${uuid}'`, options) |
41 | } | 41 | } |
42 | 42 | ||
43 | function setPlaylistField (serverNumber: number, uuid: string, field: string, value: string) { | ||
44 | const seq = getSequelize(serverNumber) | ||
45 | |||
46 | const options = { type: Sequelize.QueryTypes.UPDATE } | ||
47 | |||
48 | return seq.query(`UPDATE "videoPlaylist" SET "${field}" = '${value}' WHERE uuid = '${uuid}'`, options) | ||
49 | } | ||
50 | |||
43 | async function closeAllSequelize (servers: any[]) { | 51 | async function closeAllSequelize (servers: any[]) { |
44 | for (let i = 1; i <= servers.length; i++) { | 52 | for (let i = 1; i <= servers.length; i++) { |
45 | if (sequelizes[ i ]) { | 53 | if (sequelizes[ i ]) { |
@@ -51,6 +59,7 @@ async function closeAllSequelize (servers: any[]) { | |||
51 | 59 | ||
52 | export { | 60 | export { |
53 | setVideoField, | 61 | setVideoField, |
62 | setPlaylistField, | ||
54 | setActorField, | 63 | setActorField, |
55 | closeAllSequelize | 64 | closeAllSequelize |
56 | } | 65 | } |