Change playing of a track to mark nowPlaying rather than scrobble, refactor/tidy up track streaming

This commit is contained in:
simojenki
2021-06-26 18:11:26 +10:00
parent cb987aeacb
commit eec3313587
7 changed files with 418 additions and 183 deletions

View File

@@ -549,7 +549,10 @@ export class Navidrome implements MusicService {
.get(
credentials,
`/rest/stream`,
{ id: trackId, c: this.streamClientApplication(track) },
{
id: trackId,
c: this.streamClientApplication(track),
},
{
headers: pipe(
range,
@@ -628,6 +631,13 @@ export class Navidrome implements MusicService {
})
.then((_) => true)
.catch(() => false),
nowPlaying: async (id: string) =>
navidrome
.get(credentials, `/rest/scrobble`, {
id,
})
.then((_) => true)
.catch(() => false),
searchArtists: async (query: string) =>
navidrome
.search3(credentials, { query, artistCount: 20 })