getMetaData method

Future<BaiduFileMetaList> getMetaData({
  1. required List<int> fsIds,
})

获取文件信息

Implementation

Future<BaiduFileMetaList> getMetaData({
  required List<int> fsIds,
}) async {
  if (fsIds.isEmpty) {
    throw ArgumentError('fsids is empty');
  }

  if (fsIds.length > 100) {
    throw ArgumentError('fsids length is too long');
  }

  final path = 'rest/2.0/xpan/multimedia';
  final method = 'filemetas';

  final idString = '[${fsIds.join(',')}]';

  final map = await _get(path, params: {
    'method': method,
    'fsids': idString,
    'dlink': '1',
  });

  return BaiduFileMetaList.fromJson(map);
}