diff options
Diffstat (limited to 'server/lib/schedulers')
-rw-r--r-- | server/lib/schedulers/plugins-check-scheduler.ts | 10 | ||||
-rw-r--r-- | server/lib/schedulers/videos-redundancy-scheduler.ts | 7 |
2 files changed, 9 insertions, 8 deletions
diff --git a/server/lib/schedulers/plugins-check-scheduler.ts b/server/lib/schedulers/plugins-check-scheduler.ts index 9a1ae3ec5..c95e109b0 100644 --- a/server/lib/schedulers/plugins-check-scheduler.ts +++ b/server/lib/schedulers/plugins-check-scheduler.ts | |||
@@ -1,12 +1,12 @@ | |||
1 | import { chunk } from 'lodash' | ||
2 | import { compareSemVer } from '@shared/core-utils' | ||
1 | import { logger } from '../../helpers/logger' | 3 | import { logger } from '../../helpers/logger' |
2 | import { AbstractScheduler } from './abstract-scheduler' | ||
3 | import { SCHEDULER_INTERVALS_MS } from '../../initializers/constants' | ||
4 | import { CONFIG } from '../../initializers/config' | 4 | import { CONFIG } from '../../initializers/config' |
5 | import { SCHEDULER_INTERVALS_MS } from '../../initializers/constants' | ||
5 | import { PluginModel } from '../../models/server/plugin' | 6 | import { PluginModel } from '../../models/server/plugin' |
6 | import { chunk } from 'lodash' | ||
7 | import { getLatestPluginsVersion } from '../plugins/plugin-index' | ||
8 | import { compareSemVer } from '../../../shared/core-utils/miscs/miscs' | ||
9 | import { Notifier } from '../notifier' | 7 | import { Notifier } from '../notifier' |
8 | import { getLatestPluginsVersion } from '../plugins/plugin-index' | ||
9 | import { AbstractScheduler } from './abstract-scheduler' | ||
10 | 10 | ||
11 | export class PluginsCheckScheduler extends AbstractScheduler { | 11 | export class PluginsCheckScheduler extends AbstractScheduler { |
12 | 12 | ||
diff --git a/server/lib/schedulers/videos-redundancy-scheduler.ts b/server/lib/schedulers/videos-redundancy-scheduler.ts index b5a5eb697..103ab1fab 100644 --- a/server/lib/schedulers/videos-redundancy-scheduler.ts +++ b/server/lib/schedulers/videos-redundancy-scheduler.ts | |||
@@ -267,7 +267,8 @@ export class VideosRedundancyScheduler extends AbstractScheduler { | |||
267 | logger.info('Duplicating %s streaming playlist in videos redundancy with "%s" strategy.', video.url, strategy) | 267 | logger.info('Duplicating %s streaming playlist in videos redundancy with "%s" strategy.', video.url, strategy) |
268 | 268 | ||
269 | const destDirectory = join(HLS_REDUNDANCY_DIRECTORY, video.uuid) | 269 | const destDirectory = join(HLS_REDUNDANCY_DIRECTORY, video.uuid) |
270 | await downloadPlaylistSegments(playlist.playlistUrl, destDirectory, VIDEO_IMPORT_TIMEOUT) | 270 | const masterPlaylistUrl = playlist.getMasterPlaylistUrl(video) |
271 | await downloadPlaylistSegments(masterPlaylistUrl, destDirectory, VIDEO_IMPORT_TIMEOUT) | ||
271 | 272 | ||
272 | const createdModel: MVideoRedundancyStreamingPlaylistVideo = await VideoRedundancyModel.create({ | 273 | const createdModel: MVideoRedundancyStreamingPlaylistVideo = await VideoRedundancyModel.create({ |
273 | expiresOn, | 274 | expiresOn, |
@@ -282,7 +283,7 @@ export class VideosRedundancyScheduler extends AbstractScheduler { | |||
282 | 283 | ||
283 | await sendCreateCacheFile(serverActor, video, createdModel) | 284 | await sendCreateCacheFile(serverActor, video, createdModel) |
284 | 285 | ||
285 | logger.info('Duplicated playlist %s -> %s.', playlist.playlistUrl, createdModel.url) | 286 | logger.info('Duplicated playlist %s -> %s.', masterPlaylistUrl, createdModel.url) |
286 | } | 287 | } |
287 | 288 | ||
288 | private async extendsExpirationOf (redundancy: MVideoRedundancyVideo, expiresAfterMs: number) { | 289 | private async extendsExpirationOf (redundancy: MVideoRedundancyVideo, expiresAfterMs: number) { |
@@ -330,7 +331,7 @@ export class VideosRedundancyScheduler extends AbstractScheduler { | |||
330 | private buildEntryLogId (object: MVideoRedundancyFileVideo | MVideoRedundancyStreamingPlaylistVideo) { | 331 | private buildEntryLogId (object: MVideoRedundancyFileVideo | MVideoRedundancyStreamingPlaylistVideo) { |
331 | if (isMVideoRedundancyFileVideo(object)) return `${object.VideoFile.Video.url}-${object.VideoFile.resolution}` | 332 | if (isMVideoRedundancyFileVideo(object)) return `${object.VideoFile.Video.url}-${object.VideoFile.resolution}` |
332 | 333 | ||
333 | return `${object.VideoStreamingPlaylist.playlistUrl}` | 334 | return `${object.VideoStreamingPlaylist.getMasterPlaylistUrl(object.VideoStreamingPlaylist.Video)}` |
334 | } | 335 | } |
335 | 336 | ||
336 | private getTotalFileSizes (files: MVideoFile[], playlists: MStreamingPlaylistFiles[]) { | 337 | private getTotalFileSizes (files: MVideoFile[], playlists: MStreamingPlaylistFiles[]) { |