-
Notifications
You must be signed in to change notification settings - Fork 387
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Show custom user tags on beatmapset #11750
Open
notbakaneko
wants to merge
21
commits into
ppy:master
Choose a base branch
from
notbakaneko:feature/beatmapset-show-user-tags
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+188
−85
Open
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
545c945
render user tags
notbakaneko 4ae47f9
cache tags locally, only cache beatmap tags with ids and counts; retu…
notbakaneko 4a55d98
return tags with counts with beatmaps
notbakaneko b3fcdfa
add TagJsonWithCount type
notbakaneko d883075
merge user and mapper tags, place mapper tags at the end
notbakaneko 3c9a6f5
do the sorting in controller
notbakaneko 1503ceb
lint
notbakaneko f5552af
return id and counts seperately from full tag
notbakaneko 5ad134a
remove route (get from beatmapset instead)
notbakaneko 3c9c2e5
not nullable
notbakaneko 9e01f3d
don't need the extra join/relation anymore; make into query
notbakaneko 715db03
copy and return typed value instead of messing with original object
notbakaneko dd68826
don't double fetch from redis for transformer
notbakaneko 2b3bb42
should be unique
notbakaneko 05db2c1
removed/unused
notbakaneko 0eefd0b
missing non-incrementing
notbakaneko c9ad28d
memoize all
notbakaneko 421504c
add composite key test; add missing timestamp properties
notbakaneko efad0be
tie break with names
notbakaneko cde18d0
don't dedupe mapper tags since they might be names
notbakaneko 572b046
show user tags per beatmap
notbakaneko File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<?php | ||
|
||
// Copyright (c) ppy Pty Ltd <[email protected]>. Licensed under the GNU Affero General Public License v3.0. | ||
// See the LICENCE file in the repository root for full licence text. | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\Singletons; | ||
|
||
use App\Models\Tag; | ||
use App\Traits\Memoizes; | ||
use App\Transformers\TagTransformer; | ||
use Illuminate\Support\Collection; | ||
|
||
class Tags | ||
{ | ||
use Memoizes; | ||
|
||
/** | ||
* @return Collection<Tag> | ||
*/ | ||
public function all(): Collection | ||
{ | ||
return $this->memoize(__FUNCTION__, fn () => Tag::all()); | ||
} | ||
|
||
public function get(int $id): ?Tag | ||
{ | ||
$allById = $this->memoize( | ||
'allById', | ||
fn () => $this->all()->keyBy('id'), | ||
); | ||
|
||
return $allById[$id] ?? null; | ||
} | ||
|
||
public function json(): array | ||
{ | ||
return $this->memoize( | ||
__FUNCTION__, | ||
fn () => json_collection($this->all(), new TagTransformer()), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mutexed seems not very useful when it's just db access? Like, nothing would work if the db is unhealthy.