OrderBy过滤器不适用于kaltura媒体列出api使用

时间:2018-05-23 13:23:11

标签: node.js kaltura

我从Kaltura获取媒体列表,使用Kaltura-client工作得非常好。但是当尝试使用order by过滤它时,它没有按预期工作(返回相同的列表)。

const Promise = require('bluebird');
const kaltura = require('kaltura-client/KalturaClient');

exports.getMediaList = Promise.method((client, pager) => {

  return new Promise(function (resolve, reject) {

    return kaltura.services.media.listAction({ orderBy: 'CREATE_DATE_DESC'}, pager).execute(client).then((response) => {
      resolve(response.objects);
    }, (error) => {
      reject(error);
    })
  });
});

1 个答案:

答案 0 :(得分:0)

在这里,如果我们通过' -createdAt '对于orderBy,我们可以在最近的列表中获取媒体

const Promise = require('bluebird');
const kaltura = require('kaltura-client/KalturaClient');

exports.getMediaList = Promise.method((client, pager) => {

  return new Promise(function (resolve, reject) {

    return kaltura.services.media.listAction({ orderBy: '-createdAt'}, pager).execute(client).then((response) => {
      resolve(response.objects);
    }, (error) => {
      reject(error);
    })
  });
});