@involvex/youtube-music-cli 0.0.45 → 0.0.46

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/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## [0.0.46](https://github.com/involvex/youtube-music-cli/compare/v0.0.45...v0.0.46) (2026-02-24)
2
+
3
+ ### Bug Fixes
4
+
5
+ - keep autoplay running and document completions ([9356c5d](https://github.com/involvex/youtube-music-cli/commit/9356c5db6583cd926a78af15302cdac5bde65aab))
6
+
1
7
  ## [0.0.45](https://github.com/involvex/youtube-music-cli/compare/v0.0.44...v0.0.45) (2026-02-24)
2
8
 
3
9
  ### Features
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@involvex/youtube-music-cli",
3
- "version": "0.0.45",
3
+ "version": "0.0.46",
4
4
  "description": "- A Commandline music player for youtube-music",
5
5
  "repository": {
6
6
  "type": "git",
@@ -251,6 +251,7 @@ function PlayerManager() {
251
251
  }, [dispatch]);
252
252
  // Register event handler for mpv IPC events
253
253
  const eofTimestampRef = useRef(0);
254
+ const lastAutoNextRef = useRef(0);
254
255
  useEffect(() => {
255
256
  let lastProgressUpdate = 0;
256
257
  const PROGRESS_THROTTLE_MS = 1000; // Update progress max once per second
@@ -269,8 +270,10 @@ function PlayerManager() {
269
270
  if (event.eof) {
270
271
  // Track ended — record timestamp so we can suppress mpv's spurious
271
272
  // pause event that immediately follows EOF (idle state).
272
- eofTimestampRef.current = Date.now();
273
+ const now = Date.now();
274
+ eofTimestampRef.current = now;
273
275
  next();
276
+ lastAutoNextRef.current = now;
274
277
  }
275
278
  if (event.paused !== undefined) {
276
279
  // mpv sends pause=true when a track ends and it enters idle mode.
@@ -505,14 +508,45 @@ function PlayerManager() {
505
508
  config.set('volume', state.volume);
506
509
  }, [state.volume]);
507
510
  // Handle track completion
511
+ const autoAdvanceRef = useRef(false);
508
512
  useEffect(() => {
509
- if (state.duration > 0 && state.progress >= state.duration) {
510
- if (state.repeat === 'one') {
511
- dispatch({ category: 'SEEK', position: 0 });
512
- }
513
- // next() for regular track completion is handled by the eof IPC event
513
+ if (state.duration <= 0) {
514
+ autoAdvanceRef.current = false;
515
+ return;
516
+ }
517
+ if (state.progress < state.duration) {
518
+ autoAdvanceRef.current = false;
519
+ return;
514
520
  }
515
- }, [state.progress, state.duration, state.repeat, dispatch]);
521
+ if (state.repeat === 'one') {
522
+ dispatch({ category: 'SEEK', position: 0 });
523
+ return;
524
+ }
525
+ const hasNextTrack = state.queue.length > 0 &&
526
+ (state.repeat === 'all' ||
527
+ state.queuePosition < state.queue.length - 1 ||
528
+ (state.shuffle && state.queue.length > 1));
529
+ if (!hasNextTrack) {
530
+ return;
531
+ }
532
+ const now = Date.now();
533
+ if (now - lastAutoNextRef.current < 1500) {
534
+ return;
535
+ }
536
+ if (!autoAdvanceRef.current) {
537
+ autoAdvanceRef.current = true;
538
+ lastAutoNextRef.current = now;
539
+ dispatch({ category: 'NEXT' });
540
+ }
541
+ }, [
542
+ state.duration,
543
+ state.progress,
544
+ state.repeat,
545
+ state.queue.length,
546
+ state.queuePosition,
547
+ state.shuffle,
548
+ dispatch,
549
+ ]);
516
550
  return null;
517
551
  }
518
552
  export function PlayerProvider({ children }) {
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@involvex/youtube-music-cli",
3
- "version": "0.0.45",
3
+ "version": "0.0.46",
4
4
  "description": "- A Commandline music player for youtube-music",
5
5
  "repository": {
6
6
  "type": "git",
package/readme.md CHANGED
@@ -27,6 +27,7 @@ A powerful Terminal User Interface (TUI) music player for YouTube Music
27
27
  - 🖥️ **Headless Mode** - Run without TUI for scripting
28
28
  - 💾 **Downloads** - Save tracks/playlists/artists with `Shift+D`
29
29
  - 🏷️ **Metadata Tagging** - Auto-tag title/artist/album with optional cover art
30
+ - ⚡️ **Shell Completions** - `ymc completions <bash|zsh|powershell|fish>` emits scripts you can source or save so the CLI (also available as `ymc`) tab-completes subcommands and flags
30
31
 
31
32
  ## Roadmap
32
33
 
@@ -161,6 +162,28 @@ youtube-music-cli skip
161
162
  youtube-music-cli back
162
163
  ```
163
164
 
165
+ ### Shell completions
166
+
167
+ Generate shell completion helpers through the lightweight `ymc` alias that ships with the CLI. Run `ymc completions <bash|zsh|powershell|fish>` to print the completion script for your shell, then source it or persist it in your profile:
168
+
169
+ ```bash
170
+ # Bash
171
+ source <(ymc completions bash)
172
+ ymc completions bash >> ~/.bash_completion
173
+
174
+ # Zsh
175
+ source <(ymc completions zsh)
176
+
177
+ # PowerShell
178
+ ymc completions powershell | Out-File -Encoding utf8 $PROFILE
179
+ Invoke-Expression (ymc completions powershell)
180
+
181
+ # Fish
182
+ ymc completions fish > ~/.config/fish/completions/ymc.fish
183
+ ```
184
+
185
+ If you installed the CLI globally with an alias or script name, make sure `ymc` points at the same binary before generating completions so that the script matches your install path.
186
+
164
187
  ### Options
165
188
 
166
189
  | Flag | Short | Description |