aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/initializers/migrations/0450-streaming-playlist-files.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/initializers/migrations/0450-streaming-playlist-files.ts')
-rw-r--r--server/initializers/migrations/0450-streaming-playlist-files.ts16
1 files changed, 5 insertions, 11 deletions
diff --git a/server/initializers/migrations/0450-streaming-playlist-files.ts b/server/initializers/migrations/0450-streaming-playlist-files.ts
index 460dac8be..08e2e3989 100644
--- a/server/initializers/migrations/0450-streaming-playlist-files.ts
+++ b/server/initializers/migrations/0450-streaming-playlist-files.ts
@@ -1,15 +1,9 @@
1import * as Sequelize from 'sequelize' 1import * as Sequelize from 'sequelize'
2import { join } from 'path'
3import { HLS_STREAMING_PLAYLIST_DIRECTORY, WEBSERVER } from '@server/initializers/constants'
4import { CONFIG } from '@server/initializers/config'
5import { pathExists, stat, writeFile } from 'fs-extra'
6import * as parseTorrent from 'parse-torrent'
7import { createTorrentPromise } from '@server/helpers/webtorrent'
8 2
9async function up (utils: { 3async function up (utils: {
10 transaction: Sequelize.Transaction, 4 transaction: Sequelize.Transaction
11 queryInterface: Sequelize.QueryInterface, 5 queryInterface: Sequelize.QueryInterface
12 sequelize: Sequelize.Sequelize, 6 sequelize: Sequelize.Sequelize
13 db: any 7 db: any
14}): Promise<void> { 8}): Promise<void> {
15 { 9 {
@@ -42,8 +36,8 @@ async function up (utils: {
42 { 36 {
43 const query = 'insert into "videoFile" ' + 37 const query = 'insert into "videoFile" ' +
44 '(resolution, size, "infoHash", "videoId", "createdAt", "updatedAt", fps, extname, "videoStreamingPlaylistId")' + 38 '(resolution, size, "infoHash", "videoId", "createdAt", "updatedAt", fps, extname, "videoStreamingPlaylistId")' +
45 '(SELECT "videoFile".resolution, "videoFile".size, \'fake\', NULL, "videoFile"."createdAt", "videoFile"."updatedAt", "videoFile"."fps", ' + 39 '(SELECT "videoFile".resolution, "videoFile".size, \'fake\', NULL, "videoFile"."createdAt", "videoFile"."updatedAt", ' +
46 '"videoFile".extname, "videoStreamingPlaylist".id FROM "videoStreamingPlaylist" ' + 40 '"videoFile"."fps", "videoFile".extname, "videoStreamingPlaylist".id FROM "videoStreamingPlaylist" ' +
47 'inner join video ON video.id = "videoStreamingPlaylist"."videoId" inner join "videoFile" ON "videoFile"."videoId" = video.id)' 41 'inner join video ON video.id = "videoStreamingPlaylist"."videoId" inner join "videoFile" ON "videoFile"."videoId" = video.id)'
48 42
49 await utils.sequelize.query(query, { transaction: utils.transaction }) 43 await utils.sequelize.query(query, { transaction: utils.transaction })