From 0a6658fdcbd779ada8f3758048c326e997902d5a Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 11 Jul 2017 16:01:56 +0200 Subject: [PATCH] Use global uuid instead of remoteId for videos --- .../shared/video-abuse/video-abuse.service.ts | 2 +- client/src/app/videos/shared/video.model.ts | 7 +- client/src/app/videos/shared/video.service.ts | 18 +- .../video-edit/video-update.component.ts | 6 +- .../video-list/video-miniature.component.html | 4 +- .../video-watch/video-share.component.ts | 2 +- .../video-watch/video-watch.component.html | 2 +- .../video-watch/video-watch.component.ts | 4 +- .../src/app/videos/videos-routing.module.ts | 8 +- server/controllers/api/remote/videos.ts | 39 ++--- server/controllers/api/users.ts | 2 +- server/controllers/api/videos/abuse.ts | 4 +- server/controllers/api/videos/index.ts | 2 +- server/controllers/api/videos/rate.ts | 2 +- server/controllers/client.ts | 13 +- .../custom-validators/remote/videos.ts | 12 +- server/helpers/custom-validators/videos.ts | 14 +- server/initializers/constants.ts | 2 +- .../initializers/migrations/0005-email-pod.ts | 2 +- .../migrations/0010-email-user.ts | 2 +- .../migrations/0015-video-views.ts | 2 +- .../migrations/0020-video-likes.ts | 2 +- .../migrations/0025-video-dislikes.ts | 2 +- .../migrations/0030-video-category.ts | 2 +- .../migrations/0035-video-licence.ts | 2 +- .../migrations/0040-video-nsfw.ts | 2 +- .../migrations/0045-user-display-nsfw.ts | 2 +- .../migrations/0050-video-language.ts | 2 +- .../migrations/0055-video-uuid.ts | 157 ++++++++++++++++++ server/initializers/migrator.ts | 4 +- server/lib/friends.ts | 4 +- server/lib/jobs/handlers/video-transcoder.ts | 4 +- .../request/request-video-event-scheduler.ts | 16 +- .../request/request-video-qadu-scheduler.ts | 16 +- server/middlewares/validators/users.ts | 15 +- server/middlewares/validators/videos.ts | 24 ++- .../models/user/user-video-rate-interface.ts | 2 +- server/models/user/user-video-rate.ts | 2 +- server/models/video/tag.ts | 2 +- server/models/video/video-abuse-interface.ts | 2 +- server/models/video/video-abuse.ts | 4 +- .../models/video/video-blacklist-interface.ts | 4 +- server/models/video/video-blacklist.ts | 9 +- server/models/video/video-interface.ts | 23 ++- server/models/video/video.ts | 100 ++++++----- server/tests/api/check-params/remotes.js | 2 +- server/tests/api/multiple-pods.js | 31 ++++ server/tests/api/single-pod.js | 21 ++- .../remote-qadu-video-request.model.ts | 2 +- .../remote-video-create-request.model.ts | 2 +- .../remote-video-event-request.model.ts | 2 +- .../remote-video-remove-request.model.ts | 2 +- ...remote-video-report-abuse-request.model.ts | 2 +- .../remote-video-update-request.model.ts | 2 +- shared/models/videos/user-video-rate.model.ts | 2 +- shared/models/videos/video-abuse.model.ts | 2 +- shared/models/videos/video-blacklist.model.ts | 2 +- shared/models/videos/video.model.ts | 3 +- 58 files changed, 450 insertions(+), 176 deletions(-) create mode 100644 server/initializers/migrations/0055-video-uuid.ts diff --git a/client/src/app/shared/video-abuse/video-abuse.service.ts b/client/src/app/shared/video-abuse/video-abuse.service.ts index 32f13b430..636a02084 100644 --- a/client/src/app/shared/video-abuse/video-abuse.service.ts +++ b/client/src/app/shared/video-abuse/video-abuse.service.ts @@ -22,7 +22,7 @@ export class VideoAbuseService { return new RestDataSource(this.authHttp, VideoAbuseService.BASE_VIDEO_ABUSE_URL + 'abuse') } - reportVideo (id: string, reason: string) { + reportVideo (id: number, reason: string) { const body = { reason } diff --git a/client/src/app/videos/shared/video.model.ts b/client/src/app/videos/shared/video.model.ts index f5e16fc13..9ed6a0641 100644 --- a/client/src/app/videos/shared/video.model.ts +++ b/client/src/app/videos/shared/video.model.ts @@ -14,7 +14,8 @@ export class Video implements VideoServerModel { description: string duration: number durationLabel: string - id: string + id: number + uuid: string isLocal: boolean magnetUri: string name: string @@ -51,7 +52,8 @@ export class Video implements VideoServerModel { language: number description: string, duration: number - id: string, + id: number, + uuid: string, isLocal: boolean, magnetUri: string, name: string, @@ -75,6 +77,7 @@ export class Video implements VideoServerModel { this.duration = hash.duration this.durationLabel = Video.createDurationString(hash.duration) this.id = hash.id + this.uuid = hash.uuid this.isLocal = hash.isLocal this.magnetUri = hash.magnetUri this.name = hash.name diff --git a/client/src/app/videos/shared/video.service.ts b/client/src/app/videos/shared/video.service.ts index dc12c0637..67091a8d8 100644 --- a/client/src/app/videos/shared/video.service.ts +++ b/client/src/app/videos/shared/video.service.ts @@ -52,8 +52,8 @@ export class VideoService { return this.loadVideoAttributeEnum('languages', this.videoLanguages) } - getVideo (id: string): Observable