mirror of
https://github.com/wkulhanek/bonob.git
synced 2025-12-22 01:43:29 +01:00
Revert "Marking nowPlaying in smapi setPlayedSeconds handler so does not mark when sonos pre-caches a track (#57)" (#66)
This reverts commit c312778e13.
This commit is contained in:
@@ -356,7 +356,7 @@ function server(
|
|||||||
})
|
})
|
||||||
.then((stream) => ({ musicLibrary: it, stream }))
|
.then((stream) => ({ musicLibrary: it, stream }))
|
||||||
)
|
)
|
||||||
.then(({ stream }) => {
|
.then(({ musicLibrary, stream }) => {
|
||||||
logger.info(
|
logger.info(
|
||||||
`${trace} bnb<- stream response from music service for ${id}, status=${
|
`${trace} bnb<- stream response from music service for ${id}, status=${
|
||||||
stream.status
|
stream.status
|
||||||
@@ -375,25 +375,32 @@ function server(
|
|||||||
filter,
|
filter,
|
||||||
headers,
|
headers,
|
||||||
sendStream,
|
sendStream,
|
||||||
|
nowPlaying,
|
||||||
}: {
|
}: {
|
||||||
status: number;
|
status: number;
|
||||||
filter: Transform;
|
filter: Transform;
|
||||||
headers: Record<string, string>;
|
headers: Record<string, string>;
|
||||||
sendStream: boolean;
|
sendStream: boolean;
|
||||||
|
nowPlaying: boolean;
|
||||||
}) => {
|
}) => {
|
||||||
logger.info(
|
logger.info(
|
||||||
`${trace} bnb-> ${
|
`${trace} bnb-> ${
|
||||||
req.path
|
req.path
|
||||||
}, status=${status}, headers=${JSON.stringify(headers)}`
|
}, status=${status}, headers=${JSON.stringify(headers)}`
|
||||||
);
|
);
|
||||||
res.status(status);
|
(nowPlaying
|
||||||
Object.entries(headers)
|
? musicLibrary.nowPlaying(id)
|
||||||
.filter(([_, v]) => v !== undefined)
|
: Promise.resolve(true)
|
||||||
.forEach(([header, value]) => {
|
).then((_) => {
|
||||||
res.setHeader(header, value!);
|
res.status(status);
|
||||||
});
|
Object.entries(headers)
|
||||||
if (sendStream) stream.stream.pipe(filter).pipe(res);
|
.filter(([_, v]) => v !== undefined)
|
||||||
else res.send();
|
.forEach(([header, value]) => {
|
||||||
|
res.setHeader(header, value!);
|
||||||
|
});
|
||||||
|
if (sendStream) stream.stream.pipe(filter).pipe(res);
|
||||||
|
else res.send();
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
if (stream.status == 200) {
|
if (stream.status == 200) {
|
||||||
@@ -408,6 +415,7 @@ function server(
|
|||||||
"accept-ranges": stream.headers["accept-ranges"],
|
"accept-ranges": stream.headers["accept-ranges"],
|
||||||
},
|
},
|
||||||
sendStream: req.method == "GET",
|
sendStream: req.method == "GET",
|
||||||
|
nowPlaying: req.method == "GET",
|
||||||
});
|
});
|
||||||
} else if (stream.status == 206) {
|
} else if (stream.status == 206) {
|
||||||
respondWith({
|
respondWith({
|
||||||
@@ -422,6 +430,7 @@ function server(
|
|||||||
"accept-ranges": stream.headers["accept-ranges"],
|
"accept-ranges": stream.headers["accept-ranges"],
|
||||||
},
|
},
|
||||||
sendStream: req.method == "GET",
|
sendStream: req.method == "GET",
|
||||||
|
nowPlaying: req.method == "GET",
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
respondWith({
|
respondWith({
|
||||||
@@ -429,6 +438,7 @@ function server(
|
|||||||
filter: new PassThrough(),
|
filter: new PassThrough(),
|
||||||
headers: {},
|
headers: {},
|
||||||
sendStream: req.method == "GET",
|
sendStream: req.method == "GET",
|
||||||
|
nowPlaying: false,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
30
src/smapi.ts
30
src/smapi.ts
@@ -914,26 +914,16 @@ function bindSmapiSoapServiceToExpress(
|
|||||||
.then(({ musicLibrary, type, typeId }) => {
|
.then(({ musicLibrary, type, typeId }) => {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case "track":
|
case "track":
|
||||||
return musicLibrary
|
return musicLibrary.track(typeId).then(({ duration }) => {
|
||||||
.track(typeId)
|
if (
|
||||||
.then(({ duration }) => {
|
(duration < 30 && +seconds >= 10) ||
|
||||||
if (
|
(duration >= 30 && +seconds >= 30)
|
||||||
(duration < 30 && +seconds >= 10) ||
|
) {
|
||||||
(duration >= 30 && +seconds >= 30)
|
return musicLibrary.scrobble(typeId);
|
||||||
) {
|
} else {
|
||||||
return musicLibrary.scrobble(typeId);
|
return Promise.resolve(true);
|
||||||
} else {
|
}
|
||||||
return Promise.resolve(true);
|
});
|
||||||
}
|
|
||||||
})
|
|
||||||
.then(() => {
|
|
||||||
if (+seconds > 0) {
|
|
||||||
return musicLibrary.nowPlaying(typeId);
|
|
||||||
} else {
|
|
||||||
return Promise.resolve(true);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
logger.info("Unsupported scrobble", { id, seconds });
|
logger.info("Unsupported scrobble", { id, seconds });
|
||||||
return Promise.resolve(true);
|
return Promise.resolve(true);
|
||||||
|
|||||||
@@ -707,6 +707,7 @@ describe("server", () => {
|
|||||||
const musicLibrary = {
|
const musicLibrary = {
|
||||||
stream: jest.fn(),
|
stream: jest.fn(),
|
||||||
scrobble: jest.fn(),
|
scrobble: jest.fn(),
|
||||||
|
nowPlaying: jest.fn(),
|
||||||
};
|
};
|
||||||
let now = dayjs();
|
let now = dayjs();
|
||||||
const accessTokens = new ExpiringAccessTokens({ now: () => now });
|
const accessTokens = new ExpiringAccessTokens({ now: () => now });
|
||||||
@@ -870,6 +871,7 @@ describe("server", () => {
|
|||||||
|
|
||||||
expect(res.status).toEqual(404);
|
expect(res.status).toEqual(404);
|
||||||
|
|
||||||
|
expect(musicLibrary.nowPlaying).not.toHaveBeenCalled();
|
||||||
expect(musicLibrary.stream).toHaveBeenCalledWith({ trackId });
|
expect(musicLibrary.stream).toHaveBeenCalledWith({ trackId });
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -890,6 +892,7 @@ describe("server", () => {
|
|||||||
|
|
||||||
musicService.login.mockResolvedValue(musicLibrary);
|
musicService.login.mockResolvedValue(musicLibrary);
|
||||||
musicLibrary.stream.mockResolvedValue(stream);
|
musicLibrary.stream.mockResolvedValue(stream);
|
||||||
|
musicLibrary.nowPlaying.mockResolvedValue(true);
|
||||||
|
|
||||||
const res = await request(server)
|
const res = await request(server)
|
||||||
.get(
|
.get(
|
||||||
@@ -909,6 +912,7 @@ describe("server", () => {
|
|||||||
expect(Object.keys(res.headers)).not.toContain("content-range");
|
expect(Object.keys(res.headers)).not.toContain("content-range");
|
||||||
|
|
||||||
expect(musicService.login).toHaveBeenCalledWith(authToken);
|
expect(musicService.login).toHaveBeenCalledWith(authToken);
|
||||||
|
expect(musicLibrary.nowPlaying).toHaveBeenCalledWith(trackId);
|
||||||
expect(musicLibrary.stream).toHaveBeenCalledWith({ trackId });
|
expect(musicLibrary.stream).toHaveBeenCalledWith({ trackId });
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -928,6 +932,7 @@ describe("server", () => {
|
|||||||
|
|
||||||
musicService.login.mockResolvedValue(musicLibrary);
|
musicService.login.mockResolvedValue(musicLibrary);
|
||||||
musicLibrary.stream.mockResolvedValue(stream);
|
musicLibrary.stream.mockResolvedValue(stream);
|
||||||
|
musicLibrary.nowPlaying.mockResolvedValue(true);
|
||||||
|
|
||||||
const res = await request(server)
|
const res = await request(server)
|
||||||
.get(
|
.get(
|
||||||
@@ -946,6 +951,7 @@ describe("server", () => {
|
|||||||
expect(Object.keys(res.headers)).not.toContain("content-range");
|
expect(Object.keys(res.headers)).not.toContain("content-range");
|
||||||
|
|
||||||
expect(musicService.login).toHaveBeenCalledWith(authToken);
|
expect(musicService.login).toHaveBeenCalledWith(authToken);
|
||||||
|
expect(musicLibrary.nowPlaying).toHaveBeenCalledWith(trackId);
|
||||||
expect(musicLibrary.stream).toHaveBeenCalledWith({ trackId });
|
expect(musicLibrary.stream).toHaveBeenCalledWith({ trackId });
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -964,6 +970,7 @@ describe("server", () => {
|
|||||||
|
|
||||||
musicService.login.mockResolvedValue(musicLibrary);
|
musicService.login.mockResolvedValue(musicLibrary);
|
||||||
musicLibrary.stream.mockResolvedValue(stream);
|
musicLibrary.stream.mockResolvedValue(stream);
|
||||||
|
musicLibrary.nowPlaying.mockResolvedValue(true);
|
||||||
|
|
||||||
const res = await request(server)
|
const res = await request(server)
|
||||||
.get(
|
.get(
|
||||||
@@ -982,6 +989,7 @@ describe("server", () => {
|
|||||||
expect(res.header["content-range"]).toBeUndefined();
|
expect(res.header["content-range"]).toBeUndefined();
|
||||||
|
|
||||||
expect(musicService.login).toHaveBeenCalledWith(authToken);
|
expect(musicService.login).toHaveBeenCalledWith(authToken);
|
||||||
|
expect(musicLibrary.nowPlaying).toHaveBeenCalledWith(trackId);
|
||||||
expect(musicLibrary.stream).toHaveBeenCalledWith({ trackId });
|
expect(musicLibrary.stream).toHaveBeenCalledWith({ trackId });
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -1001,6 +1009,7 @@ describe("server", () => {
|
|||||||
|
|
||||||
musicService.login.mockResolvedValue(musicLibrary);
|
musicService.login.mockResolvedValue(musicLibrary);
|
||||||
musicLibrary.stream.mockResolvedValue(stream);
|
musicLibrary.stream.mockResolvedValue(stream);
|
||||||
|
musicLibrary.nowPlaying.mockResolvedValue(true);
|
||||||
|
|
||||||
const res = await request(server)
|
const res = await request(server)
|
||||||
.get(
|
.get(
|
||||||
@@ -1021,6 +1030,7 @@ describe("server", () => {
|
|||||||
);
|
);
|
||||||
|
|
||||||
expect(musicService.login).toHaveBeenCalledWith(authToken);
|
expect(musicService.login).toHaveBeenCalledWith(authToken);
|
||||||
|
expect(musicLibrary.nowPlaying).toHaveBeenCalledWith(trackId);
|
||||||
expect(musicLibrary.stream).toHaveBeenCalledWith({ trackId });
|
expect(musicLibrary.stream).toHaveBeenCalledWith({ trackId });
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -1041,6 +1051,7 @@ describe("server", () => {
|
|||||||
|
|
||||||
musicService.login.mockResolvedValue(musicLibrary);
|
musicService.login.mockResolvedValue(musicLibrary);
|
||||||
musicLibrary.stream.mockResolvedValue(stream);
|
musicLibrary.stream.mockResolvedValue(stream);
|
||||||
|
musicLibrary.nowPlaying.mockResolvedValue(true);
|
||||||
|
|
||||||
const requestedRange = "40-";
|
const requestedRange = "40-";
|
||||||
|
|
||||||
@@ -1062,6 +1073,7 @@ describe("server", () => {
|
|||||||
expect(res.header["content-range"]).toBeUndefined();
|
expect(res.header["content-range"]).toBeUndefined();
|
||||||
|
|
||||||
expect(musicService.login).toHaveBeenCalledWith(authToken);
|
expect(musicService.login).toHaveBeenCalledWith(authToken);
|
||||||
|
expect(musicLibrary.nowPlaying).toHaveBeenCalledWith(trackId);
|
||||||
expect(musicLibrary.stream).toHaveBeenCalledWith({
|
expect(musicLibrary.stream).toHaveBeenCalledWith({
|
||||||
trackId,
|
trackId,
|
||||||
range: requestedRange,
|
range: requestedRange,
|
||||||
@@ -1084,6 +1096,7 @@ describe("server", () => {
|
|||||||
|
|
||||||
musicService.login.mockResolvedValue(musicLibrary);
|
musicService.login.mockResolvedValue(musicLibrary);
|
||||||
musicLibrary.stream.mockResolvedValue(stream);
|
musicLibrary.stream.mockResolvedValue(stream);
|
||||||
|
musicLibrary.nowPlaying.mockResolvedValue(true);
|
||||||
|
|
||||||
const res = await request(server)
|
const res = await request(server)
|
||||||
.get(
|
.get(
|
||||||
@@ -1105,6 +1118,7 @@ describe("server", () => {
|
|||||||
);
|
);
|
||||||
|
|
||||||
expect(musicService.login).toHaveBeenCalledWith(authToken);
|
expect(musicService.login).toHaveBeenCalledWith(authToken);
|
||||||
|
expect(musicLibrary.nowPlaying).toHaveBeenCalledWith(trackId);
|
||||||
expect(musicLibrary.stream).toHaveBeenCalledWith({
|
expect(musicLibrary.stream).toHaveBeenCalledWith({
|
||||||
trackId,
|
trackId,
|
||||||
range: "4000-5000",
|
range: "4000-5000",
|
||||||
|
|||||||
@@ -3071,11 +3071,9 @@ describe("api", () => {
|
|||||||
function itShouldScroble({
|
function itShouldScroble({
|
||||||
trackId,
|
trackId,
|
||||||
secondsPlayed,
|
secondsPlayed,
|
||||||
shouldMarkNowPlaying,
|
|
||||||
}: {
|
}: {
|
||||||
trackId: string;
|
trackId: string;
|
||||||
secondsPlayed: number;
|
secondsPlayed: number;
|
||||||
shouldMarkNowPlaying: boolean;
|
|
||||||
}) {
|
}) {
|
||||||
it("should scrobble", async () => {
|
it("should scrobble", async () => {
|
||||||
musicLibrary.scrobble.mockResolvedValue(true);
|
musicLibrary.scrobble.mockResolvedValue(true);
|
||||||
@@ -3090,22 +3088,15 @@ describe("api", () => {
|
|||||||
expect(accessTokens.mint).toHaveBeenCalledWith(authToken);
|
expect(accessTokens.mint).toHaveBeenCalledWith(authToken);
|
||||||
expect(musicLibrary.track).toHaveBeenCalledWith(trackId);
|
expect(musicLibrary.track).toHaveBeenCalledWith(trackId);
|
||||||
expect(musicLibrary.scrobble).toHaveBeenCalledWith(trackId);
|
expect(musicLibrary.scrobble).toHaveBeenCalledWith(trackId);
|
||||||
if (shouldMarkNowPlaying) {
|
|
||||||
expect(musicLibrary.nowPlaying).toHaveBeenCalledWith(trackId);
|
|
||||||
} else {
|
|
||||||
expect(musicLibrary.nowPlaying).not.toHaveBeenCalled();
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function itShouldNotScroble({
|
function itShouldNotScroble({
|
||||||
trackId,
|
trackId,
|
||||||
secondsPlayed,
|
secondsPlayed,
|
||||||
shouldMarkNowPlaying,
|
|
||||||
}: {
|
}: {
|
||||||
trackId: string;
|
trackId: string;
|
||||||
secondsPlayed: number;
|
secondsPlayed: number;
|
||||||
shouldMarkNowPlaying: boolean;
|
|
||||||
}) {
|
}) {
|
||||||
it("should scrobble", async () => {
|
it("should scrobble", async () => {
|
||||||
const result = await ws.setPlayedSecondsAsync({
|
const result = await ws.setPlayedSecondsAsync({
|
||||||
@@ -3118,11 +3109,6 @@ describe("api", () => {
|
|||||||
expect(accessTokens.mint).toHaveBeenCalledWith(authToken);
|
expect(accessTokens.mint).toHaveBeenCalledWith(authToken);
|
||||||
expect(musicLibrary.track).toHaveBeenCalledWith(trackId);
|
expect(musicLibrary.track).toHaveBeenCalledWith(trackId);
|
||||||
expect(musicLibrary.scrobble).not.toHaveBeenCalled();
|
expect(musicLibrary.scrobble).not.toHaveBeenCalled();
|
||||||
if (shouldMarkNowPlaying) {
|
|
||||||
expect(musicLibrary.nowPlaying).toHaveBeenCalledWith(trackId);
|
|
||||||
} else {
|
|
||||||
expect(musicLibrary.nowPlaying).not.toHaveBeenCalled();
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3133,44 +3119,16 @@ describe("api", () => {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("when the seconds played is 30 seconds", () => {
|
describe("when the played length is 30 seconds", () => {
|
||||||
itShouldScroble({
|
itShouldScroble({ trackId, secondsPlayed: 30 });
|
||||||
trackId,
|
|
||||||
secondsPlayed: 30,
|
|
||||||
shouldMarkNowPlaying: true,
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("when the seconds played is > 30 seconds", () => {
|
describe("when the played length is > 30 seconds", () => {
|
||||||
itShouldScroble({
|
itShouldScroble({ trackId, secondsPlayed: 90 });
|
||||||
trackId,
|
|
||||||
secondsPlayed: 90,
|
|
||||||
shouldMarkNowPlaying: true,
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("when the seconds played is < 30 seconds", () => {
|
describe("when the played length is < 30 seconds", () => {
|
||||||
itShouldNotScroble({
|
itShouldNotScroble({ trackId, secondsPlayed: 29 });
|
||||||
trackId,
|
|
||||||
secondsPlayed: 29,
|
|
||||||
shouldMarkNowPlaying: true,
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
describe("when the seconds played is 1 seconds", () => {
|
|
||||||
itShouldNotScroble({
|
|
||||||
trackId,
|
|
||||||
secondsPlayed: 1,
|
|
||||||
shouldMarkNowPlaying: true,
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
describe("when the seconds played is 0 seconds", () => {
|
|
||||||
itShouldNotScroble({
|
|
||||||
trackId,
|
|
||||||
secondsPlayed: 0,
|
|
||||||
shouldMarkNowPlaying: false,
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -3181,44 +3139,16 @@ describe("api", () => {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("when the seconds played is 30 seconds", () => {
|
describe("when the played length is 30 seconds", () => {
|
||||||
itShouldScroble({
|
itShouldScroble({ trackId, secondsPlayed: 30 });
|
||||||
trackId,
|
|
||||||
secondsPlayed: 30,
|
|
||||||
shouldMarkNowPlaying: true,
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("when the seconds played is > 30 seconds", () => {
|
describe("when the played length is > 30 seconds", () => {
|
||||||
itShouldScroble({
|
itShouldScroble({ trackId, secondsPlayed: 90 });
|
||||||
trackId,
|
|
||||||
secondsPlayed: 90,
|
|
||||||
shouldMarkNowPlaying: true,
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("when the seconds played is < 30 seconds", () => {
|
describe("when the played length is < 30 seconds", () => {
|
||||||
itShouldNotScroble({
|
itShouldNotScroble({ trackId, secondsPlayed: 29 });
|
||||||
trackId,
|
|
||||||
secondsPlayed: 29,
|
|
||||||
shouldMarkNowPlaying: true,
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
describe("when the seconds played is 1 seconds", () => {
|
|
||||||
itShouldNotScroble({
|
|
||||||
trackId,
|
|
||||||
secondsPlayed: 1,
|
|
||||||
shouldMarkNowPlaying: true,
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
describe("when the seconds played is 0 seconds", () => {
|
|
||||||
itShouldNotScroble({
|
|
||||||
trackId,
|
|
||||||
secondsPlayed: 0,
|
|
||||||
shouldMarkNowPlaying: false,
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -3229,52 +3159,20 @@ describe("api", () => {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("when the seconds played is 29 seconds", () => {
|
describe("when the played length is 29 seconds", () => {
|
||||||
itShouldScroble({
|
itShouldScroble({ trackId, secondsPlayed: 30 });
|
||||||
trackId,
|
|
||||||
secondsPlayed: 30,
|
|
||||||
shouldMarkNowPlaying: true,
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("when the seconds played is > 29 seconds", () => {
|
describe("when the played length is > 29 seconds", () => {
|
||||||
itShouldScroble({
|
itShouldScroble({ trackId, secondsPlayed: 30 });
|
||||||
trackId,
|
|
||||||
secondsPlayed: 30,
|
|
||||||
shouldMarkNowPlaying: true,
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("when the seconds played is 10 seconds", () => {
|
describe("when the played length is 10 seconds", () => {
|
||||||
itShouldScroble({
|
itShouldScroble({ trackId, secondsPlayed: 10 });
|
||||||
trackId,
|
|
||||||
secondsPlayed: 10,
|
|
||||||
shouldMarkNowPlaying: true,
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("when the seconds played is < 10 seconds", () => {
|
describe("when the played length is < 10 seconds", () => {
|
||||||
itShouldNotScroble({
|
itShouldNotScroble({ trackId, secondsPlayed: 9 });
|
||||||
trackId,
|
|
||||||
secondsPlayed: 9,
|
|
||||||
shouldMarkNowPlaying: true,
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
describe("when the seconds played is 1 seconds", () => {
|
|
||||||
itShouldNotScroble({
|
|
||||||
trackId,
|
|
||||||
secondsPlayed: 1,
|
|
||||||
shouldMarkNowPlaying: true,
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
describe("when the seconds played is 0 seconds", () => {
|
|
||||||
itShouldNotScroble({
|
|
||||||
trackId,
|
|
||||||
secondsPlayed: 0,
|
|
||||||
shouldMarkNowPlaying: false,
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -3289,7 +3187,6 @@ describe("api", () => {
|
|||||||
expect(result[0]).toEqual({ setPlayedSecondsResult: null });
|
expect(result[0]).toEqual({ setPlayedSecondsResult: null });
|
||||||
expect(musicService.login).toHaveBeenCalledWith(authToken);
|
expect(musicService.login).toHaveBeenCalledWith(authToken);
|
||||||
expect(accessTokens.mint).toHaveBeenCalledWith(authToken);
|
expect(accessTokens.mint).toHaveBeenCalledWith(authToken);
|
||||||
expect(musicLibrary.nowPlaying).not.toHaveBeenCalled();
|
|
||||||
expect(musicLibrary.scrobble).not.toHaveBeenCalled();
|
expect(musicLibrary.scrobble).not.toHaveBeenCalled();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user