Skip to content

Commit

Permalink
Merge branch 'master' into dependabot/pip/idna-3.7
Browse files Browse the repository at this point in the history
  • Loading branch information
NiceAesth authored Apr 21, 2024
2 parents 13dacd9 + 9c8a0f3 commit 228579b
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/docker-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ jobs:

- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: linux/amd64, linux/arm64

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
Expand All @@ -27,7 +29,8 @@ jobs:
uses: docker/build-push-action@v5
with:
context: .
outputs: type=docker,dest=/tmp/docker.tar
platforms: linux/amd64, linux/arm64
outputs: type=oci,dest=/tmp/docker.tar
tags: bancho.py:${{ github.sha }}
cache-from: type=gha
cache-to: type=gha,mode=max
Expand All @@ -50,7 +53,7 @@ jobs:
if: ${{ github.ref == 'refs/heads/master' }}
with:
context: .
platforms: linux/amd64
platforms: linux/amd64, linux/arm64
push: true
tags: |
${{ secrets.DOCKERHUB_USERNAME }}/bancho.py:latest
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ repos:
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/psf/black
rev: 24.3.0
rev: 24.4.0
hooks:
- id: black
- repo: https://github.com/asottile/pyupgrade
Expand Down
4 changes: 4 additions & 0 deletions app/api/domains/osu.py
Original file line number Diff line number Diff line change
Expand Up @@ -454,15 +454,19 @@ async def osuSearchSetHandler(
player: Player = Depends(authenticate_player_session(Query, "u", "h")),
map_set_id: int | None = Query(None, alias="s"),
map_id: int | None = Query(None, alias="b"),
checksum: str | None = Query(None, alias="c"),
) -> Response:
# Since we only need set-specific data, we can basically
# just do same query with either bid or bsid.

v: int | str
if map_set_id is not None:
# this is just a normal request
k, v = ("set_id", map_set_id)
elif map_id is not None:
k, v = ("id", map_id)
elif checksum is not None:
k, v = ("md5", checksum)
else:
return Response(b"") # invalid args

Expand Down
2 changes: 0 additions & 2 deletions app/api/v1/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -628,8 +628,6 @@ async def api_get_map_scores(
else:
mods = None

# NOTE: userid will eventually become player_id,
# along with everywhere else in the codebase.
query = [
"SELECT s.map_md5, s.score, s.pp, s.acc, s.max_combo, s.mods, "
"s.n300, s.n100, s.n50, s.nmiss, s.ngeki, s.nkatu, s.grade, s.status, "
Expand Down

0 comments on commit 228579b

Please sign in to comment.