osu-play 1.0.1 → 1.0.2
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/bin/osu-play.js +1 -1
- package/dist/cli/main.cjs +400 -0
- package/dist/cli/main.cjs.map +1 -0
- package/dist/cli/main.d.cts +3 -0
- package/dist/cli/main.d.ts +3 -0
- package/dist/cli/main.js +365 -0
- package/dist/cli/main.js.map +1 -0
- package/dist/mod.cjs +367 -0
- package/dist/mod.cjs.map +1 -0
- package/dist/mod.d.cts +121 -0
- package/dist/mod.d.ts +121 -0
- package/dist/mod.js +335 -0
- package/dist/mod.js.map +1 -0
- package/package.json +16 -4
- package/tsconfig.json +7 -3
- package/src/main.ts +0 -72
- package/src/realm/mod.ts +0 -54
- package/src/realm/schema/beatmap.ts +0 -85
- package/src/realm/schema/beatmapMetadata.ts +0 -33
- package/src/realm/schema/beatmapSet.ts +0 -36
- package/src/realm/schema/mod.ts +0 -7
- package/src/realm/schema/realmFile.ts +0 -15
- package/src/realm/schema/realmNamedFileUsage.ts +0 -19
- package/src/realm/schema/realmUser.ts +0 -21
- package/src/utils/mod.ts +0 -81
package/dist/cli/main.js
ADDED
|
@@ -0,0 +1,365 @@
|
|
|
1
|
+
// src/cli/main.ts
|
|
2
|
+
import path3 from "path";
|
|
3
|
+
import { existsSync as existsSync2 } from "fs";
|
|
4
|
+
import { execSync } from "child_process";
|
|
5
|
+
import Realm8 from "realm";
|
|
6
|
+
import prompts from "prompts";
|
|
7
|
+
|
|
8
|
+
// src/realm/schema/beatmap.ts
|
|
9
|
+
import Realm from "realm";
|
|
10
|
+
var Beatmap = class extends Realm.Object {
|
|
11
|
+
ID;
|
|
12
|
+
DifficultyName;
|
|
13
|
+
Ruleset;
|
|
14
|
+
Difficulty;
|
|
15
|
+
Metadata;
|
|
16
|
+
UserSettings;
|
|
17
|
+
BeatmapSet;
|
|
18
|
+
Status;
|
|
19
|
+
OnlineID;
|
|
20
|
+
Length;
|
|
21
|
+
BPM;
|
|
22
|
+
Hash;
|
|
23
|
+
StarRating;
|
|
24
|
+
MD5Hash;
|
|
25
|
+
OnlineMD5Hash;
|
|
26
|
+
LastLocalUpdate;
|
|
27
|
+
LastOnlineUpdate;
|
|
28
|
+
Hidden;
|
|
29
|
+
AudioLeadIn;
|
|
30
|
+
StackLeniency;
|
|
31
|
+
SpecialStyle;
|
|
32
|
+
LetterboxInBreaks;
|
|
33
|
+
WidescreenStoryboard;
|
|
34
|
+
EpilepsyWarning;
|
|
35
|
+
SamplesMatchPlaybackRate;
|
|
36
|
+
LastPlayed;
|
|
37
|
+
DistanceSpacing;
|
|
38
|
+
BeatDivisor;
|
|
39
|
+
GridSize;
|
|
40
|
+
TimelineZoom;
|
|
41
|
+
EditorTimestamp;
|
|
42
|
+
CountdownOffset;
|
|
43
|
+
static schema = {
|
|
44
|
+
name: "Beatmap",
|
|
45
|
+
primaryKey: "ID",
|
|
46
|
+
properties: {
|
|
47
|
+
ID: { type: "uuid", default: "" },
|
|
48
|
+
DifficultyName: { type: "string", default: "", optional: true },
|
|
49
|
+
// Ruleset: { type: "object", objectType: "Ruleset", default: null },
|
|
50
|
+
// Difficulty: { type: "object", objectType: "BeatmapDifficulty", default: null },
|
|
51
|
+
Metadata: {
|
|
52
|
+
type: "object",
|
|
53
|
+
objectType: "BeatmapMetadata",
|
|
54
|
+
default: null
|
|
55
|
+
},
|
|
56
|
+
// UserSettings: { type: "object", objectType: "BeatmapUserSettings", default: null },
|
|
57
|
+
BeatmapSet: { type: "object", objectType: "BeatmapSet", default: null },
|
|
58
|
+
Status: { type: "int", default: -3 },
|
|
59
|
+
OnlineID: { type: "int", default: -1 },
|
|
60
|
+
Length: { type: "double", default: 0 },
|
|
61
|
+
BPM: { type: "double", default: 0 },
|
|
62
|
+
Hash: { type: "string", default: "", optional: true },
|
|
63
|
+
StarRating: { type: "double", default: -1 },
|
|
64
|
+
MD5Hash: { type: "string", default: "", optional: true },
|
|
65
|
+
OnlineMD5Hash: {
|
|
66
|
+
type: "string",
|
|
67
|
+
default: "",
|
|
68
|
+
optional: true
|
|
69
|
+
},
|
|
70
|
+
LastLocalUpdate: { type: "date", optional: true },
|
|
71
|
+
LastOnlineUpdate: { type: "date", optional: true },
|
|
72
|
+
Hidden: { type: "bool", default: false },
|
|
73
|
+
AudioLeadIn: { type: "double", default: 0 },
|
|
74
|
+
StackLeniency: { type: "float", default: 0.7 },
|
|
75
|
+
SpecialStyle: { type: "bool", default: false },
|
|
76
|
+
LetterboxInBreaks: { type: "bool", default: false },
|
|
77
|
+
WidescreenStoryboard: { type: "bool", default: false },
|
|
78
|
+
EpilepsyWarning: { type: "bool", default: false },
|
|
79
|
+
SamplesMatchPlaybackRate: { type: "bool", default: false },
|
|
80
|
+
LastPlayed: { type: "date", optional: true },
|
|
81
|
+
DistanceSpacing: { type: "double", default: 0 },
|
|
82
|
+
BeatDivisor: { type: "int", default: 0 },
|
|
83
|
+
GridSize: { type: "int", default: 0 },
|
|
84
|
+
TimelineZoom: { type: "double", default: 0 },
|
|
85
|
+
EditorTimestamp: { type: "double", optional: true },
|
|
86
|
+
CountdownOffset: { type: "int", default: 0 }
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
// src/realm/schema/beatmapMetadata.ts
|
|
92
|
+
import Realm2 from "realm";
|
|
93
|
+
var BeatmapMetadata = class extends Realm2.Object {
|
|
94
|
+
Title;
|
|
95
|
+
TitleUnicode;
|
|
96
|
+
Artist;
|
|
97
|
+
ArtistUnicode;
|
|
98
|
+
Author;
|
|
99
|
+
Source;
|
|
100
|
+
Tags;
|
|
101
|
+
PreviewTime;
|
|
102
|
+
AudioFile;
|
|
103
|
+
BackgroundFile;
|
|
104
|
+
static schema = {
|
|
105
|
+
name: "BeatmapMetadata",
|
|
106
|
+
properties: {
|
|
107
|
+
Title: { type: "string", default: "", optional: true },
|
|
108
|
+
TitleUnicode: { type: "string", default: "", optional: true },
|
|
109
|
+
Artist: { type: "string", default: "", optional: true },
|
|
110
|
+
ArtistUnicode: { type: "string", default: "", optional: true },
|
|
111
|
+
Author: { type: "object", objectType: "RealmUser", default: null },
|
|
112
|
+
Source: { type: "string", default: "", optional: true },
|
|
113
|
+
Tags: { type: "string", default: "", optional: true },
|
|
114
|
+
PreviewTime: { type: "int", default: 0 },
|
|
115
|
+
AudioFile: { type: "string", default: "", optional: true },
|
|
116
|
+
BackgroundFile: { type: "string", default: "", optional: true }
|
|
117
|
+
}
|
|
118
|
+
};
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
// src/realm/schema/beatmapSet.ts
|
|
122
|
+
import Realm3 from "realm";
|
|
123
|
+
var BeatmapSet = class extends Realm3.Object {
|
|
124
|
+
ID;
|
|
125
|
+
OnlineID;
|
|
126
|
+
DateAdded;
|
|
127
|
+
DateSubmitted;
|
|
128
|
+
DateRanked;
|
|
129
|
+
Beatmaps;
|
|
130
|
+
Files;
|
|
131
|
+
Status;
|
|
132
|
+
DeletePending;
|
|
133
|
+
Hash;
|
|
134
|
+
Protected;
|
|
135
|
+
static schema = {
|
|
136
|
+
name: "BeatmapSet",
|
|
137
|
+
primaryKey: "ID",
|
|
138
|
+
properties: {
|
|
139
|
+
ID: { type: "uuid", default: "" },
|
|
140
|
+
OnlineID: { type: "int", default: -1 },
|
|
141
|
+
DateAdded: { type: "date" },
|
|
142
|
+
DateSubmitted: { type: "date", optional: true },
|
|
143
|
+
DateRanked: { type: "date", optional: true },
|
|
144
|
+
Beatmaps: { type: "list", objectType: "Beatmap", default: [] },
|
|
145
|
+
Files: { type: "list", objectType: "RealmNamedFileUsage", default: [] },
|
|
146
|
+
Status: { type: "int", default: -3 },
|
|
147
|
+
DeletePending: { type: "bool", default: false },
|
|
148
|
+
Hash: { type: "string", default: "", optional: true },
|
|
149
|
+
Protected: { type: "bool", default: false }
|
|
150
|
+
}
|
|
151
|
+
};
|
|
152
|
+
};
|
|
153
|
+
|
|
154
|
+
// src/realm/schema/realmFile.ts
|
|
155
|
+
import Realm4 from "realm";
|
|
156
|
+
var RealmFile = class extends Realm4.Object {
|
|
157
|
+
Hash;
|
|
158
|
+
static schema = {
|
|
159
|
+
name: "File",
|
|
160
|
+
primaryKey: "Hash",
|
|
161
|
+
properties: {
|
|
162
|
+
Hash: { type: "string", default: "", optional: true }
|
|
163
|
+
}
|
|
164
|
+
};
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
// src/realm/schema/realmUser.ts
|
|
168
|
+
import Realm5 from "realm";
|
|
169
|
+
var RealmUser = class extends Realm5.Object {
|
|
170
|
+
OnlineID;
|
|
171
|
+
Username;
|
|
172
|
+
CountryCode;
|
|
173
|
+
static embedded = true;
|
|
174
|
+
static schema = {
|
|
175
|
+
name: "RealmUser",
|
|
176
|
+
embedded: true,
|
|
177
|
+
properties: {
|
|
178
|
+
OnlineID: { type: "int", default: 1 },
|
|
179
|
+
Username: { type: "string", default: "", optional: true },
|
|
180
|
+
CountryCode: { type: "string", optional: true }
|
|
181
|
+
}
|
|
182
|
+
};
|
|
183
|
+
};
|
|
184
|
+
|
|
185
|
+
// src/realm/schema/realmNamedFileUsage.ts
|
|
186
|
+
import Realm6 from "realm";
|
|
187
|
+
var RealmNamedFileUsage = class extends Realm6.Object {
|
|
188
|
+
File;
|
|
189
|
+
Filename;
|
|
190
|
+
static embedded = true;
|
|
191
|
+
static schema = {
|
|
192
|
+
name: "RealmNamedFileUsage",
|
|
193
|
+
embedded: true,
|
|
194
|
+
properties: {
|
|
195
|
+
File: "File",
|
|
196
|
+
Filename: { type: "string", optional: true }
|
|
197
|
+
}
|
|
198
|
+
};
|
|
199
|
+
};
|
|
200
|
+
|
|
201
|
+
// src/utils/mod.ts
|
|
202
|
+
import path from "path";
|
|
203
|
+
import { copyFileSync, existsSync, mkdirSync } from "fs";
|
|
204
|
+
function getDataDir() {
|
|
205
|
+
switch (process.platform) {
|
|
206
|
+
case "linux":
|
|
207
|
+
case "openbsd":
|
|
208
|
+
case "freebsd": {
|
|
209
|
+
const xdg = process.env["XDG_DATA_HOME"];
|
|
210
|
+
if (xdg)
|
|
211
|
+
return xdg;
|
|
212
|
+
const home = process.env["HOME"];
|
|
213
|
+
if (home)
|
|
214
|
+
return path.join(home, ".local", "share");
|
|
215
|
+
break;
|
|
216
|
+
}
|
|
217
|
+
case "darwin": {
|
|
218
|
+
const home = process.env["HOME"];
|
|
219
|
+
if (home)
|
|
220
|
+
return path.join(home, "Library", "Application Support");
|
|
221
|
+
break;
|
|
222
|
+
}
|
|
223
|
+
case "win32":
|
|
224
|
+
return process.env["LOCALAPPDATA"] ?? null;
|
|
225
|
+
}
|
|
226
|
+
return null;
|
|
227
|
+
}
|
|
228
|
+
function getConfigDir() {
|
|
229
|
+
switch (process.platform) {
|
|
230
|
+
case "openbsd":
|
|
231
|
+
case "freebsd":
|
|
232
|
+
case "linux": {
|
|
233
|
+
const xdg = process.env["XDG_CONFIG_HOME"];
|
|
234
|
+
if (xdg)
|
|
235
|
+
return xdg;
|
|
236
|
+
const home = process.env["HOME"];
|
|
237
|
+
if (home)
|
|
238
|
+
return path.join(home, ".config");
|
|
239
|
+
break;
|
|
240
|
+
}
|
|
241
|
+
case "darwin": {
|
|
242
|
+
const home = process.env["HOME"];
|
|
243
|
+
if (home)
|
|
244
|
+
return path.join(home, "Library", "Preferences");
|
|
245
|
+
break;
|
|
246
|
+
}
|
|
247
|
+
case "win32":
|
|
248
|
+
return process.env["APPDATA"] ?? null;
|
|
249
|
+
}
|
|
250
|
+
return null;
|
|
251
|
+
}
|
|
252
|
+
function getRealmDBPath(appConfigDir, osuDataDir, reload = false) {
|
|
253
|
+
const localDBPath = path.join(appConfigDir, "client.realm");
|
|
254
|
+
if (!reload && existsSync(localDBPath))
|
|
255
|
+
return localDBPath;
|
|
256
|
+
const osuDBPath = path.join(
|
|
257
|
+
osuDataDir || getDataDir() || ".",
|
|
258
|
+
"osu",
|
|
259
|
+
"client.realm"
|
|
260
|
+
);
|
|
261
|
+
if (existsSync(osuDBPath)) {
|
|
262
|
+
console.log(
|
|
263
|
+
`[getRealmDBPath]: ${osuDBPath} is being imported from osu!lazer to ${localDBPath}`
|
|
264
|
+
);
|
|
265
|
+
mkdirSync(appConfigDir);
|
|
266
|
+
copyFileSync(osuDBPath, localDBPath);
|
|
267
|
+
return localDBPath;
|
|
268
|
+
} else {
|
|
269
|
+
console.log(`[getRealmDBPath]: ${osuDBPath} not found`);
|
|
270
|
+
return null;
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
// src/realm/mod.ts
|
|
275
|
+
import Realm7 from "realm";
|
|
276
|
+
import path2 from "path";
|
|
277
|
+
var getLazerDB = async (realmDBPath) => {
|
|
278
|
+
const realm = await Realm7.open({
|
|
279
|
+
schema: [
|
|
280
|
+
BeatmapSet,
|
|
281
|
+
RealmFile,
|
|
282
|
+
RealmNamedFileUsage,
|
|
283
|
+
Beatmap,
|
|
284
|
+
BeatmapMetadata,
|
|
285
|
+
RealmUser
|
|
286
|
+
],
|
|
287
|
+
path: realmDBPath,
|
|
288
|
+
schemaVersion: 36,
|
|
289
|
+
onMigration: (oldRealm, newRealm) => {
|
|
290
|
+
console.log(
|
|
291
|
+
`[onMigration]: Migrating ${oldRealm.path} - ${oldRealm.schemaVersion} -> ${newRealm.path} - ${newRealm.schemaVersion}`
|
|
292
|
+
);
|
|
293
|
+
}
|
|
294
|
+
});
|
|
295
|
+
return realm;
|
|
296
|
+
};
|
|
297
|
+
var hashedFilePath = (hash) => {
|
|
298
|
+
const dataDir = getDataDir();
|
|
299
|
+
if (!dataDir)
|
|
300
|
+
return null;
|
|
301
|
+
return path2.join(
|
|
302
|
+
dataDir,
|
|
303
|
+
"osu",
|
|
304
|
+
"files",
|
|
305
|
+
hash.slice(0, 1),
|
|
306
|
+
hash.slice(0, 2),
|
|
307
|
+
hash
|
|
308
|
+
);
|
|
309
|
+
};
|
|
310
|
+
var getNamedFileHash = (fileName, beatmapSet) => {
|
|
311
|
+
const files = beatmapSet.Files;
|
|
312
|
+
for (const file of files) {
|
|
313
|
+
if (file.Filename == fileName)
|
|
314
|
+
return file.File.Hash;
|
|
315
|
+
}
|
|
316
|
+
return void 0;
|
|
317
|
+
};
|
|
318
|
+
|
|
319
|
+
// src/cli/main.ts
|
|
320
|
+
async function main() {
|
|
321
|
+
console.log("[INFO] OSU!list");
|
|
322
|
+
const realmDBPath = getRealmDBPath(
|
|
323
|
+
path3.join(getConfigDir() || ".", "osu-play")
|
|
324
|
+
);
|
|
325
|
+
if (realmDBPath == null) {
|
|
326
|
+
console.log("[ERROR] Realm DB not found");
|
|
327
|
+
process.exit(1);
|
|
328
|
+
}
|
|
329
|
+
const currentSchema = Realm8.schemaVersion(realmDBPath);
|
|
330
|
+
console.log(`currentSchema: ${currentSchema}`);
|
|
331
|
+
Realm8.flags.ALLOW_CLEAR_TEST_STATE = true;
|
|
332
|
+
const realm = await getLazerDB(realmDBPath);
|
|
333
|
+
console.log(`realm.isClosed: ${realm.isClosed}`);
|
|
334
|
+
const beatmapSets = realm.objects(BeatmapSet);
|
|
335
|
+
console.log(`beatmaps: ${beatmapSets.length}`);
|
|
336
|
+
const selectedBeatmapSet = (await prompts({
|
|
337
|
+
type: "autocomplete",
|
|
338
|
+
name: "beatmapSet",
|
|
339
|
+
message: "Which map do you want to play:",
|
|
340
|
+
choices: beatmapSets.map((beatmapSet) => {
|
|
341
|
+
const meta = beatmapSet.Beatmaps[0].Metadata;
|
|
342
|
+
return {
|
|
343
|
+
title: `${meta.Title} : ${meta.Artist} - ${meta.TitleUnicode} : ${meta.ArtistUnicode}`,
|
|
344
|
+
value: beatmapSet
|
|
345
|
+
};
|
|
346
|
+
})
|
|
347
|
+
})).beatmapSet;
|
|
348
|
+
console.log(`Map : ${selectedBeatmapSet.Beatmaps[0].Metadata.Title}`);
|
|
349
|
+
const fileName = selectedBeatmapSet.Beatmaps[0].Metadata.AudioFile;
|
|
350
|
+
const fileHash = fileName ? getNamedFileHash(fileName, selectedBeatmapSet) : void 0;
|
|
351
|
+
const filePath = fileHash ? hashedFilePath(fileHash) : void 0;
|
|
352
|
+
if (filePath && existsSync2(filePath)) {
|
|
353
|
+
console.log(`File exists: ${filePath}`);
|
|
354
|
+
} else {
|
|
355
|
+
console.log(`File does not exist: ${filePath}`);
|
|
356
|
+
}
|
|
357
|
+
console.log(`Playing file ${selectedBeatmapSet.Beatmaps[0].Metadata.Title}`);
|
|
358
|
+
filePath && execSync(`exo-open ${filePath}`);
|
|
359
|
+
realm.close();
|
|
360
|
+
console.log(`realm.isClosed: ${realm.isClosed}`);
|
|
361
|
+
}
|
|
362
|
+
export {
|
|
363
|
+
main
|
|
364
|
+
};
|
|
365
|
+
//# sourceMappingURL=main.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/cli/main.ts","../../src/realm/schema/beatmap.ts","../../src/realm/schema/beatmapMetadata.ts","../../src/realm/schema/beatmapSet.ts","../../src/realm/schema/realmFile.ts","../../src/realm/schema/realmUser.ts","../../src/realm/schema/realmNamedFileUsage.ts","../../src/utils/mod.ts","../../src/realm/mod.ts"],"sourcesContent":["import path from \"node:path\";\nimport { existsSync } from \"node:fs\";\nimport { execSync } from \"node:child_process\";\n\nimport Realm from \"realm\";\nimport prompts from \"prompts\";\nimport { BeatmapSet } from \"../realm/schema/mod.js\";\nimport { getConfigDir, getRealmDBPath } from \"../utils/mod.js\";\nimport { getLazerDB, getNamedFileHash, hashedFilePath } from \"../realm/mod.js\";\n\nexport async function main() {\n console.log(\"[INFO] OSU!list\");\n\n const realmDBPath = getRealmDBPath(\n path.join(getConfigDir() || \".\", \"osu-play\"),\n );\n\n if (realmDBPath == null) {\n console.log(\"[ERROR] Realm DB not found\");\n process.exit(1);\n }\n\n const currentSchema = Realm.schemaVersion(realmDBPath);\n console.log(`currentSchema: ${currentSchema}`);\n\n Realm.flags.ALLOW_CLEAR_TEST_STATE = true;\n\n const realm: Realm = await getLazerDB(realmDBPath);\n\n console.log(`realm.isClosed: ${realm.isClosed}`);\n\n const beatmapSets = realm.objects(BeatmapSet);\n\n console.log(`beatmaps: ${beatmapSets.length}`);\n\n // Get the map index from the user\n const selectedBeatmapSet = (\n await prompts({\n type: \"autocomplete\",\n name: \"beatmapSet\",\n message: \"Which map do you want to play:\",\n choices: beatmapSets.map((beatmapSet) => {\n const meta = beatmapSet.Beatmaps[0].Metadata;\n return {\n title:\n `${meta.Title} : ${meta.Artist} - ${meta.TitleUnicode} : ${meta.ArtistUnicode}`,\n value: beatmapSet,\n };\n }),\n })\n ).beatmapSet;\n\n console.log(`Map : ${selectedBeatmapSet.Beatmaps[0].Metadata.Title}`);\n const fileName = selectedBeatmapSet.Beatmaps[0].Metadata.AudioFile;\n const fileHash = fileName\n ? getNamedFileHash(fileName, selectedBeatmapSet)\n : undefined;\n const filePath = fileHash ? hashedFilePath(fileHash) : undefined;\n if (filePath && existsSync(filePath)) {\n console.log(`File exists: ${filePath}`);\n } else {\n console.log(`File does not exist: ${filePath}`);\n }\n\n // Open file using exo-open.\n console.log(`Playing file ${selectedBeatmapSet.Beatmaps[0].Metadata.Title}`);\n filePath && execSync(`exo-open ${filePath}`);\n\n realm.close();\n console.log(`realm.isClosed: ${realm.isClosed}`);\n\n // Realm.clearTestState();\n}\n","import Realm from \"realm\";\nimport type { ObjectSchema } from \"realm\";\nimport { BeatmapMetadata } from \"./beatmapMetadata.js\";\n\nexport class Beatmap extends Realm.Object<Beatmap> {\n ID!: string;\n DifficultyName?: string;\n Ruleset!: any;\n Difficulty!: any;\n Metadata!: BeatmapMetadata;\n UserSettings!: any;\n BeatmapSet!: any;\n Status!: number;\n OnlineID!: number;\n Length!: number;\n BPM!: number;\n Hash?: string;\n StarRating!: number;\n MD5Hash?: string;\n OnlineMD5Hash?: string;\n LastLocalUpdate?: Date;\n LastOnlineUpdate?: Date;\n Hidden!: boolean;\n AudioLeadIn!: number;\n StackLeniency!: number;\n SpecialStyle!: boolean;\n LetterboxInBreaks!: boolean;\n WidescreenStoryboard!: boolean;\n EpilepsyWarning!: boolean;\n SamplesMatchPlaybackRate!: boolean;\n LastPlayed?: Date;\n DistanceSpacing!: number;\n BeatDivisor!: number;\n GridSize!: number;\n TimelineZoom!: number;\n EditorTimestamp?: number;\n CountdownOffset!: number;\n\n static schema: ObjectSchema = {\n name: \"Beatmap\",\n primaryKey: \"ID\",\n properties: {\n ID: { type: \"uuid\", default: \"\" },\n DifficultyName: { type: \"string\", default: \"\", optional: true },\n // Ruleset: { type: \"object\", objectType: \"Ruleset\", default: null },\n // Difficulty: { type: \"object\", objectType: \"BeatmapDifficulty\", default: null },\n Metadata: {\n type: \"object\",\n objectType: \"BeatmapMetadata\",\n default: null,\n },\n // UserSettings: { type: \"object\", objectType: \"BeatmapUserSettings\", default: null },\n BeatmapSet: { type: \"object\", objectType: \"BeatmapSet\", default: null },\n Status: { type: \"int\", default: -3 },\n OnlineID: { type: \"int\", default: -1 },\n Length: { type: \"double\", default: 0 },\n BPM: { type: \"double\", default: 0 },\n Hash: { type: \"string\", default: \"\", optional: true },\n StarRating: { type: \"double\", default: -1 },\n MD5Hash: { type: \"string\", default: \"\", optional: true },\n OnlineMD5Hash: {\n type: \"string\",\n default: \"\",\n optional: true,\n },\n LastLocalUpdate: { type: \"date\", optional: true },\n LastOnlineUpdate: { type: \"date\", optional: true },\n Hidden: { type: \"bool\", default: false },\n AudioLeadIn: { type: \"double\", default: 0 },\n StackLeniency: { type: \"float\", default: 0.7 },\n SpecialStyle: { type: \"bool\", default: false },\n LetterboxInBreaks: { type: \"bool\", default: false },\n WidescreenStoryboard: { type: \"bool\", default: false },\n EpilepsyWarning: { type: \"bool\", default: false },\n SamplesMatchPlaybackRate: { type: \"bool\", default: false },\n LastPlayed: { type: \"date\", optional: true },\n DistanceSpacing: { type: \"double\", default: 0 },\n BeatDivisor: { type: \"int\", default: 0 },\n GridSize: { type: \"int\", default: 0 },\n TimelineZoom: { type: \"double\", default: 0 },\n EditorTimestamp: { type: \"double\", optional: true },\n CountdownOffset: { type: \"int\", default: 0 },\n },\n };\n}\n","import Realm from \"realm\";\nimport type { ObjectSchema } from \"realm\";\nimport { RealmUser } from \"./realmUser.js\";\n\nexport class BeatmapMetadata extends Realm.Object<BeatmapMetadata> {\n Title?: string;\n TitleUnicode?: string;\n Artist?: string;\n ArtistUnicode?: string;\n Author?: RealmUser;\n Source?: string;\n Tags?: string;\n PreviewTime?: number;\n AudioFile?: string;\n BackgroundFile?: string;\n\n static schema: ObjectSchema = {\n name: \"BeatmapMetadata\",\n properties: {\n Title: { type: \"string\", default: \"\", optional: true },\n TitleUnicode: { type: \"string\", default: \"\", optional: true },\n Artist: { type: \"string\", default: \"\", optional: true },\n ArtistUnicode: { type: \"string\", default: \"\", optional: true },\n Author: { type: \"object\", objectType: \"RealmUser\", default: null },\n Source: { type: \"string\", default: \"\", optional: true },\n Tags: { type: \"string\", default: \"\", optional: true },\n PreviewTime: { type: \"int\", default: 0 },\n AudioFile: { type: \"string\", default: \"\", optional: true },\n BackgroundFile: { type: \"string\", default: \"\", optional: true },\n },\n };\n}\n\n","import Realm from \"realm\";\nimport type { ObjectSchema } from \"realm\";\nimport { Beatmap } from \"./beatmap.js\";\nimport { RealmNamedFileUsage } from \"./realmNamedFileUsage.js\";\n\nexport class BeatmapSet extends Realm.Object<BeatmapSet> {\n ID!: string;\n OnlineID!: number;\n DateAdded!: Date;\n DateSubmitted?: Date;\n DateRanked?: Date;\n Beatmaps!: Array<Beatmap>;\n Files!: Array<RealmNamedFileUsage>;\n Status!: number;\n DeletePending!: boolean;\n Hash?: string;\n Protected!: boolean;\n\n static schema: ObjectSchema = {\n name: \"BeatmapSet\",\n primaryKey: \"ID\",\n properties: {\n ID: { type: \"uuid\", default: \"\" },\n OnlineID: { type: \"int\", default: -1 },\n DateAdded: { type: \"date\" },\n DateSubmitted: { type: \"date\", optional: true },\n DateRanked: { type: \"date\", optional: true },\n Beatmaps: { type: \"list\", objectType: \"Beatmap\", default: [] },\n Files: { type: \"list\", objectType: \"RealmNamedFileUsage\", default: [] },\n Status: { type: \"int\", default: -3 },\n DeletePending: { type: \"bool\", default: false },\n Hash: { type: \"string\", default: \"\", optional: true },\n Protected: { type: \"bool\", default: false },\n },\n };\n}\n","import Realm from \"realm\";\nimport type { ObjectSchema } from \"realm\";\n\nexport class RealmFile extends Realm.Object<RealmFile> {\n Hash?: string;\n\n static schema: ObjectSchema = {\n name: \"File\",\n primaryKey: \"Hash\",\n properties: {\n Hash: { type: \"string\", default: \"\", optional: true },\n },\n };\n}\n\n","import Realm from \"realm\";\nimport type { ObjectSchema } from \"realm\";\n\nexport class RealmUser extends Realm.Object<RealmUser> {\n OnlineID!: number;\n Username?: string;\n CountryCode?: string;\n\n static embedded = true;\n\n static schema: ObjectSchema = {\n name: \"RealmUser\",\n embedded: true,\n properties: {\n OnlineID: { type: \"int\", default: 1 },\n Username: { type: \"string\", default: \"\", optional: true },\n CountryCode: { type: \"string\", optional: true },\n },\n };\n}\n\n","import Realm from \"realm\";\nimport type { ObjectSchema } from \"realm\";\nimport { RealmFile } from \"./realmFile.js\";\n\nexport class RealmNamedFileUsage extends Realm.Object<RealmNamedFileUsage> {\n File!: RealmFile;\n Filename?: string;\n\n static embedded = true;\n\n static schema: ObjectSchema = {\n name: \"RealmNamedFileUsage\",\n embedded: true,\n properties: {\n File: \"File\",\n Filename: { type: \"string\", optional: true },\n },\n };\n}\n","import path from \"node:path\";\nimport { copyFileSync, existsSync, mkdirSync } from \"node:fs\";\n\nexport function getDataDir(): string | null {\n switch (process.platform) {\n case \"linux\":\n case \"openbsd\":\n case \"freebsd\": {\n const xdg = process.env[\"XDG_DATA_HOME\"];\n if (xdg) return xdg;\n const home = process.env[\"HOME\"];\n if (home) return path.join(home, \".local\", \"share\");\n break;\n }\n\n case \"darwin\": {\n const home = process.env[\"HOME\"];\n if (home) return path.join(home, \"Library\", \"Application Support\");\n break;\n }\n\n case \"win32\":\n return process.env[\"LOCALAPPDATA\"] ?? null;\n }\n\n return null;\n}\n\nexport function getConfigDir(): string | null {\n switch (process.platform) {\n case \"openbsd\":\n case \"freebsd\":\n case \"linux\": {\n const xdg = process.env[\"XDG_CONFIG_HOME\"];\n if (xdg) return xdg;\n const home = process.env[\"HOME\"];\n if (home) return path.join(home, \".config\");\n break;\n }\n\n case \"darwin\": {\n const home = process.env[\"HOME\"];\n if (home) return path.join(home, \"Library\", \"Preferences\");\n break;\n }\n\n case \"win32\":\n return process.env[\"APPDATA\"] ?? null;\n }\n\n return null;\n}\n\n/**\n * Get Realm for the app, import to the config if it doesn't exist\n */\nexport function getRealmDBPath(\n appConfigDir: string,\n osuDataDir?: string,\n reload: boolean = false,\n) {\n const localDBPath = path.join(appConfigDir, \"client.realm\");\n if (!reload && existsSync(localDBPath)) return localDBPath;\n\n const osuDBPath = path.join(\n osuDataDir || getDataDir()! || \".\",\n \"osu\",\n \"client.realm\",\n );\n if (existsSync(osuDBPath)) {\n console.log(\n `[getRealmDBPath]: ${osuDBPath} is being imported from osu!lazer to ${localDBPath}`,\n );\n mkdirSync(appConfigDir);\n copyFileSync(osuDBPath, localDBPath);\n return localDBPath;\n } else {\n console.log(`[getRealmDBPath]: ${osuDBPath} not found`);\n return null;\n }\n}\n","import Realm from \"realm\";\nimport path from \"node:path\";\nimport { getDataDir } from \"../utils/mod.js\";\nimport {\n Beatmap,\n BeatmapMetadata,\n BeatmapSet,\n RealmFile,\n RealmNamedFileUsage,\n RealmUser,\n} from \"./schema/mod.js\";\n\nexport const getLazerDB = async (realmDBPath: string) => {\n const realm = await Realm.open({\n schema: [\n BeatmapSet,\n RealmFile,\n RealmNamedFileUsage,\n Beatmap,\n BeatmapMetadata,\n RealmUser,\n ],\n path: realmDBPath,\n schemaVersion: 36,\n onMigration: (oldRealm, newRealm) => {\n console.log(\n `[onMigration]: Migrating ${oldRealm.path} - ${oldRealm.schemaVersion} -> ${newRealm.path} - ${newRealm.schemaVersion}`,\n );\n },\n });\n\n return realm;\n};\n\nexport const hashedFilePath = (hash: string) => {\n const dataDir = getDataDir();\n if (!dataDir) return null;\n return path.join(\n dataDir,\n \"osu\",\n \"files\",\n hash.slice(0, 1),\n hash.slice(0, 2),\n hash,\n );\n};\n\nexport const getNamedFileHash = (fileName: string, beatmapSet: BeatmapSet) => {\n const files = beatmapSet.Files;\n for (const file of files) {\n if (file.Filename == fileName) return file.File.Hash;\n }\n return undefined;\n};\n"],"mappings":";AAAA,OAAOA,WAAU;AACjB,SAAS,cAAAC,mBAAkB;AAC3B,SAAS,gBAAgB;AAEzB,OAAOC,YAAW;AAClB,OAAO,aAAa;;;ACLpB,OAAO,WAAW;AAIX,IAAM,UAAN,cAAsB,MAAM,OAAgB;AAAA,EACjD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAEA,OAAO,SAAuB;AAAA,IAC5B,MAAM;AAAA,IACN,YAAY;AAAA,IACZ,YAAY;AAAA,MACV,IAAI,EAAE,MAAM,QAAQ,SAAS,GAAG;AAAA,MAChC,gBAAgB,EAAE,MAAM,UAAU,SAAS,IAAI,UAAU,KAAK;AAAA;AAAA;AAAA,MAG9D,UAAU;AAAA,QACR,MAAM;AAAA,QACN,YAAY;AAAA,QACZ,SAAS;AAAA,MACX;AAAA;AAAA,MAEA,YAAY,EAAE,MAAM,UAAU,YAAY,cAAc,SAAS,KAAK;AAAA,MACtE,QAAQ,EAAE,MAAM,OAAO,SAAS,GAAG;AAAA,MACnC,UAAU,EAAE,MAAM,OAAO,SAAS,GAAG;AAAA,MACrC,QAAQ,EAAE,MAAM,UAAU,SAAS,EAA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