mirror of
https://github.com/ZHANGTIANYAO1/teamspeak-music-bot.git
synced 2026-12-03 11:22:51 +08:00
fix(playback): resume interrupted finite music streams
This commit is contained in:
1 parent
d130652279
commit
135ff0ae0e
7 files changed
+151
-19
No files matched your search
@@ -480,6 +480,17 @@ describe("NetEase risk control (-460)", () => {
|
||||
expect(r?.url).toBe("http://cdn.example/x.mp3");
|
||||
expect(r?.trialDuration).toBe(60);
|
||||
});
|
||||
|
||||
it("requests a new sidecar cache key for interruption recovery", async () => {
|
||||
const get = vi.fn(async (_url: string, _config: unknown) => ({
|
||||
data: { data: [{ url: "http://cdn.example/track.mp3" }] },
|
||||
}));
|
||||
const provider = providerWithApi(get);
|
||||
await provider.getSongUrl("1");
|
||||
await provider.getSongUrl("1", undefined, { refresh: true });
|
||||
expect(get.mock.calls[0][1]).not.toHaveProperty("params.timestamp");
|
||||
expect(get.mock.calls[1][1]).toMatchObject({ params: { id: "1", timestamp: expect.any(Number) } });
|
||||
});
|
||||
});
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
Reference in new issue
Block a user