containsSavedEpisodes method

Future<Map<String, bool>> containsSavedEpisodes(
  1. List<String> ids
)

Check if passed episode ids are saved by current user. Returns the list of id's mapped with the response whether it has been saved

Implementation

Future<Map<String, bool>> containsSavedEpisodes(List<String> ids) async {
  assert(ids.isNotEmpty, 'No episode ids were provided for checking');
  final jsonString = await _api._get(
      '$_path/episodes/contains?${_buildQuery({'ids': ids.join(',')})}');
  final result = List.castFrom<dynamic, bool>(json.decode(jsonString));

  return Map.fromIterables(ids, result);
}