cloudflare r2 for images

This commit is contained in:
2026-03-01 17:15:09 +01:00
parent 5d25a84172
commit 0efe77d5ba
7 changed files with 91 additions and 3 deletions

View File

@@ -3,6 +3,7 @@ import { mappool, mappoolSlot } from '$lib/server/db/schema';
import { eq, and } from 'drizzle-orm';
import { error, redirect } from '@sveltejs/kit';
import { getBeatmap } from '$lib/server/osu/api';
import { proxyImage } from '$lib/server/storage/r2';
import { requireAuth, requireOwnerOrAdmin } from '$lib/server/permissions';
import type { PageServerLoad, Actions } from './$types';
@@ -34,7 +35,7 @@ export const load: PageServerLoad = async ({ params, locals }) => {
starRating: beatmap.difficulty_rating,
bpm: beatmap.bpm,
totalLength: beatmap.total_length,
coverUrl: beatmap.beatmapset.covers['card@2x'],
coverUrl: await proxyImage(beatmap.beatmapset.covers['card@2x']),
url: beatmap.url
}
};