containsSavedAlbums method

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

Check if passed albums (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>> containsSavedAlbums(List<String> ids) async {
  assert(ids.isNotEmpty, 'No album ids were provided for checking');
  final jsonString =
      await _api._get('$_path/albums/contains?ids=${ids.join(",")}');
  final result = List.castFrom<dynamic, bool>(json.decode(jsonString));

  return Map.fromIterables(ids, result);
}