From 2922e048de95738b3319054ce0778f873a34a0ee Mon Sep 17 00:00:00 2001 From: Julien Le Bras Date: Wed, 28 Mar 2018 23:38:52 +0200 Subject: Add publishedAt field for video model. * New field added in the `video` table + migration script * `publishedAt` updated to NOW when privacy changes from private to public/unlisted (default = NOW) * Models updated to handle the new attribute * Client interface updated to use `publishedAt` instead of `createdAt` except in My Account > My Videos view --- client/src/app/shared/video/video-miniature.component.html | 2 +- client/src/app/shared/video/video.model.ts | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'client/src/app/shared/video') diff --git a/client/src/app/shared/video/video-miniature.component.html b/client/src/app/shared/video/video-miniature.component.html index 7ac017235..f28e9b8d9 100644 --- a/client/src/app/shared/video/video-miniature.component.html +++ b/client/src/app/shared/video/video-miniature.component.html @@ -11,7 +11,7 @@ - {{ video.createdAt | myFromNow }} - {{ video.views | myNumberFormatter }} views + {{ video.publishedAt | myFromNow }} - {{ video.views | myNumberFormatter }} views {{ video.by }} diff --git a/client/src/app/shared/video/video.model.ts b/client/src/app/shared/video/video.model.ts index 7b68933a1..0c02cbcb9 100644 --- a/client/src/app/shared/video/video.model.ts +++ b/client/src/app/shared/video/video.model.ts @@ -9,6 +9,7 @@ export class Video implements VideoServerModel { by: string createdAt: Date updatedAt: Date + publishedAt: Date category: VideoConstant licence: VideoConstant language: VideoConstant @@ -56,6 +57,7 @@ export class Video implements VideoServerModel { const absoluteAPIUrl = getAbsoluteAPIUrl() this.createdAt = new Date(hash.createdAt.toString()) + this.publishedAt = new Date(hash.publishedAt.toString()) this.category = hash.category this.licence = hash.licence this.language = hash.language -- cgit v1.2.3