diff options
author | Chocobozzz <me@florianbigard.com> | 2019-03-19 14:13:53 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2019-03-19 14:13:53 +0100 |
commit | 9f79ade627f0044606a9fbbe16ca0154661d12b9 (patch) | |
tree | ccfc1876da591bc52cbb4b8ccddedbeae7876679 /shared/utils | |
parent | 0e0c745b62b2f18e228328e8c4f95b17e54f7a5e (diff) | |
download | PeerTube-9f79ade627f0044606a9fbbe16ca0154661d12b9.tar.gz PeerTube-9f79ade627f0044606a9fbbe16ca0154661d12b9.tar.zst PeerTube-9f79ade627f0044606a9fbbe16ca0154661d12b9.zip |
Refresh playlists
Diffstat (limited to 'shared/utils')
-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 | ||