diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-07-11 16:01:56 +0200 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-07-11 16:01:56 +0200 |
commit | 0a6658fdcbd779ada8f3758048c326e997902d5a (patch) | |
tree | 5de40bf901db0299011104b1344783637b964eb0 /server/lib/request/request-video-qadu-scheduler.ts | |
parent | e6d4b0ff2404dcf0b3a755c3fcc415ffeb6e754d (diff) | |
download | PeerTube-0a6658fdcbd779ada8f3758048c326e997902d5a.tar.gz PeerTube-0a6658fdcbd779ada8f3758048c326e997902d5a.tar.zst PeerTube-0a6658fdcbd779ada8f3758048c326e997902d5a.zip |
Use global uuid instead of remoteId for videos
Diffstat (limited to 'server/lib/request/request-video-qadu-scheduler.ts')
-rw-r--r-- | server/lib/request/request-video-qadu-scheduler.ts | 16 |
1 files changed, 8 insertions, 8 deletions
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<U> extends RequestsObjects<U> { | |||
21 | datas: U[] | 21 | datas: U[] |
22 | 22 | ||
23 | videos: { | 23 | videos: { |
24 | [ id: string ]: { | 24 | [ uuid: string ]: { |
25 | remoteId: string | 25 | uuid: string |
26 | likes?: number | 26 | likes?: number |
27 | dislikes?: number | 27 | dislikes?: number |
28 | views?: number | 28 | views?: number |
@@ -33,7 +33,7 @@ interface RequestsObjectsCustom<U> extends RequestsObjects<U> { | |||
33 | 33 | ||
34 | export type RequestVideoQaduSchedulerOptions = { | 34 | export type RequestVideoQaduSchedulerOptions = { |
35 | type: RequestVideoQaduType | 35 | type: RequestVideoQaduType |
36 | videoId: string | 36 | videoId: number |
37 | transaction?: Sequelize.Transaction | 37 | transaction?: Sequelize.Transaction |
38 | } | 38 | } |
39 | 39 | ||
@@ -78,7 +78,7 @@ class RequestVideoQaduScheduler extends AbstractRequestScheduler<RequestsVideoQa | |||
78 | 78 | ||
79 | // Maybe another attribute was filled for this video | 79 | // Maybe another attribute was filled for this video |
80 | let videoData = requestsToMakeGrouped[hashKey].videos[video.id] | 80 | let videoData = requestsToMakeGrouped[hashKey].videos[video.id] |
81 | if (!videoData) videoData = { remoteId: null } | 81 | if (!videoData) videoData = { uuid: null } |
82 | 82 | ||
83 | switch (request.type) { | 83 | switch (request.type) { |
84 | case REQUEST_VIDEO_QADU_TYPES.LIKES: | 84 | case REQUEST_VIDEO_QADU_TYPES.LIKES: |
@@ -98,8 +98,8 @@ class RequestVideoQaduScheduler extends AbstractRequestScheduler<RequestsVideoQa | |||
98 | return | 98 | return |
99 | } | 99 | } |
100 | 100 | ||
101 | // Do not forget the remoteId so the remote pod can identify the video | 101 | // Do not forget the uuid so the remote pod can identify the video |
102 | videoData.remoteId = video.id | 102 | videoData.uuid = video.uuid |
103 | requestsToMakeGrouped[hashKey].ids.push(request.id) | 103 | requestsToMakeGrouped[hashKey].ids.push(request.id) |
104 | 104 | ||
105 | // Maybe there are multiple quick and dirty update for the same video | 105 | // Maybe there are multiple quick and dirty update for the same video |
@@ -110,8 +110,8 @@ class RequestVideoQaduScheduler extends AbstractRequestScheduler<RequestsVideoQa | |||
110 | 110 | ||
111 | // Now we deduped similar quick and dirty updates, we can build our requests datas | 111 | // Now we deduped similar quick and dirty updates, we can build our requests datas |
112 | Object.keys(requestsToMakeGrouped).forEach(hashKey => { | 112 | Object.keys(requestsToMakeGrouped).forEach(hashKey => { |
113 | Object.keys(requestsToMakeGrouped[hashKey].videos).forEach(videoId => { | 113 | Object.keys(requestsToMakeGrouped[hashKey].videos).forEach(videoUUID => { |
114 | const videoData = requestsToMakeGrouped[hashKey].videos[videoId] | 114 | const videoData = requestsToMakeGrouped[hashKey].videos[videoUUID] |
115 | 115 | ||
116 | requestsToMakeGrouped[hashKey].datas.push({ | 116 | requestsToMakeGrouped[hashKey].datas.push({ |
117 | data: videoData | 117 | data: videoData |