Skip to content

Commit

Permalink
update emby API calls
Browse files Browse the repository at this point in the history
  • Loading branch information
xyxxyxxy committed Apr 28, 2024
1 parent 1ba9190 commit 53211dd
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/main/core/media-server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,12 @@ export function authenticate$(
switchMap((xEmbyAuthorization) =>
new EmbyClient({
BASE: getBaseUrl(connectionDetails)
}).userService.postUsersAuthenticatebyname(xEmbyAuthorization, {
Username: connectionDetails.username,
Pw: connectionDetails.password
}).userService.postUsersAuthenticatebyname({
xEmbyAuthorization,
requestBody: {
Username: connectionDetails.username,
Pw: connectionDetails.password
}
})
)
)
Expand All @@ -63,7 +66,7 @@ export function testConnection$(server: MediaServerConfig): Observable<SystemInf
)
}

export function logout$(server: MediaServerConfig): Observable<void> {
export function logout$(server: MediaServerConfig): Observable<unknown> {
return getAuthenticatedClient$(server).pipe(
switchMap((client) => client.sessionsService.postSessionsLogout())
)
Expand Down Expand Up @@ -139,7 +142,9 @@ export const mediaServerMainActivity$: Observable<Activity | null> = combineLate
function poll$(server: MediaServerConfig): Observable<PollingResult | null> {
return getAuthenticatedClient$(server).pipe(
// Get all sessions with now playing items.
switchMap((client) => client.sessionsService.getSessions(server.userId)),
switchMap((client) =>
client.sessionsService.getSessions({ controllableByUserId: server.userId })
),
map((sessions) => sessions.filter(isValidSession)),
// Build base activity.
map((sessions) =>
Expand Down

0 comments on commit 53211dd

Please sign in to comment.