diff options
Diffstat (limited to 'shared')
-rw-r--r-- | shared/utils/miscs/sql.ts | 9 | ||||
-rw-r--r-- | shared/utils/videos/video-playlists.ts | 2 |
2 files changed, 10 insertions, 1 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 | } |
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: { | |||
127 | playlistAttrs: VideoPlaylistCreate, | 127 | playlistAttrs: VideoPlaylistCreate, |
128 | expectedStatus?: number | 128 | expectedStatus?: number |
129 | }) { | 129 | }) { |
130 | const path = '/api/v1/video-playlists/' | 130 | const path = '/api/v1/video-playlists' |
131 | 131 | ||
132 | const fields = omit(options.playlistAttrs, 'thumbnailfile') | 132 | const fields = omit(options.playlistAttrs, 'thumbnailfile') |
133 | 133 | ||