From 9f79ade627f0044606a9fbbe16ca0154661d12b9 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 19 Mar 2019 14:13:53 +0100 Subject: Refresh playlists --- shared/utils/miscs/sql.ts | 9 +++++++++ shared/utils/videos/video-playlists.ts | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) (limited to 'shared/utils') 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 return seq.query(`UPDATE video SET "${field}" = '${value}' WHERE uuid = '${uuid}'`, options) } +function setPlaylistField (serverNumber: number, uuid: string, field: string, value: string) { + const seq = getSequelize(serverNumber) + + const options = { type: Sequelize.QueryTypes.UPDATE } + + return seq.query(`UPDATE "videoPlaylist" SET "${field}" = '${value}' WHERE uuid = '${uuid}'`, options) +} + async function closeAllSequelize (servers: any[]) { for (let i = 1; i <= servers.length; i++) { if (sequelizes[ i ]) { @@ -51,6 +59,7 @@ async function closeAllSequelize (servers: any[]) { export { setVideoField, + setPlaylistField, setActorField, closeAllSequelize } diff --git a/shared/utils/videos/video-playlists.ts b/shared/utils/videos/video-playlists.ts index 7568852dc..4d110a131 100644 --- a/shared/utils/videos/video-playlists.ts +++ b/shared/utils/videos/video-playlists.ts @@ -127,7 +127,7 @@ function createVideoPlaylist (options: { playlistAttrs: VideoPlaylistCreate, expectedStatus?: number }) { - const path = '/api/v1/video-playlists/' + const path = '/api/v1/video-playlists' const fields = omit(options.playlistAttrs, 'thumbnailfile') -- cgit v1.2.3