public function transform(Beatmap $beatmap)
{
$difficulty = $beatmap->difficultyAttribs->where('mode', $beatmap->playmode)->where('mods', 0)->where('attrib_id', 9)->first();
$diff_attrib = $beatmap->difficulty->where('mode', $beatmap->playmode)->where('mods', 0)->first();
return ['beatmapset_id' => $beatmap->beatmapset_id, 'beatmap_id' => $beatmap->beatmap_id, 'approved' => $beatmap->approved, 'total_length' => $beatmap->total_length, 'hit_length' => $beatmap->hit_length, 'version' => $beatmap->version, 'file_md5' => $beatmap->checksum, 'diff_size' => $beatmap->diff_size, 'diff_overall' => $beatmap->diff_overall, 'diff_approach' => $beatmap->diff_approach, 'diff_drain' => $beatmap->diff_drain, 'mode' => $beatmap->playmode, 'playcount' => $beatmap->playcount, 'passcount' => $beatmap->passcount, 'approved_date' => $beatmap->beatmapset->approved_date ? $beatmap->beatmapset->approved_date->toDateTimeString() : null, 'last_update' => $beatmap->beatmapset->last_update->tz('Australia/Perth')->toDateTimeString(), 'artist' => $beatmap->beatmapset->artist, 'title' => $beatmap->beatmapset->title, 'creator' => $beatmap->beatmapset->creator, 'bpm' => $beatmap->beatmapset->bpm, 'source' => $beatmap->beatmapset->source, 'tags' => $beatmap->beatmapset->tags, 'genre_id' => $beatmap->beatmapset->genre_id, 'language_id' => $beatmap->beatmapset->language_id, 'favourite_count' => $beatmap->beatmapset->favourite_count, 'max_combo' => $difficulty ? $difficulty->value : null, 'difficultyrating' => $diff_attrib ? $diff_attrib->diff_unified : 0];
}