fix(navidrome): complete media server session data (#6492)
This commit is contained in:
1 parent
06d9c07d22
commit
6a3cee8107
2 files changed
+38
-18
No files matched your search
@@ -72,24 +72,32 @@ export class NavidromeIntegration extends Integration implements IMediaServerInt
|
|||||||
public async getCurrentSessionsAsync(_options: CurrentSessionsInput): Promise<StreamSession[]> {
|
public async getCurrentSessionsAsync(_options: CurrentSessionsInput): Promise<StreamSession[]> {
|
||||||
const nowPlaying = await this.getNowPlayingAsync();
|
const nowPlaying = await this.getNowPlayingAsync();
|
||||||
|
|
||||||
return nowPlaying.map((entry): StreamSession => ({
|
return nowPlaying.map(
|
||||||
sessionId: `${entry.username}-${entry.playerName}`,
|
(entry): StreamSession => ({
|
||||||
sessionName: entry.playerName,
|
sessionId: `${entry.username}-${entry.playerName}`,
|
||||||
user: {
|
sessionName: entry.playerName,
|
||||||
userId: entry.username,
|
user: {
|
||||||
username: entry.username,
|
userId: entry.username,
|
||||||
profilePictureUrl: null,
|
username: entry.username,
|
||||||
},
|
profilePictureUrl: null,
|
||||||
currentlyPlaying: {
|
},
|
||||||
type: "audio",
|
currentlyPlaying: {
|
||||||
name: entry.title,
|
type: "audio",
|
||||||
seasonName: entry.artist || undefined,
|
name: entry.title,
|
||||||
episodeName: null,
|
seasonName: entry.artist || undefined,
|
||||||
albumName: entry.album,
|
episodeName: null,
|
||||||
episodeCount: null,
|
albumName: entry.album,
|
||||||
metadata: null,
|
episodeCount: null,
|
||||||
},
|
playback: {
|
||||||
}));
|
state: null,
|
||||||
|
positionMs: null,
|
||||||
|
durationMs: null,
|
||||||
|
},
|
||||||
|
location: null,
|
||||||
|
metadata: null,
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
private async getArtistCountAsync(): Promise<number> {
|
private async getArtistCountAsync(): Promise<number> {
|
||||||
|
|||||||
@@ -257,6 +257,12 @@ describe("NavidromeIntegration.getCurrentSessionsAsync", () => {
|
|||||||
episodeName: null,
|
episodeName: null,
|
||||||
albumName: "LP",
|
albumName: "LP",
|
||||||
episodeCount: null,
|
episodeCount: null,
|
||||||
|
playback: {
|
||||||
|
state: null,
|
||||||
|
positionMs: null,
|
||||||
|
durationMs: null,
|
||||||
|
},
|
||||||
|
location: null,
|
||||||
metadata: null,
|
metadata: null,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -275,6 +281,12 @@ describe("NavidromeIntegration.getCurrentSessionsAsync", () => {
|
|||||||
episodeName: null,
|
episodeName: null,
|
||||||
albumName: "Second Album",
|
albumName: "Second Album",
|
||||||
episodeCount: null,
|
episodeCount: null,
|
||||||
|
playback: {
|
||||||
|
state: null,
|
||||||
|
positionMs: null,
|
||||||
|
durationMs: null,
|
||||||
|
},
|
||||||
|
location: null,
|
||||||
metadata: null,
|
metadata: null,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in new issue
Block a user