rhythia-api 83.0.0 → 84.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.
- package/api/submitScore.ts +7 -4
- package/package.json +1 -1
- package/types/database.ts +9 -3
package/api/submitScore.ts
CHANGED
|
@@ -15,7 +15,8 @@ export const Schema = {
|
|
|
15
15
|
mapHash: z.string(),
|
|
16
16
|
mapTitle: z.string(),
|
|
17
17
|
mapDifficulty: z.number(),
|
|
18
|
-
|
|
18
|
+
mapNoteCount: z.number(),
|
|
19
|
+
mapLength: z.number(),
|
|
19
20
|
}),
|
|
20
21
|
}),
|
|
21
22
|
output: z.object({
|
|
@@ -68,10 +69,11 @@ export async function handler({
|
|
|
68
69
|
.from("beatmaps")
|
|
69
70
|
.upsert({
|
|
70
71
|
beatmapHash: data.mapHash,
|
|
71
|
-
|
|
72
|
+
title: data.mapTitle,
|
|
72
73
|
playcount: newPlaycount,
|
|
73
74
|
difficulty: data.mapDifficulty,
|
|
74
|
-
noteCount: data.
|
|
75
|
+
noteCount: data.mapNoteCount,
|
|
76
|
+
length: data.mapLength,
|
|
75
77
|
})
|
|
76
78
|
.select();
|
|
77
79
|
|
|
@@ -84,7 +86,8 @@ export async function handler({
|
|
|
84
86
|
songId: data.songId,
|
|
85
87
|
triggers: data.triggers,
|
|
86
88
|
userId: userData[0].id,
|
|
87
|
-
passed: data.
|
|
89
|
+
passed: data.mapNoteCount == Object.keys(data.noteResults).length,
|
|
90
|
+
misses: Object.values(data.noteResults).filter((e) => !e).length,
|
|
88
91
|
})
|
|
89
92
|
.select();
|
|
90
93
|
|
package/package.json
CHANGED
package/types/database.ts
CHANGED
|
@@ -12,27 +12,30 @@ export type Database = {
|
|
|
12
12
|
beatmaps: {
|
|
13
13
|
Row: {
|
|
14
14
|
beatmapHash: string
|
|
15
|
-
beatmapTitle: string | null
|
|
16
15
|
created_at: string
|
|
17
16
|
difficulty: number | null
|
|
17
|
+
length: number | null
|
|
18
18
|
noteCount: number | null
|
|
19
19
|
playcount: number | null
|
|
20
|
+
title: string | null
|
|
20
21
|
}
|
|
21
22
|
Insert: {
|
|
22
23
|
beatmapHash: string
|
|
23
|
-
beatmapTitle?: string | null
|
|
24
24
|
created_at?: string
|
|
25
25
|
difficulty?: number | null
|
|
26
|
+
length?: number | null
|
|
26
27
|
noteCount?: number | null
|
|
27
28
|
playcount?: number | null
|
|
29
|
+
title?: string | null
|
|
28
30
|
}
|
|
29
31
|
Update: {
|
|
30
32
|
beatmapHash?: string
|
|
31
|
-
beatmapTitle?: string | null
|
|
32
33
|
created_at?: string
|
|
33
34
|
difficulty?: number | null
|
|
35
|
+
length?: number | null
|
|
34
36
|
noteCount?: number | null
|
|
35
37
|
playcount?: number | null
|
|
38
|
+
title?: string | null
|
|
36
39
|
}
|
|
37
40
|
Relationships: []
|
|
38
41
|
}
|
|
@@ -97,6 +100,7 @@ export type Database = {
|
|
|
97
100
|
beatmapHash: string | null
|
|
98
101
|
created_at: string
|
|
99
102
|
id: number
|
|
103
|
+
misses: number | null
|
|
100
104
|
noteResults: Json | null
|
|
101
105
|
passed: boolean | null
|
|
102
106
|
playedAt: number | null
|
|
@@ -109,6 +113,7 @@ export type Database = {
|
|
|
109
113
|
beatmapHash?: string | null
|
|
110
114
|
created_at?: string
|
|
111
115
|
id?: number
|
|
116
|
+
misses?: number | null
|
|
112
117
|
noteResults?: Json | null
|
|
113
118
|
passed?: boolean | null
|
|
114
119
|
playedAt?: number | null
|
|
@@ -121,6 +126,7 @@ export type Database = {
|
|
|
121
126
|
beatmapHash?: string | null
|
|
122
127
|
created_at?: string
|
|
123
128
|
id?: number
|
|
129
|
+
misses?: number | null
|
|
124
130
|
noteResults?: Json | null
|
|
125
131
|
passed?: boolean | null
|
|
126
132
|
playedAt?: number | null
|