nixamp 0.20.0 → 0.20.1

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/dist/server.js CHANGED
@@ -3971,10 +3971,21 @@ async function liveAudio(request, response, engine, ffmpeg, ffprobe) {
3971
3971
  child = null;
3972
3972
  if (closed)
3973
3973
  return;
3974
- // Follow the player if it has already moved on. If it has not, look
3975
- // again shortly -- which is also what makes a single-track library
3976
- // repeat rather than fall silent.
3977
- later(engine.snapshot().index === playing ? LIVE_GAP_MS : 0, next);
3974
+ const now = engine.snapshot();
3975
+ // Follow the player if it has already moved on.
3976
+ if (now.index !== playing) {
3977
+ later(0, next);
3978
+ return;
3979
+ }
3980
+ // It has not. Served like this the engine decodes nothing itself, so
3981
+ // nothing ever ends a track on its side and the index never moves on
3982
+ // its own: a podcast playlist streamed to a room played its first
3983
+ // episode to the end and then played it again, for ever. This stream
3984
+ // is the playback, so it is the one that moves the player on. One
3985
+ // track alone still repeats rather than falls silent, as before.
3986
+ if (now.trackCount > 1)
3987
+ engine.command({ type: "next" });
3988
+ later(LIVE_GAP_MS, next);
3978
3989
  });
3979
3990
  };
3980
3991
  // A track change that lands while we are between songs is the signal to go
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nixamp",
3
- "version": "0.20.0",
3
+ "version": "0.20.1",
4
4
  "description": "It really whips the terminal's ass. A Winamp-shaped audio player for your terminal.",
5
5
  "license": "MIT",
6
6
  "type": "module",
package/src/server.ts CHANGED
@@ -4548,10 +4548,20 @@ async function liveAudio(
4548
4548
  if (child !== spawned) return;
4549
4549
  child = null;
4550
4550
  if (closed) return;
4551
- // Follow the player if it has already moved on. If it has not, look
4552
- // again shortly -- which is also what makes a single-track library
4553
- // repeat rather than fall silent.
4554
- later(engine.snapshot().index === playing ? LIVE_GAP_MS : 0, next);
4551
+ const now = engine.snapshot();
4552
+ // Follow the player if it has already moved on.
4553
+ if (now.index !== playing) {
4554
+ later(0, next);
4555
+ return;
4556
+ }
4557
+ // It has not. Served like this the engine decodes nothing itself, so
4558
+ // nothing ever ends a track on its side and the index never moves on
4559
+ // its own: a podcast playlist streamed to a room played its first
4560
+ // episode to the end and then played it again, for ever. This stream
4561
+ // is the playback, so it is the one that moves the player on. One
4562
+ // track alone still repeats rather than falls silent, as before.
4563
+ if (now.trackCount > 1) engine.command({ type: "next" });
4564
+ later(LIVE_GAP_MS, next);
4555
4565
  });
4556
4566
  };
4557
4567
 
package/web/dist/sw.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /* nixamp service worker — generated, do not edit */
2
- const CACHE = "nixamp-1789234792860";
2
+ const CACHE = "nixamp-1789235461940";
3
3
  const PRECACHE = [
4
4
  "/",
5
5
  "/apple-touch-icon.png",