- private updateVideos () {
- return sequelizeTypescript.transaction(async t => {
- const schedules = await ScheduleVideoUpdateModel.listVideosToUpdate(t)
+ private async updateVideos () {
+ if (!await ScheduleVideoUpdateModel.areVideosToUpdate()) return undefined
+
+ const schedules = await ScheduleVideoUpdateModel.listVideosToUpdate()
+ const publishedVideos: MVideoFullLight[] = []
+
+ for (const schedule of schedules) {
+ await sequelizeTypescript.transaction(async t => {
+ const video = await VideoModel.loadFull(schedule.videoId, t)