Add player bug reports and profile identity features
This commit is contained in:
@@ -26,6 +26,8 @@ export type MapListing = {
|
||||
image?: string;
|
||||
mapImage?: string;
|
||||
credit?: string;
|
||||
creditGlow?: boolean;
|
||||
creditAppearance?: import("../shared/profile-appearance").ProfileAppearance;
|
||||
};
|
||||
export async function mediaUrl(path: string | null, expires = 3600) {
|
||||
return (await mediaUrls([path], expires))[0];
|
||||
@@ -61,7 +63,9 @@ export async function catalog() {
|
||||
? required(
|
||||
await client
|
||||
.from("profiles")
|
||||
.select("id,display_name")
|
||||
.select(
|
||||
"id,display_name,name_glow,glow_color,role,bug_finder,custom_prefix,custom_prefix_icon",
|
||||
)
|
||||
.in("id", [...new Set(maps.map((m) => m.owner_id))]),
|
||||
)
|
||||
: [];
|
||||
@@ -71,6 +75,8 @@ export async function catalog() {
|
||||
return maps.map((m, index) => ({
|
||||
...m,
|
||||
credit: owners.find((p) => p.id === m.owner_id)?.display_name ?? "Explorer",
|
||||
creditGlow: owners.find((p) => p.id === m.owner_id)?.name_glow ?? false,
|
||||
creditAppearance: owners.find((p) => p.id === m.owner_id),
|
||||
image: signed[index * 2] ?? undefined,
|
||||
mapImage: signed[index * 2 + 1] ?? undefined,
|
||||
server: servers.find((s) => s.id === m.server_id),
|
||||
@@ -90,7 +96,9 @@ export async function getMap(id: string) {
|
||||
const [owner, signed] = await Promise.all([
|
||||
admin()
|
||||
.from("profiles")
|
||||
.select("display_name")
|
||||
.select(
|
||||
"display_name,name_glow,glow_color,role,bug_finder,custom_prefix,custom_prefix_icon",
|
||||
)
|
||||
.eq("id", map.owner_id)
|
||||
.maybeSingle(),
|
||||
mediaUrls([map.cover_path, map.map_path]),
|
||||
@@ -98,6 +106,8 @@ export async function getMap(id: string) {
|
||||
return {
|
||||
...map,
|
||||
credit: owner.data?.display_name ?? "Explorer",
|
||||
creditGlow: owner.data?.name_glow ?? false,
|
||||
creditAppearance: owner.data ?? undefined,
|
||||
image: signed[0],
|
||||
mapImage: signed[1],
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user