From 9296319d239656a5728e262faf4f43cffe467162 Mon Sep 17 00:00:00 2001
From: Kalle <38327916+Sendouc@users.noreply.github.com>
Date: Sat, 8 Nov 2025 13:54:02 +0200
Subject: [PATCH] Refactor HACKY_resolvePicture away (#2606)
---
.env.example | 2 +
.env.test | 2 +
app/components/elements/TournamentSearch.tsx | 2 +-
app/db/seed/img/alliance-rogue.png | Bin 0 -> 15754 bytes
app/db/seed/img/default.png | Bin 0 -> 10011 bytes
app/db/seed/img/in-the-zone.png | Bin 0 -> 4615 bytes
app/db/seed/img/luti.png | Bin 0 -> 23774 bytes
app/db/seed/img/paddling-pool.png | Bin 0 -> 27178 bytes
app/db/seed/img/picnic.png | Bin 0 -> 30728 bytes
app/db/seed/img/swim-or-sink.png | Bin 0 -> 291194 bytes
app/db/seed/img/the-depths.png | Bin 0 -> 101403 bytes
app/db/seed/index.ts | 102 ++++----
app/features/api-public/routes/org.$id.ts | 10 +-
app/features/api-public/routes/team.$id.ts | 12 +-
.../api-public/routes/tournament.$id.teams.ts | 19 +-
.../api-public/routes/tournament.$id.ts | 6 +-
app/features/art/ArtRepository.server.ts | 27 +-
app/features/art/art-utils.ts | 10 +-
app/features/art/components/ArtGrid.tsx | 5 +-
app/features/art/routes/art.new.tsx | 8 +-
.../calendar/CalendarRepository.server.ts | 6 +-
.../calendar/components/TournamentCard.tsx | 12 +-
app/features/calendar/routes/calendar.new.tsx | 5 +-
.../front-page/loaders/index.server.ts | 5 +-
.../img-upload/ImageRepository.server.test.ts | 68 ++---
.../img-upload/ImageRepository.server.ts | 7 +-
.../img-upload/routes/upload.admin.tsx | 3 +-
.../LeaderboardRepository.server.ts | 11 +-
.../leaderboards/routes/leaderboards.tsx | 9 +-
app/features/lfg/LFGRepository.server.ts | 9 +-
app/features/lfg/components/LFGPost.tsx | 5 +-
.../scrims/ScrimPostRepository.server.ts | 27 +-
app/features/scrims/components/ScrimCard.tsx | 9 +-
app/features/scrims/routes/scrims.$id.tsx | 6 +-
.../sendouq-match/QMatchRepository.server.ts | 22 +-
.../sendouq-match/routes/q.match.$id.tsx | 6 +-
app/features/sendouq/QRepository.server.ts | 2 +-
app/features/team/TeamRepository.server.ts | 25 +-
.../team/components/TeamResultsTable.tsx | 12 +-
.../team/routes/t.$customUrl.edit.tsx | 6 +-
app/features/team/routes/t.$customUrl.tsx | 17 +-
app/features/team/routes/t.tsx | 5 +-
.../core/Tournament.server.ts | 8 -
.../tournament-bracket/core/Tournament.ts | 7 +-
.../tournament-bracket/core/tests/mocks-li.ts | 3 -
.../core/tests/mocks-sos.ts | 4 +-
.../core/tests/mocks-zones-weekly.ts | 3 -
.../tournament-bracket/core/tests/mocks.ts | 12 +-
.../core/tests/test-utils.ts | 4 +-
...TournamentOrganizationRepository.server.ts | 30 +--
.../routes/org.$slug.tsx | 18 +-
.../tournament/TournamentRepository.server.ts | 79 ++----
.../tournament/actions/to.$id.admin.server.ts | 2 +-
.../actions/to.$id.register.server.ts | 2 +-
.../components/TournamentStream.tsx | 2 +-
.../tournament/routes/to.$id.register.tsx | 32 +--
.../tournament/routes/to.$id.seeds.tsx | 8 +-
.../tournament/routes/to.$id.teams.$tid.tsx | 3 +-
app/features/tournament/routes/to.$id.tsx | 9 +-
app/features/tournament/tournament-utils.ts | 124 ---------
.../user-page/UserRepository.server.ts | 23 +-
.../user-page/components/UserResultsTable.tsx | 11 +-
.../user-page/routes/u.$identifier.index.tsx | 5 +-
.../routes/u.$identifier.seasons.tsx | 8 +-
app/routines/notifyCheckInStart.ts | 2 +-
app/utils/kysely.server.ts | 90 ++++++-
app/utils/urls-img.ts | 18 --
app/utils/urls.ts | 2 -
scripts/migrate-tournament-logos-to-s3.ts | 171 ++++++++++++
scripts/seed-art-urls.ts | 48 ++++
scripts/seed-images.ts | 244 ++++++++++++++++++
scripts/setup.ts | 9 +
types/vite.d.ts | 1 +
73 files changed, 880 insertions(+), 584 deletions(-)
create mode 100644 app/db/seed/img/alliance-rogue.png
create mode 100644 app/db/seed/img/default.png
create mode 100644 app/db/seed/img/in-the-zone.png
create mode 100644 app/db/seed/img/luti.png
create mode 100644 app/db/seed/img/paddling-pool.png
create mode 100644 app/db/seed/img/picnic.png
create mode 100644 app/db/seed/img/swim-or-sink.png
create mode 100644 app/db/seed/img/the-depths.png
delete mode 100644 app/utils/urls-img.ts
create mode 100644 scripts/migrate-tournament-logos-to-s3.ts
create mode 100644 scripts/seed-art-urls.ts
create mode 100644 scripts/seed-images.ts
diff --git a/.env.example b/.env.example
index cbc3c0f89..dbee997ff 100644
--- a/.env.example
+++ b/.env.example
@@ -17,6 +17,8 @@ STORAGE_REGION=us-east-1
STORAGE_BUCKET=sendou
STORAGE_URL=http://127.0.0.1:9000
+VITE_TOURNAMENT_DEFAULT_LOGO="tournament-logo-default.png"
+
// Twitch integration for fetching streams
TWITCH_CLIENT_ID=
TWITCH_CLIENT_SECRET=
diff --git a/.env.test b/.env.test
index 1f705b00d..5ca490924 100644
--- a/.env.test
+++ b/.env.test
@@ -6,3 +6,5 @@ BASE_URL=https://example.com
SKALOP_SYSTEM_MESSAGE_URL=http://skalop.test
SKALOP_TOKEN=test
+
+VITE_TOURNAMENT_DEFAULT_LOGO="tournament-logo-test.png"
diff --git a/app/components/elements/TournamentSearch.tsx b/app/components/elements/TournamentSearch.tsx
index 3e375f665..d317092ec 100644
--- a/app/components/elements/TournamentSearch.tsx
+++ b/app/components/elements/TournamentSearch.tsx
@@ -169,7 +169,7 @@ function TournamentItem({
}
data-testid="tournament-search-item"
>
-
+
Lj6wUk}RoWHDX_9vyqh1bfd2LwXx
z%~3|S?lmpMwG%iy2R}`#Y@X$iGB~BtsLPf^gdI_0jX@;Y+bHy=%k-4)Zp$;0{#V+M
znaFiq^!=5b1t+SO+Jc}(TfLo-cnCAGK)iNHI!gk(aR}9#QSGm0u|Jt9hpehXP;#yG
ziNt&aQUr$-Y@ _Nv(WXYz?>m$-z#b+^4(fV
z_?Df!HvA|{I4$lx(^#^)t}<;a6)_ Y&8ae&}^mPsjhoGQ!?M5|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