diff options
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/dev/server.sh | 2 | ||||
-rwxr-xr-x | scripts/generate-code-contributors.ts | 2 | ||||
-rwxr-xr-x | scripts/i18n/create-custom-files.ts | 13 | ||||
-rwxr-xr-x | scripts/update-host.ts | 14 |
4 files changed, 23 insertions, 8 deletions
diff --git a/scripts/dev/server.sh b/scripts/dev/server.sh index 9b8fddac6..b4675c57f 100755 --- a/scripts/dev/server.sh +++ b/scripts/dev/server.sh | |||
@@ -4,7 +4,7 @@ set -eu | |||
4 | 4 | ||
5 | if [ ! -f "./client/dist/en_US/index.html" ]; then | 5 | if [ ! -f "./client/dist/en_US/index.html" ]; then |
6 | echo "client/dist/en_US/index.html does not exist, compile client files..." | 6 | echo "client/dist/en_US/index.html does not exist, compile client files..." |
7 | npm run build:client | 7 | npm run build:client -- --light |
8 | fi | 8 | fi |
9 | 9 | ||
10 | npm run watch:server | 10 | npm run watch:server |
diff --git a/scripts/generate-code-contributors.ts b/scripts/generate-code-contributors.ts index 9824bc2f5..96110307a 100755 --- a/scripts/generate-code-contributors.ts +++ b/scripts/generate-code-contributors.ts | |||
@@ -41,7 +41,7 @@ async function run () { | |||
41 | } | 41 | } |
42 | 42 | ||
43 | function get (url: string, headers: any = {}) { | 43 | function get (url: string, headers: any = {}) { |
44 | return doRequest({ | 44 | return doRequest<any>({ |
45 | uri: url, | 45 | uri: url, |
46 | json: true, | 46 | json: true, |
47 | headers: Object.assign(headers, { | 47 | headers: Object.assign(headers, { |
diff --git a/scripts/i18n/create-custom-files.ts b/scripts/i18n/create-custom-files.ts index eed3182a6..664207e1c 100755 --- a/scripts/i18n/create-custom-files.ts +++ b/scripts/i18n/create-custom-files.ts | |||
@@ -23,12 +23,15 @@ const playerKeys = { | |||
23 | 'Speed': 'Speed', | 23 | 'Speed': 'Speed', |
24 | 'Subtitles/CC': 'Subtitles/CC', | 24 | 'Subtitles/CC': 'Subtitles/CC', |
25 | 'peers': 'peers', | 25 | 'peers': 'peers', |
26 | 'peer': 'peer', | ||
26 | 'Go to the video page': 'Go to the video page', | 27 | 'Go to the video page': 'Go to the video page', |
27 | 'Settings': 'Settings', | 28 | 'Settings': 'Settings', |
28 | 'Uses P2P, others may know you are watching this video.': 'Uses P2P, others may know you are watching this video.', | 29 | 'Uses P2P, others may know you are watching this video.': 'Uses P2P, others may know you are watching this video.', |
29 | 'Copy the video URL': 'Copy the video URL', | 30 | 'Copy the video URL': 'Copy the video URL', |
30 | 'Copy the video URL at the current time': 'Copy the video URL at the current time', | 31 | 'Copy the video URL at the current time': 'Copy the video URL at the current time', |
31 | 'Copy embed code': 'Copy embed code' | 32 | 'Copy embed code': 'Copy embed code', |
33 | 'Total downloaded: ': 'Total downloaded: ', | ||
34 | 'Total uploaded: ': 'Total uploaded: ' | ||
32 | } | 35 | } |
33 | const playerTranslations = { | 36 | const playerTranslations = { |
34 | target: join(__dirname, '../../../client/src/locale/source/player_en_US.xml'), | 37 | target: join(__dirname, '../../../client/src/locale/source/player_en_US.xml'), |
@@ -42,6 +45,12 @@ values(VIDEO_CATEGORIES) | |||
42 | .concat(values(VIDEO_PRIVACIES)) | 45 | .concat(values(VIDEO_PRIVACIES)) |
43 | .concat(values(VIDEO_STATES)) | 46 | .concat(values(VIDEO_STATES)) |
44 | .concat(values(VIDEO_IMPORT_STATES)) | 47 | .concat(values(VIDEO_IMPORT_STATES)) |
48 | .concat([ | ||
49 | 'This video does not exist.', | ||
50 | 'We cannot fetch the video. Please try again later.', | ||
51 | 'Sorry', | ||
52 | 'This video is not available because the remote instance is not responding.' | ||
53 | ]) | ||
45 | .forEach(v => serverKeys[v] = v) | 54 | .forEach(v => serverKeys[v] = v) |
46 | 55 | ||
47 | // More keys | 56 | // More keys |
@@ -103,4 +112,4 @@ function saveToXliffFile (jsonTranslations: TranslationType, cb: Function) { | |||
103 | function handleError (err: any) { | 112 | function handleError (err: any) { |
104 | console.error(err) | 113 | console.error(err) |
105 | process.exit(-1) | 114 | process.exit(-1) |
106 | } \ No newline at end of file | 115 | } |
diff --git a/scripts/update-host.ts b/scripts/update-host.ts index 422a3c9a7..64eba867a 100755 --- a/scripts/update-host.ts +++ b/scripts/update-host.ts | |||
@@ -13,6 +13,7 @@ import { VideoCommentModel } from '../server/models/video/video-comment' | |||
13 | import { getServerActor } from '../server/helpers/utils' | 13 | import { getServerActor } from '../server/helpers/utils' |
14 | import { AccountModel } from '../server/models/account/account' | 14 | import { AccountModel } from '../server/models/account/account' |
15 | import { VideoChannelModel } from '../server/models/video/video-channel' | 15 | import { VideoChannelModel } from '../server/models/video/video-channel' |
16 | import { VideoStreamingPlaylistModel } from '../server/models/video/video-streaming-playlist' | ||
16 | 17 | ||
17 | run() | 18 | run() |
18 | .then(() => process.exit(0)) | 19 | .then(() => process.exit(0)) |
@@ -109,11 +110,9 @@ async function run () { | |||
109 | 110 | ||
110 | console.log('Updating video and torrent files.') | 111 | console.log('Updating video and torrent files.') |
111 | 112 | ||
112 | const videos = await VideoModel.list() | 113 | const videos = await VideoModel.listLocal() |
113 | for (const video of videos) { | 114 | for (const video of videos) { |
114 | if (video.isOwned() === false) continue | 115 | console.log('Updating video ' + video.uuid) |
115 | |||
116 | console.log('Updated video ' + video.uuid) | ||
117 | 116 | ||
118 | video.url = getVideoActivityPubUrl(video) | 117 | video.url = getVideoActivityPubUrl(video) |
119 | await video.save() | 118 | await video.save() |
@@ -122,5 +121,12 @@ async function run () { | |||
122 | console.log('Updating torrent file %s of video %s.', file.resolution, video.uuid) | 121 | console.log('Updating torrent file %s of video %s.', file.resolution, video.uuid) |
123 | await video.createTorrentAndSetInfoHash(file) | 122 | await video.createTorrentAndSetInfoHash(file) |
124 | } | 123 | } |
124 | |||
125 | for (const playlist of video.VideoStreamingPlaylists) { | ||
126 | playlist.playlistUrl = CONFIG.WEBSERVER.URL + VideoStreamingPlaylistModel.getHlsMasterPlaylistStaticPath(video.uuid) | ||
127 | playlist.segmentsSha256Url = CONFIG.WEBSERVER.URL + VideoStreamingPlaylistModel.getHlsSha256SegmentsStaticPath(video.uuid) | ||
128 | |||
129 | await playlist.save() | ||
130 | } | ||
125 | } | 131 | } |
126 | } | 132 | } |