From 0a6658fdcbd779ada8f3758048c326e997902d5a Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 11 Jul 2017 16:01:56 +0200 Subject: Use global uuid instead of remoteId for videos --- server/lib/request/request-video-event-scheduler.ts | 16 ++++++++-------- server/lib/request/request-video-qadu-scheduler.ts | 16 ++++++++-------- 2 files changed, 16 insertions(+), 16 deletions(-) (limited to 'server/lib/request') diff --git a/server/lib/request/request-video-event-scheduler.ts b/server/lib/request/request-video-event-scheduler.ts index 8a008c51b..680232732 100644 --- a/server/lib/request/request-video-event-scheduler.ts +++ b/server/lib/request/request-video-event-scheduler.ts @@ -12,7 +12,7 @@ import { RequestVideoEventType, RemoteVideoEventRequest, RemoteVideoEventType } export type RequestVideoEventSchedulerOptions = { type: RequestVideoEventType - videoId: string + videoId: number count?: number transaction?: Sequelize.Transaction } @@ -49,7 +49,7 @@ class RequestVideoEventScheduler extends AbstractRequestScheduler { const eventsForPod = eventsPerVideoPerPod[toPodId] - Object.keys(eventsForPod).forEach(remoteId => { - const eventsForVideo = eventsForPod[remoteId] + Object.keys(eventsForPod).forEach(uuid => { + const eventsForVideo = eventsForPod[uuid] Object.keys(eventsForVideo).forEach(eventType => { requestsToMakeGrouped[toPodId].datas.push({ data: { - remoteId, + uuid, eventType: eventType as RemoteVideoEventType, count: +eventsForVideo[eventType] } diff --git a/server/lib/request/request-video-qadu-scheduler.ts b/server/lib/request/request-video-qadu-scheduler.ts index 988165170..afb9d5c23 100644 --- a/server/lib/request/request-video-qadu-scheduler.ts +++ b/server/lib/request/request-video-qadu-scheduler.ts @@ -21,8 +21,8 @@ interface RequestsObjectsCustom extends RequestsObjects { datas: U[] videos: { - [ id: string ]: { - remoteId: string + [ uuid: string ]: { + uuid: string likes?: number dislikes?: number views?: number @@ -33,7 +33,7 @@ interface RequestsObjectsCustom extends RequestsObjects { export type RequestVideoQaduSchedulerOptions = { type: RequestVideoQaduType - videoId: string + videoId: number transaction?: Sequelize.Transaction } @@ -78,7 +78,7 @@ class RequestVideoQaduScheduler extends AbstractRequestScheduler { - Object.keys(requestsToMakeGrouped[hashKey].videos).forEach(videoId => { - const videoData = requestsToMakeGrouped[hashKey].videos[videoId] + Object.keys(requestsToMakeGrouped[hashKey].videos).forEach(videoUUID => { + const videoData = requestsToMakeGrouped[hashKey].videos[videoUUID] requestsToMakeGrouped[hashKey].datas.push({ data: videoData -- cgit v1.2.3