rhythia-api 94.0.0 → 95.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -24,6 +24,8 @@ export const Schema = {
24
24
  rank: z.string().nullable(),
25
25
  songId: z.string().nullable(),
26
26
  userId: z.number().nullable(),
27
+ beatmapDifficulty: z.number().optional().nullable(),
28
+ beatmapNotes: z.number().optional().nullable(),
27
29
  })
28
30
  )
29
31
  .optional(),
@@ -46,15 +48,32 @@ export async function handler(
46
48
  ): Promise<NextResponse<(typeof Schema)["output"]["_type"]>> {
47
49
  let { data: scores1, error: errorlast } = await supabase
48
50
  .from("scores")
49
- .select("*")
51
+ .select(
52
+ `
53
+ *,
54
+ beatmaps (
55
+ difficulty,
56
+ noteCount
57
+ )
58
+ `
59
+ )
50
60
  .eq("userId", data.id)
51
61
  .order("created_at", { ascending: false })
52
62
  .limit(10);
53
63
 
54
64
  let { data: scores2, error: errorsp } = await supabase
55
65
  .from("scores")
56
- .select("*")
66
+ .select(
67
+ `
68
+ *,
69
+ beatmaps (
70
+ difficulty,
71
+ noteCount
72
+ )
73
+ `
74
+ )
57
75
  .eq("userId", data.id)
76
+ .neq("awarded_sp", 0)
58
77
  .order("awarded_sp", { ascending: false })
59
78
  .limit(10);
60
79
 
@@ -69,6 +88,8 @@ export async function handler(
69
88
  misses: s.misses,
70
89
  rank: s.rank,
71
90
  songId: s.songId,
91
+ beatmapDifficulty: s.beatmaps?.difficulty,
92
+ beatmapNotes: s.beatmaps?.noteCount,
72
93
  })),
73
94
  top: scores2?.map((s) => ({
74
95
  created_at: s.created_at,
@@ -80,6 +101,8 @@ export async function handler(
80
101
  misses: s.misses,
81
102
  rank: s.rank,
82
103
  songId: s.songId,
104
+ beatmapDifficulty: s.beatmaps?.difficulty,
105
+ beatmapNotes: s.beatmaps?.noteCount,
83
106
  })),
84
107
  });
85
108
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rhythia-api",
3
- "version": "94.0.0",
3
+ "version": "95.0.0",
4
4
  "main": "index.ts",
5
5
  "scripts": {
6
6
  "update": "bun ./scripts/update.ts",