Is there a way when using listAction
to get all media entries to also retrieve flavorAssets
of those media items? Currently what I am doing is retrieving all media items first, then iterating over each one and using getContextData
action on to get flavorAssets
for each media entry, which is not very effective and can take a long time. My question is, is there a way to do a Kaltura.services.media.listAction(mediaFilter, pager)
while also returning flavorAssets
or contextData
in this case for each item without the need to call for getContextData
action on each media entry?
You can use response profiles to return both the entries and the flavor assets in a single request.
Here's a raw request that will provide you with want you need, just append a KS:
In a more human friendly format:
service=baseEntry
action=list
format=1
filter:objectType=KalturaBaseEntryFilter
filter:orderBy=-createdAt
responseProfile:objectType=KalturaDetachedResponseProfile
responseProfile:fields=id,name
responseProfile:type=1
responseProfile:relatedProfiles:0:objectType=KalturaDetachedResponseProfileArray
responseProfile:relatedProfiles:0:name=flavorAsset
responseProfile:relatedProfiles:0:mappings:0:objectType=ResponseProfileMapping
responseProfile:relatedProfiles:0:mappings:0:parentProperty=id
responseProfile:relatedProfiles:0:mappings:0:filterProperty=entryIdEqual
responseProfile:relatedProfiles:0:filter:objectType=KalturaFlavorAssetFilter
I'm not sure if the JavaScript client library support response profiles, the TypeScript client library does support it.