osu-play 1.0.7 → 1.2.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/README.md +93 -39
- package/dist/cli.cjs +1579 -0
- package/dist/cli.cjs.map +25 -0
- package/dist/cli.d.cts +2 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +1569 -0
- package/dist/cli.js.map +25 -0
- package/dist/core/cli/main.d.ts +20 -0
- package/dist/core/lazer/compat.d.ts +24 -0
- package/dist/core/lazer/mod.d.ts +10 -0
- package/dist/core/lazer/schema/beatmap.d.ts +35 -0
- package/dist/core/lazer/schema/beatmapMetadata.d.ts +16 -0
- package/dist/core/lazer/schema/beatmapSet.d.ts +18 -0
- package/{src/realm/schema/mod.ts → dist/core/lazer/schema/mod.d.ts} +0 -1
- package/dist/core/lazer/schema/realmFile.d.ts +6 -0
- package/dist/core/lazer/schema/realmNamedFileUsage.d.ts +9 -0
- package/dist/core/lazer/schema/realmUser.d.ts +9 -0
- package/dist/core/player/mod.d.ts +3 -0
- package/dist/core/player/mpv.d.ts +37 -0
- package/dist/core/player/session.d.ts +45 -0
- package/dist/core/player/types.d.ts +46 -0
- package/dist/core/playlist/mod.d.ts +28 -0
- package/dist/core/tui/player-screen.d.ts +26 -0
- package/dist/core/utils/mod.d.ts +16 -0
- package/dist/index.cjs +529 -0
- package/dist/index.cjs.map +21 -0
- package/dist/index.d.cts +4 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +512 -0
- package/dist/index.js.map +21 -0
- package/package.json +54 -25
- package/bin/osu-play.js +0 -7
- package/index.ts +0 -1
- package/src/cli/main.ts +0 -156
- package/src/mod.ts +0 -2
- 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/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 -77
- package/tsconfig.json +0 -109
package/README.md
CHANGED
|
@@ -12,58 +12,112 @@
|
|
|
12
12
|
> Listen to your favourite [osu!lazer](https://lazer.ppy.sh) beatmaps as a
|
|
13
13
|
> spotify playlist from the terminal
|
|
14
14
|
|
|
15
|
-
##
|
|
15
|
+
## Requirements
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
- Node.js `20+`
|
|
18
|
+
- `mpv` available on your `PATH`
|
|
19
|
+
- An osu!lazer install with beatmaps available locally
|
|
18
20
|
|
|
19
|
-
|
|
20
|
-
- [osu!lazer](https://lazer.ppy.sh/home/download) with some beatmaps to listen
|
|
21
|
-
to 😉
|
|
22
|
-
- That's it!
|
|
21
|
+
If you're developing locally, Realm's native bindings are still the one awkward part of this stack. Use the repo's `setup` script so Bun install and the Realm repair step happen in the right order.
|
|
23
22
|
|
|
24
|
-
|
|
23
|
+
## Installation
|
|
25
24
|
|
|
26
|
-
- Try out the latest release without installing anything:
|
|
27
25
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
```
|
|
26
|
+
```bash
|
|
27
|
+
npm install -g osu-play
|
|
28
|
+
```
|
|
32
29
|
|
|
33
|
-
|
|
30
|
+
Or run it without a global install:
|
|
34
31
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
```
|
|
32
|
+
```bash
|
|
33
|
+
npx osu-play
|
|
34
|
+
```
|
|
39
35
|
|
|
40
36
|
## Usage
|
|
41
37
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
--exportPlaylist Export playlist to a file [string]
|
|
54
|
-
-d, --osuDataDir Osu!lazer data directory
|
|
55
|
-
[string] [default: "/home/origami/.local/share/osu"]
|
|
56
|
-
-c, --configDir Config directory
|
|
57
|
-
[string] [default: "/home/origami/.config/osu-play"]
|
|
58
|
-
-l, --loop Loop the playlist on end [boolean] [default: false]
|
|
38
|
+
### CLI
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
# Launch the TUI player
|
|
42
|
+
osu-play
|
|
43
|
+
|
|
44
|
+
# Export a playlist file
|
|
45
|
+
osu-play --exportPlaylist playlist.txt
|
|
46
|
+
|
|
47
|
+
# Loop the playlist
|
|
48
|
+
osu-play --loop
|
|
59
49
|
```
|
|
60
50
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
51
|
+
### TUI Controls
|
|
52
|
+
|
|
53
|
+
- `Up/Down` or `j/k`: Move through the playlist
|
|
54
|
+
- `Left/Right` or `h/l`: Seek backward or forward by 5 seconds
|
|
55
|
+
- `Enter`: Play the selected track
|
|
56
|
+
- `Space`: Pause or resume playback
|
|
57
|
+
- `n` / `p`: Next or previous track
|
|
58
|
+
- `PageUp` / `PageDown`: Jump faster through the playlist
|
|
59
|
+
- `r`: Toggle looping
|
|
60
|
+
- `s`: Stop playback
|
|
61
|
+
- `q`: Quit
|
|
62
|
+
- `/`: Enter search mode
|
|
63
|
+
- Type in search mode: Jump the selection by track title
|
|
64
|
+
- `Backspace`: Edit the search query
|
|
65
|
+
- `Enter`: Leave search mode and keep the current query
|
|
66
|
+
- `Esc`: Leave search mode, or clear the current query outside search mode
|
|
67
|
+
|
|
68
|
+
### API
|
|
64
69
|
|
|
65
70
|
```ts
|
|
66
|
-
import {
|
|
71
|
+
import { getLazerDB, getRealmDBPath } from "osu-play";
|
|
72
|
+
|
|
73
|
+
const realmPath = getRealmDBPath({ osuDataDir: "/path/to/osu" });
|
|
74
|
+
const db = await getLazerDB(realmPath);
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
## Options
|
|
78
|
+
|
|
79
|
+
- `--reload, -r`: Deprecated and ignored
|
|
80
|
+
- `--exportPlaylist`: Export the discovered track paths to a file instead of launching the TUI
|
|
81
|
+
- `--osuDataDir, -d`: Override the osu!lazer data directory
|
|
82
|
+
- `--configDir, -c`: Deprecated and ignored
|
|
83
|
+
- `--loop, -l`: Restart from the beginning when playback reaches the end
|
|
84
|
+
- `--help, -h`: Show help
|
|
85
|
+
|
|
86
|
+
## Development
|
|
87
|
+
|
|
88
|
+
Bun `1.3+` is required only for development and contributing; it is not needed to run the published CLI via `npm install -g` or `npx osu-play`.
|
|
67
89
|
|
|
68
|
-
|
|
90
|
+
```bash
|
|
91
|
+
bun run setup
|
|
92
|
+
bun run dev
|
|
93
|
+
bun run check
|
|
69
94
|
```
|
|
95
|
+
|
|
96
|
+
Useful day-to-day commands:
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
bun run dev
|
|
100
|
+
bun run dev -- --loop
|
|
101
|
+
bun run dev -- --exportPlaylist playlist.txt
|
|
102
|
+
bun run test
|
|
103
|
+
bun run package
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
If you hit a Realm native-binding error like `realm.node` missing or Node failing to load Realm:
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
bun install
|
|
110
|
+
bun run repair:realm
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
If `osu-play` fails with an `mpv` startup or IPC error, make sure `mpv` is installed and available on your shell `PATH`.
|
|
114
|
+
|
|
115
|
+
`bun run package` builds the distributable files and creates a local npm tarball with `bun pm pack`.
|
|
116
|
+
|
|
117
|
+
osu-play now reads osu!lazer's live `client.realm` directly in read-only mode instead of copying it into a separate app directory.
|
|
118
|
+
|
|
119
|
+
Standalone Bun executables are intentionally not part of the release flow right now. The current Realm dependency uses native bindings, and Bun's standalone executable support does not yet cover that path cleanly enough for this app.
|
|
120
|
+
|
|
121
|
+
## License
|
|
122
|
+
|
|
123
|
+
MIT
|