the browser-facing portion of osu!
at master 819 B view raw
1<?php 2 3// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the GNU Affero General Public License v3.0. 4// See the LICENCE file in the repository root for full licence text. 5 6declare(strict_types=1); 7 8namespace App\Libraries\Opengraph; 9 10use App\Models\Beatmapset; 11 12class BeatmapsetOpengraph implements OpengraphInterface 13{ 14 public function __construct(private Beatmapset $beatmapset) 15 { 16 } 17 18 public function get(): array 19 { 20 $section = osu_trans('layout.menu.beatmaps._'); 21 $title = "{$this->beatmapset->artist} - {$this->beatmapset->title}"; // opengraph header always intended for guest. 22 23 return [ 24 'description' => "osu! » {$section} » {$title}", 25 'image' => $this->beatmapset->coverURL('list'), 26 'title' => $title, 27 ]; 28 } 29}