transformToPaths method

  1. @visibleForTesting
List<String> transformToPaths(
  1. Map<String, List<VideoTransformation>> transformers
)

Implementation

@visibleForTesting
List<String> transformToPaths(
    Map<String, List<VideoTransformation>> transformers) {
  return transformers.entries.map((entry) {
    assert(() {
      return !entry.value.any((transformation) =>
          transformation is QualityTransformation &&
          [QualityTValue.Smart, QualityTValue.SmartRetina]
              .contains(transformation.value));
    }(), '"smart" value cannot be used with VideoTransformation');

    return PathTransformer('${entry.key}/video',
            transformations: entry.value
              ..sort(
                  (a, b) => b is VideoThumbsGenerateTransformation ? -1 : 1))
        .path;
  }).toList();
}