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/bin/osu-play.js
CHANGED
|
@@ -0,0 +1,400 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
|
|
30
|
+
// src/cli/main.ts
|
|
31
|
+
var main_exports = {};
|
|
32
|
+
__export(main_exports, {
|
|
33
|
+
main: () => main
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(main_exports);
|
|
36
|
+
var import_node_path3 = __toESM(require("path"), 1);
|
|
37
|
+
var import_node_fs2 = require("fs");
|
|
38
|
+
var import_node_child_process = require("child_process");
|
|
39
|
+
var import_realm8 = __toESM(require("realm"), 1);
|
|
40
|
+
var import_prompts = __toESM(require("prompts"), 1);
|
|
41
|
+
|
|
42
|
+
// src/realm/schema/beatmap.ts
|
|
43
|
+
var import_realm = __toESM(require("realm"), 1);
|
|
44
|
+
var Beatmap = class extends import_realm.default.Object {
|
|
45
|
+
ID;
|
|
46
|
+
DifficultyName;
|
|
47
|
+
Ruleset;
|
|
48
|
+
Difficulty;
|
|
49
|
+
Metadata;
|
|
50
|
+
UserSettings;
|
|
51
|
+
BeatmapSet;
|
|
52
|
+
Status;
|
|
53
|
+
OnlineID;
|
|
54
|
+
Length;
|
|
55
|
+
BPM;
|
|
56
|
+
Hash;
|
|
57
|
+
StarRating;
|
|
58
|
+
MD5Hash;
|
|
59
|
+
OnlineMD5Hash;
|
|
60
|
+
LastLocalUpdate;
|
|
61
|
+
LastOnlineUpdate;
|
|
62
|
+
Hidden;
|
|
63
|
+
AudioLeadIn;
|
|
64
|
+
StackLeniency;
|
|
65
|
+
SpecialStyle;
|
|
66
|
+
LetterboxInBreaks;
|
|
67
|
+
WidescreenStoryboard;
|
|
68
|
+
EpilepsyWarning;
|
|
69
|
+
SamplesMatchPlaybackRate;
|
|
70
|
+
LastPlayed;
|
|
71
|
+
DistanceSpacing;
|
|
72
|
+
BeatDivisor;
|
|
73
|
+
GridSize;
|
|
74
|
+
TimelineZoom;
|
|
75
|
+
EditorTimestamp;
|
|
76
|
+
CountdownOffset;
|
|
77
|
+
static schema = {
|
|
78
|
+
name: "Beatmap",
|
|
79
|
+
primaryKey: "ID",
|
|
80
|
+
properties: {
|
|
81
|
+
ID: { type: "uuid", default: "" },
|
|
82
|
+
DifficultyName: { type: "string", default: "", optional: true },
|
|
83
|
+
// Ruleset: { type: "object", objectType: "Ruleset", default: null },
|
|
84
|
+
// Difficulty: { type: "object", objectType: "BeatmapDifficulty", default: null },
|
|
85
|
+
Metadata: {
|
|
86
|
+
type: "object",
|
|
87
|
+
objectType: "BeatmapMetadata",
|
|
88
|
+
default: null
|
|
89
|
+
},
|
|
90
|
+
// UserSettings: { type: "object", objectType: "BeatmapUserSettings", default: null },
|
|
91
|
+
BeatmapSet: { type: "object", objectType: "BeatmapSet", default: null },
|
|
92
|
+
Status: { type: "int", default: -3 },
|
|
93
|
+
OnlineID: { type: "int", default: -1 },
|
|
94
|
+
Length: { type: "double", default: 0 },
|
|
95
|
+
BPM: { type: "double", default: 0 },
|
|
96
|
+
Hash: { type: "string", default: "", optional: true },
|
|
97
|
+
StarRating: { type: "double", default: -1 },
|
|
98
|
+
MD5Hash: { type: "string", default: "", optional: true },
|
|
99
|
+
OnlineMD5Hash: {
|
|
100
|
+
type: "string",
|
|
101
|
+
default: "",
|
|
102
|
+
optional: true
|
|
103
|
+
},
|
|
104
|
+
LastLocalUpdate: { type: "date", optional: true },
|
|
105
|
+
LastOnlineUpdate: { type: "date", optional: true },
|
|
106
|
+
Hidden: { type: "bool", default: false },
|
|
107
|
+
AudioLeadIn: { type: "double", default: 0 },
|
|
108
|
+
StackLeniency: { type: "float", default: 0.7 },
|
|
109
|
+
SpecialStyle: { type: "bool", default: false },
|
|
110
|
+
LetterboxInBreaks: { type: "bool", default: false },
|
|
111
|
+
WidescreenStoryboard: { type: "bool", default: false },
|
|
112
|
+
EpilepsyWarning: { type: "bool", default: false },
|
|
113
|
+
SamplesMatchPlaybackRate: { type: "bool", default: false },
|
|
114
|
+
LastPlayed: { type: "date", optional: true },
|
|
115
|
+
DistanceSpacing: { type: "double", default: 0 },
|
|
116
|
+
BeatDivisor: { type: "int", default: 0 },
|
|
117
|
+
GridSize: { type: "int", default: 0 },
|
|
118
|
+
TimelineZoom: { type: "double", default: 0 },
|
|
119
|
+
EditorTimestamp: { type: "double", optional: true },
|
|
120
|
+
CountdownOffset: { type: "int", default: 0 }
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
// src/realm/schema/beatmapMetadata.ts
|
|
126
|
+
var import_realm2 = __toESM(require("realm"), 1);
|
|
127
|
+
var BeatmapMetadata = class extends import_realm2.default.Object {
|
|
128
|
+
Title;
|
|
129
|
+
TitleUnicode;
|
|
130
|
+
Artist;
|
|
131
|
+
ArtistUnicode;
|
|
132
|
+
Author;
|
|
133
|
+
Source;
|
|
134
|
+
Tags;
|
|
135
|
+
PreviewTime;
|
|
136
|
+
AudioFile;
|
|
137
|
+
BackgroundFile;
|
|
138
|
+
static schema = {
|
|
139
|
+
name: "BeatmapMetadata",
|
|
140
|
+
properties: {
|
|
141
|
+
Title: { type: "string", default: "", optional: true },
|
|
142
|
+
TitleUnicode: { type: "string", default: "", optional: true },
|
|
143
|
+
Artist: { type: "string", default: "", optional: true },
|
|
144
|
+
ArtistUnicode: { type: "string", default: "", optional: true },
|
|
145
|
+
Author: { type: "object", objectType: "RealmUser", default: null },
|
|
146
|
+
Source: { type: "string", default: "", optional: true },
|
|
147
|
+
Tags: { type: "string", default: "", optional: true },
|
|
148
|
+
PreviewTime: { type: "int", default: 0 },
|
|
149
|
+
AudioFile: { type: "string", default: "", optional: true },
|
|
150
|
+
BackgroundFile: { type: "string", default: "", optional: true }
|
|
151
|
+
}
|
|
152
|
+
};
|
|
153
|
+
};
|
|
154
|
+
|
|
155
|
+
// src/realm/schema/beatmapSet.ts
|
|
156
|
+
var import_realm3 = __toESM(require("realm"), 1);
|
|
157
|
+
var BeatmapSet = class extends import_realm3.default.Object {
|
|
158
|
+
ID;
|
|
159
|
+
OnlineID;
|
|
160
|
+
DateAdded;
|
|
161
|
+
DateSubmitted;
|
|
162
|
+
DateRanked;
|
|
163
|
+
Beatmaps;
|
|
164
|
+
Files;
|
|
165
|
+
Status;
|
|
166
|
+
DeletePending;
|
|
167
|
+
Hash;
|
|
168
|
+
Protected;
|
|
169
|
+
static schema = {
|
|
170
|
+
name: "BeatmapSet",
|
|
171
|
+
primaryKey: "ID",
|
|
172
|
+
properties: {
|
|
173
|
+
ID: { type: "uuid", default: "" },
|
|
174
|
+
OnlineID: { type: "int", default: -1 },
|
|
175
|
+
DateAdded: { type: "date" },
|
|
176
|
+
DateSubmitted: { type: "date", optional: true },
|
|
177
|
+
DateRanked: { type: "date", optional: true },
|
|
178
|
+
Beatmaps: { type: "list", objectType: "Beatmap", default: [] },
|
|
179
|
+
Files: { type: "list", objectType: "RealmNamedFileUsage", default: [] },
|
|
180
|
+
Status: { type: "int", default: -3 },
|
|
181
|
+
DeletePending: { type: "bool", default: false },
|
|
182
|
+
Hash: { type: "string", default: "", optional: true },
|
|
183
|
+
Protected: { type: "bool", default: false }
|
|
184
|
+
}
|
|
185
|
+
};
|
|
186
|
+
};
|
|
187
|
+
|
|
188
|
+
// src/realm/schema/realmFile.ts
|
|
189
|
+
var import_realm4 = __toESM(require("realm"), 1);
|
|
190
|
+
var RealmFile = class extends import_realm4.default.Object {
|
|
191
|
+
Hash;
|
|
192
|
+
static schema = {
|
|
193
|
+
name: "File",
|
|
194
|
+
primaryKey: "Hash",
|
|
195
|
+
properties: {
|
|
196
|
+
Hash: { type: "string", default: "", optional: true }
|
|
197
|
+
}
|
|
198
|
+
};
|
|
199
|
+
};
|
|
200
|
+
|
|
201
|
+
// src/realm/schema/realmUser.ts
|
|
202
|
+
var import_realm5 = __toESM(require("realm"), 1);
|
|
203
|
+
var RealmUser = class extends import_realm5.default.Object {
|
|
204
|
+
OnlineID;
|
|
205
|
+
Username;
|
|
206
|
+
CountryCode;
|
|
207
|
+
static embedded = true;
|
|
208
|
+
static schema = {
|
|
209
|
+
name: "RealmUser",
|
|
210
|
+
embedded: true,
|
|
211
|
+
properties: {
|
|
212
|
+
OnlineID: { type: "int", default: 1 },
|
|
213
|
+
Username: { type: "string", default: "", optional: true },
|
|
214
|
+
CountryCode: { type: "string", optional: true }
|
|
215
|
+
}
|
|
216
|
+
};
|
|
217
|
+
};
|
|
218
|
+
|
|
219
|
+
// src/realm/schema/realmNamedFileUsage.ts
|
|
220
|
+
var import_realm6 = __toESM(require("realm"), 1);
|
|
221
|
+
var RealmNamedFileUsage = class extends import_realm6.default.Object {
|
|
222
|
+
File;
|
|
223
|
+
Filename;
|
|
224
|
+
static embedded = true;
|
|
225
|
+
static schema = {
|
|
226
|
+
name: "RealmNamedFileUsage",
|
|
227
|
+
embedded: true,
|
|
228
|
+
properties: {
|
|
229
|
+
File: "File",
|
|
230
|
+
Filename: { type: "string", optional: true }
|
|
231
|
+
}
|
|
232
|
+
};
|
|
233
|
+
};
|
|
234
|
+
|
|
235
|
+
// src/utils/mod.ts
|
|
236
|
+
var import_node_path = __toESM(require("path"), 1);
|
|
237
|
+
var import_node_fs = require("fs");
|
|
238
|
+
function getDataDir() {
|
|
239
|
+
switch (process.platform) {
|
|
240
|
+
case "linux":
|
|
241
|
+
case "openbsd":
|
|
242
|
+
case "freebsd": {
|
|
243
|
+
const xdg = process.env["XDG_DATA_HOME"];
|
|
244
|
+
if (xdg)
|
|
245
|
+
return xdg;
|
|
246
|
+
const home = process.env["HOME"];
|
|
247
|
+
if (home)
|
|
248
|
+
return import_node_path.default.join(home, ".local", "share");
|
|
249
|
+
break;
|
|
250
|
+
}
|
|
251
|
+
case "darwin": {
|
|
252
|
+
const home = process.env["HOME"];
|
|
253
|
+
if (home)
|
|
254
|
+
return import_node_path.default.join(home, "Library", "Application Support");
|
|
255
|
+
break;
|
|
256
|
+
}
|
|
257
|
+
case "win32":
|
|
258
|
+
return process.env["LOCALAPPDATA"] ?? null;
|
|
259
|
+
}
|
|
260
|
+
return null;
|
|
261
|
+
}
|
|
262
|
+
function getConfigDir() {
|
|
263
|
+
switch (process.platform) {
|
|
264
|
+
case "openbsd":
|
|
265
|
+
case "freebsd":
|
|
266
|
+
case "linux": {
|
|
267
|
+
const xdg = process.env["XDG_CONFIG_HOME"];
|
|
268
|
+
if (xdg)
|
|
269
|
+
return xdg;
|
|
270
|
+
const home = process.env["HOME"];
|
|
271
|
+
if (home)
|
|
272
|
+
return import_node_path.default.join(home, ".config");
|
|
273
|
+
break;
|
|
274
|
+
}
|
|
275
|
+
case "darwin": {
|
|
276
|
+
const home = process.env["HOME"];
|
|
277
|
+
if (home)
|
|
278
|
+
return import_node_path.default.join(home, "Library", "Preferences");
|
|
279
|
+
break;
|
|
280
|
+
}
|
|
281
|
+
case "win32":
|
|
282
|
+
return process.env["APPDATA"] ?? null;
|
|
283
|
+
}
|
|
284
|
+
return null;
|
|
285
|
+
}
|
|
286
|
+
function getRealmDBPath(appConfigDir, osuDataDir, reload = false) {
|
|
287
|
+
const localDBPath = import_node_path.default.join(appConfigDir, "client.realm");
|
|
288
|
+
if (!reload && (0, import_node_fs.existsSync)(localDBPath))
|
|
289
|
+
return localDBPath;
|
|
290
|
+
const osuDBPath = import_node_path.default.join(
|
|
291
|
+
osuDataDir || getDataDir() || ".",
|
|
292
|
+
"osu",
|
|
293
|
+
"client.realm"
|
|
294
|
+
);
|
|
295
|
+
if ((0, import_node_fs.existsSync)(osuDBPath)) {
|
|
296
|
+
console.log(
|
|
297
|
+
`[getRealmDBPath]: ${osuDBPath} is being imported from osu!lazer to ${localDBPath}`
|
|
298
|
+
);
|
|
299
|
+
(0, import_node_fs.mkdirSync)(appConfigDir);
|
|
300
|
+
(0, import_node_fs.copyFileSync)(osuDBPath, localDBPath);
|
|
301
|
+
return localDBPath;
|
|
302
|
+
} else {
|
|
303
|
+
console.log(`[getRealmDBPath]: ${osuDBPath} not found`);
|
|
304
|
+
return null;
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
// src/realm/mod.ts
|
|
309
|
+
var import_realm7 = __toESM(require("realm"), 1);
|
|
310
|
+
var import_node_path2 = __toESM(require("path"), 1);
|
|
311
|
+
var getLazerDB = async (realmDBPath) => {
|
|
312
|
+
const realm = await import_realm7.default.open({
|
|
313
|
+
schema: [
|
|
314
|
+
BeatmapSet,
|
|
315
|
+
RealmFile,
|
|
316
|
+
RealmNamedFileUsage,
|
|
317
|
+
Beatmap,
|
|
318
|
+
BeatmapMetadata,
|
|
319
|
+
RealmUser
|
|
320
|
+
],
|
|
321
|
+
path: realmDBPath,
|
|
322
|
+
schemaVersion: 36,
|
|
323
|
+
onMigration: (oldRealm, newRealm) => {
|
|
324
|
+
console.log(
|
|
325
|
+
`[onMigration]: Migrating ${oldRealm.path} - ${oldRealm.schemaVersion} -> ${newRealm.path} - ${newRealm.schemaVersion}`
|
|
326
|
+
);
|
|
327
|
+
}
|
|
328
|
+
});
|
|
329
|
+
return realm;
|
|
330
|
+
};
|
|
331
|
+
var hashedFilePath = (hash) => {
|
|
332
|
+
const dataDir = getDataDir();
|
|
333
|
+
if (!dataDir)
|
|
334
|
+
return null;
|
|
335
|
+
return import_node_path2.default.join(
|
|
336
|
+
dataDir,
|
|
337
|
+
"osu",
|
|
338
|
+
"files",
|
|
339
|
+
hash.slice(0, 1),
|
|
340
|
+
hash.slice(0, 2),
|
|
341
|
+
hash
|
|
342
|
+
);
|
|
343
|
+
};
|
|
344
|
+
var getNamedFileHash = (fileName, beatmapSet) => {
|
|
345
|
+
const files = beatmapSet.Files;
|
|
346
|
+
for (const file of files) {
|
|
347
|
+
if (file.Filename == fileName)
|
|
348
|
+
return file.File.Hash;
|
|
349
|
+
}
|
|
350
|
+
return void 0;
|
|
351
|
+
};
|
|
352
|
+
|
|
353
|
+
// src/cli/main.ts
|
|
354
|
+
async function main() {
|
|
355
|
+
console.log("[INFO] OSU!list");
|
|
356
|
+
const realmDBPath = getRealmDBPath(
|
|
357
|
+
import_node_path3.default.join(getConfigDir() || ".", "osu-play")
|
|
358
|
+
);
|
|
359
|
+
if (realmDBPath == null) {
|
|
360
|
+
console.log("[ERROR] Realm DB not found");
|
|
361
|
+
process.exit(1);
|
|
362
|
+
}
|
|
363
|
+
const currentSchema = import_realm8.default.schemaVersion(realmDBPath);
|
|
364
|
+
console.log(`currentSchema: ${currentSchema}`);
|
|
365
|
+
import_realm8.default.flags.ALLOW_CLEAR_TEST_STATE = true;
|
|
366
|
+
const realm = await getLazerDB(realmDBPath);
|
|
367
|
+
console.log(`realm.isClosed: ${realm.isClosed}`);
|
|
368
|
+
const beatmapSets = realm.objects(BeatmapSet);
|
|
369
|
+
console.log(`beatmaps: ${beatmapSets.length}`);
|
|
370
|
+
const selectedBeatmapSet = (await (0, import_prompts.default)({
|
|
371
|
+
type: "autocomplete",
|
|
372
|
+
name: "beatmapSet",
|
|
373
|
+
message: "Which map do you want to play:",
|
|
374
|
+
choices: beatmapSets.map((beatmapSet) => {
|
|
375
|
+
const meta = beatmapSet.Beatmaps[0].Metadata;
|
|
376
|
+
return {
|
|
377
|
+
title: `${meta.Title} : ${meta.Artist} - ${meta.TitleUnicode} : ${meta.ArtistUnicode}`,
|
|
378
|
+
value: beatmapSet
|
|
379
|
+
};
|
|
380
|
+
})
|
|
381
|
+
})).beatmapSet;
|
|
382
|
+
console.log(`Map : ${selectedBeatmapSet.Beatmaps[0].Metadata.Title}`);
|
|
383
|
+
const fileName = selectedBeatmapSet.Beatmaps[0].Metadata.AudioFile;
|
|
384
|
+
const fileHash = fileName ? getNamedFileHash(fileName, selectedBeatmapSet) : void 0;
|
|
385
|
+
const filePath = fileHash ? hashedFilePath(fileHash) : void 0;
|
|
386
|
+
if (filePath && (0, import_node_fs2.existsSync)(filePath)) {
|
|
387
|
+
console.log(`File exists: ${filePath}`);
|
|
388
|
+
} else {
|
|
389
|
+
console.log(`File does not exist: ${filePath}`);
|
|
390
|
+
}
|
|
391
|
+
console.log(`Playing file ${selectedBeatmapSet.Beatmaps[0].Metadata.Title}`);
|
|
392
|
+
filePath && (0, import_node_child_process.execSync)(`exo-open ${filePath}`);
|
|
393
|
+
realm.close();
|
|
394
|
+
console.log(`realm.isClosed: ${realm.isClosed}`);
|
|
395
|
+
}
|
|
396
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
397
|
+
0 && (module.exports = {
|
|
398
|
+
main
|
|
399
|
+
});
|
|
400
|
+
//# sourceMappingURL=main.cjs.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;AAAA;AAAA;AAAA;AAAA;AAAA,IAAAA,oBAAiB;AACjB,IAAAC,kBAA2B;AAC3B,gCAAyB;AAEzB,IAAAC,gBAAkB;AAClB,qBAAoB;;;ACLpB,mBAAkB;AAIX,IAAM,UAAN,cAAsB,aAAAC,QAAM,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,G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,KAAK,aAAa;AAAA,QAC/E,OAAO;AAAA,MACT;AAAA,IACF,CAAC;AAAA,EACH,CAAC,GACD;AAEF,UAAQ,IAAI,SAAS,mBAAmB,SAAS,CAAC,EAAE,SAAS,KAAK,EAAE;AACpE,QAAM,WAAW,mBAAmB,SAAS,CAAC,EAAE,SAAS;AACzD,QAAM,WAAW,WACb,iBAAiB,UAAU,kBAAkB,IAC7C;AACJ,QAAM,WAAW,WAAW,eAAe,QAAQ,IAAI;AACvD,MAAI,gBAAY,4BAAW,QAAQ,GAAG;AACpC,YAAQ,IAAI,gBAAgB,QAAQ,EAAE;AAAA,EACxC,OAAO;AACL,YAAQ,IAAI,wBAAwB,QAAQ,EAAE;AAAA,EAChD;AAGA,UAAQ,IAAI,gBAAgB,mBAAmB,SAAS,CAAC,EAAE,SAAS,KAAK,EAAE;AAC3E,kBAAY,oCAAS,YAAY,QAAQ,EAAE;AAE3C,QAAM,MAAM;AACZ,UAAQ,IAAI,mBAAmB,MAAM,QAAQ,EAAE;AAGjD;","names":["import_node_path","import_node_fs","import_realm","Realm","import_realm","Realm","import_realm","Realm","import_realm","Realm","import_realm","Realm","import_realm","Realm","path","import_realm","import_node_path","Realm","path","path","Realm","prompts"]}
|