Skip to content

Commit

Permalink
fix(FEC-13143): add last update and ownerId to media metadata (#224)
Browse files Browse the repository at this point in the history
* fix(FEC-13143): enhance media metadata

* fix(FEC-13143): upd types

* fix(FEC-13143): upd KalturaMediaEntry type

---------

Co-authored-by: Sergey Marchenko <[email protected]>
  • Loading branch information
semarche-kaltura and semarche authored Oct 31, 2023
1 parent 8ec30df commit 716749e
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 2 deletions.
5 changes: 4 additions & 1 deletion flow-typed/types/media-config-metadata.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,8 @@ declare type ProviderMediaConfigMetadataObject = {
metas?: Object,
tags?: Object,
epgId?: string,
recordingId?: string
recordingId?: string,
updatedAt?: number,
creatorId?: string,
views?: number
};
2 changes: 2 additions & 0 deletions src/k-provider/ovp/provider-parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,8 @@ class OVPProviderParser {
mediaEntry.metadata.entryId = entry.id || '';
mediaEntry.metadata.name = entry.name || '';
if (entry.createdAt) mediaEntry.metadata.createdAt = entry.createdAt;
if (entry.updatedAt) mediaEntry.metadata.updatedAt = entry.updatedAt;
if (entry.creatorId) mediaEntry.metadata.creatorId = entry.creatorId;
if (entry.endDate) mediaEntry.metadata.endDate = entry.endDate;
if (entry.views) mediaEntry.metadata.views = entry.views;
if (entry.plays) mediaEntry.metadata.plays = entry.plays;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//@flow
const FIELDS =
'id,referenceId,name,description,thumbnailUrl,dataUrl,duration,msDuration,flavorParamsIds,mediaType,type,tags,dvrStatus,externalSourceType,status,createdAt,endDate,plays,views,downloadUrl';
'id,referenceId,name,description,thumbnailUrl,dataUrl,duration,msDuration,flavorParamsIds,mediaType,type,tags,dvrStatus,externalSourceType,status,createdAt,updatedAt,endDate,plays,views,downloadUrl,creatorId';
const RESPONSE_PROFILE_TYPE = {
INCLUDE_FIELDS: 1,
EXCLUDE_FIELDS: 2
Expand Down
14 changes: 14 additions & 0 deletions src/k-provider/ovp/response-types/kaltura-media-entry.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,12 @@ export class KalturaMediaEntry {
*/
createdAt: number;

/**
* @member - Entry updation date as Unix timestamp (In seconds)
* @type {number}
*/
updatedAt: number;

/**
* @member - Entry end date as Unix timestamp (In seconds)
* @type {number}
Expand All @@ -148,6 +154,12 @@ export class KalturaMediaEntry {
*/
downloadUrl: string;

/**
* @member - ID of entry creator.
* @type {string}
*/
creatorId: string;

/**
* @constructor
* @param {Object} entry The json response
Expand All @@ -168,6 +180,8 @@ export class KalturaMediaEntry {
this.dvrStatus = entry.dvrStatus;
this.tags = entry.tags;
this.createdAt = entry.createdAt;
this.updatedAt = entry.updatedAt;
this.creatorId = entry.creatorId;
this.endDate = entry.endDate;
this.plays = entry.plays;
this.views = entry.views;
Expand Down

0 comments on commit 716749e

Please sign in to comment.