Skip to content

Commit 76bb2c5

Browse files
committed
Merge remote-tracking branch 'upstream/master' into l10n_master
2 parents 30699b1 + bbdd007 commit 76bb2c5

File tree

150 files changed

+1909
-1232
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

150 files changed

+1909
-1232
lines changed

.env.example

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,15 +83,16 @@ SLACK_ENDPOINT=https://myconan.net/null/
8383
# S3_AVATAR_REGION=
8484
# S3_AVATAR_BUCKET=
8585
# S3_AVATAR_BASE_URL=
86-
# AVATAR_CACHE_PURGE_PREFIX=
87-
# AVATAR_CACHE_PURGE_METHOD=
88-
# AVATAR_CACHE_PURGE_AUTHORIZATION_KEY=
8986
# DEFAULT_AVATAR=http://localhost/images/layout/avatar-guest@2x.png
9087

88+
# S3_BEATMAPSET_BUCKET=beatmapsets
89+
9190
# S3_SCREENSHOT_BUCKET=screenshots
9291
# SCREENSHOTS_SHARED_SECRET=1234567890abcd
9392
# SCREENSHOTS_LEGACY_ID_CUTOFF=1
9493

94+
# CACHE_PROXY_PURGE_AUTHORIZATION_KEY=
95+
9596
# QUEUE_DRIVER=
9697
# CAMO_KEY=
9798
# CAMO_PREFIX=
@@ -229,7 +230,7 @@ CLIENT_CHECK_VERSION=false
229230
# USER_MAX_FRIENDS=250
230231
# USER_MAX_FRIENDS_SUPPORTER=500
231232
# USER_MAX_MULTIPLAYER_DURATION=14
232-
# USER_MAX_MULTIPLAYER_DURATION_SUPPORTER=63
233+
# USER_MAX_MULTIPLAYER_DURATION_SUPPORTER=93
233234
# USER_MAX_PLAYLISTS=1
234235
# USER_MAX_PLAYLISTS_SUPPORTER=5
235236
# USER_MAX_ITEMS_IN_PLAYLIST=256

Dockerfile.deployment

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ RUN echo "install_weak_deps=False" >> /etc/dnf/dnf.conf && \
5656
rpm -i https://rpm.henderkes.com/static-php-1-1.noarch.rpm && \
5757
microdnf module enable -y php-zts:static-$(cat /.php-version) && \
5858
microdnf install -y \
59+
ffmpeg-free \
5960
frankenphp \
6061
libjpeg-turbo-utils \
6162
nginx \

Dockerfile.development

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ RUN echo "install_weak_deps=False" >> /etc/dnf/dnf.conf && \
1010
microdnf install -y \
1111
chromedriver \
1212
chromium \
13+
ffmpeg-free \
1314
frankenphp \
1415
git \
1516
libjpeg-turbo-utils \
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
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+
6+
declare(strict_types=1);
7+
8+
namespace App\Exceptions;
9+
10+
class CacheProxyPurgeException extends \Exception
11+
{
12+
}

app/Http/Controllers/ContestEntriesController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public function judgeResults($contestId, $id)
4343
$includes[] = 'judge_votes.user';
4444
}
4545

46-
$entries = $contest->entriesByType(null)->loadMissing($relationships);
46+
$entries = $contest->entriesWithScore()->loadMissing($relationships);
4747
foreach ($entries as $entry) {
4848
$entry->setRelation('contest', $contest);
4949
}

app/Http/Controllers/ContestsController.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,18 @@ public function index()
2727

2828
public function judge($id)
2929
{
30-
$contest = Contest::with('entries.judgeVotes')
31-
->with('entries.judgeVotes.scores')
30+
$contest = Contest::with('entries.judgeVotes.scores')
3231
->with('scoringCategories')
3332
->findOrFail($id);
3433

3534
abort_if(!$contest->isJudged(), 404);
3635

3736
priv_check('ContestJudgeShow', $contest)->ensureCan();
3837

38+
foreach ($contest->entries as $entry) {
39+
$entry->setRelation('contest', $contest);
40+
}
41+
3942
$contestJson = json_item($contest, new ContestTransformer(), [
4043
'current_user_attributes',
4144
'entries.current_user_judge_vote.scores',

app/Http/Controllers/LegacyInterOpController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
use App\Exceptions\Handler as ExceptionHandler;
99
use App\Jobs\EsDocument;
1010
use App\Jobs\Notifications\ForumTopicReply;
11-
use App\Jobs\RegenerateBeatmapsetCover;
11+
use App\Jobs\RegenerateBeatmapsetMedia;
1212
use App\Libraries\Chat;
1313
use App\Models\Beatmap;
1414
use App\Models\Beatmapset;
@@ -58,7 +58,7 @@ public function indexBeatmapset($id)
5858
$beatmapset = Beatmapset::withTrashed()->findOrFail($id);
5959

6060
if (!$beatmapset->trashed()) {
61-
$job = (new RegenerateBeatmapsetCover($beatmapset))->onQueue('beatmap_default');
61+
$job = (new RegenerateBeatmapsetMedia($beatmapset))->onQueue('beatmap_default');
6262
$this->dispatch($job);
6363
}
6464

app/Http/Controllers/TagsController.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ public function __construct()
1818

1919
public function index()
2020
{
21+
priv_check('BeatmapsetAdvancedSearch')->ensureCan();
22+
2123
return [
2224
'tags' => app('tags')->json(),
2325
];
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the GNU Affero General Public License v3.0.
44
// See the LICENCE file in the repository root for full licence text.
55

6-
namespace App\Libraries;
6+
namespace App\Interfaces;
77

8-
interface Commentable
8+
interface CommentableInterface
99
{
1010
public function commentLocked(): bool;
1111

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
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+
6+
declare(strict_types=1);
7+
8+
namespace App\Jobs;
9+
10+
use App\Exceptions\BeatmapProcessorException;
11+
use App\Exceptions\SilencedException;
12+
use App\Models\Beatmapset;
13+
use Illuminate\Bus\Queueable;
14+
use Illuminate\Contracts\Queue\ShouldQueue;
15+
use Illuminate\Queue\InteractsWithQueue;
16+
use Illuminate\Queue\SerializesModels;
17+
18+
class RegenerateBeatmapsetMedia implements ShouldQueue
19+
{
20+
use InteractsWithQueue, Queueable, SerializesModels;
21+
22+
/**
23+
* The number of seconds the job can run before timing out.
24+
*
25+
* @var int
26+
*/
27+
public $timeout = 300;
28+
29+
public function __construct(protected Beatmapset $beatmapset)
30+
{
31+
}
32+
33+
public function displayName()
34+
{
35+
return static::class." (Beatmapset {$this->beatmapset->getKey()})";
36+
}
37+
38+
public function handle()
39+
{
40+
$this->runTask(
41+
'regenerate_beatmapset_cover',
42+
fn () => $this->beatmapset->regenerateCovers(),
43+
);
44+
$this->runTask(
45+
'regenerate_beatmapset_preview',
46+
fn () => $this->beatmapset->regenerateAudioPreview(),
47+
);
48+
}
49+
50+
private function runTask(string $task, callable $taskFn): void
51+
{
52+
try {
53+
$taskFn();
54+
datadog_increment("{$task}.ok");
55+
} catch (\Throwable $e) {
56+
datadog_increment("{$task}.error");
57+
log_error(new BeatmapProcessorException(previous: $e), [
58+
'task' => $task,
59+
'id' => $this->beatmapset->getKey(),
60+
]);
61+
throw new SilencedException(previous: $e);
62+
}
63+
}
64+
}

0 commit comments

Comments
 (0)