aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/utils/miscs
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-03-19 14:13:53 +0100
committerChocobozzz <me@florianbigard.com>2019-03-19 14:13:53 +0100
commit9f79ade627f0044606a9fbbe16ca0154661d12b9 (patch)
treeccfc1876da591bc52cbb4b8ccddedbeae7876679 /shared/utils/miscs
parent0e0c745b62b2f18e228328e8c4f95b17e54f7a5e (diff)
downloadPeerTube-9f79ade627f0044606a9fbbe16ca0154661d12b9.tar.gz
PeerTube-9f79ade627f0044606a9fbbe16ca0154661d12b9.tar.zst
PeerTube-9f79ade627f0044606a9fbbe16ca0154661d12b9.zip
Refresh playlists
Diffstat (limited to 'shared/utils/miscs')
-rw-r--r--shared/utils/miscs/sql.ts9
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
43function 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
43async function closeAllSequelize (servers: any[]) { 51async 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
52export { 60export {
53 setVideoField, 61 setVideoField,
62 setPlaylistField,
54 setActorField, 63 setActorField,
55 closeAllSequelize 64 closeAllSequelize
56} 65}