the browser-facing portion of osu!
at master 43 lines 1.1 kB 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 6namespace App\Jobs; 7 8use App\Models\Beatmapset; 9use Illuminate\Bus\Queueable; 10use Illuminate\Contracts\Queue\ShouldQueue; 11use Illuminate\Queue\InteractsWithQueue; 12use Illuminate\Queue\SerializesModels; 13 14class CheckBeatmapsetCovers implements ShouldQueue 15{ 16 use InteractsWithQueue, Queueable, SerializesModels; 17 18 protected $beatmapset; 19 20 /** 21 * Create a new job instance. 22 * 23 * @return void 24 */ 25 public function __construct(Beatmapset $beatmapset) 26 { 27 $this->beatmapset = $beatmapset; 28 } 29 30 /** 31 * Execute the job. 32 * 33 * @return void 34 */ 35 public function handle() 36 { 37 // trigger a cover regeneration if any cover images are missing 38 if (!$this->beatmapset->allCoverImagesPresent()) { 39 $job = (new RegenerateBeatmapsetCover($this->beatmapset))->onQueue('beatmap_high'); 40 dispatch($job); 41 } 42 } 43}