Skip to content

Commit

Permalink
chore(Emby): fix oopsie woopsies
Browse files Browse the repository at this point in the history
  • Loading branch information
darkvillager2 committed Oct 13, 2024
1 parent 3aee37c commit 796b360
Showing 1 changed file with 12 additions and 13 deletions.
25 changes: 12 additions & 13 deletions websites/E/Emby/presence.ts
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ interface MediaInfo {

interface ServerLatest {
ManualAddress: string;
ManualAddressOnly: Boolean;
ManualAddressOnly: boolean;
IsLocalServer: true;
UserId: string;
DateLastAccessed: number;
Expand Down Expand Up @@ -391,7 +391,7 @@ function handleOfficialWebsite(): void {
*/
async function getApiClient() {
const actualData = await presence.getPageVariable("ApiClient");
return actualData["ApiClient"] as ApiClient;
return actualData.ApiClient as ApiClient;
}

/**
Expand Down Expand Up @@ -534,17 +534,16 @@ async function obtainMediaInfo(itemId: string): Promise<MediaInfo> {
}
}
const url =
`${embyBasenameURL()}emby/Users/${getUserId()}/Items/${itemId.replace(
/\//gm,
""
)}?` +
`X-Emby-Client=${ApiClient._appName.replace(/ /gm, "_")}&` +
`X-Emby-Device-Name=${ApiClient._deviceName}&` +
`X-Emby-Device-Id=${ApiClient._deviceId}&` +
`X-Emby-Client-Version=${ApiClient._appVersion}&` +
`X-Emby-Token=${accessToken}`;

const res = await fetch(url.replace(/ /gm, "_")),
`${embyBasenameURL()}emby/Users/${getUserId()}/Items/${itemId.replace(
/\//gm,
""
)}?` +
`X-Emby-Client=${ApiClient._appName.replace(/ /gm, "_")}&` +
`X-Emby-Device-Name=${ApiClient._deviceName}&` +
`X-Emby-Device-Id=${ApiClient._deviceId}&` +
`X-Emby-Client-Version=${ApiClient._appVersion}&` +
`X-Emby-Token=${accessToken}`,
res = await fetch(url.replace(/ /gm, "_")),
mediaInfo: MediaInfo = await res.json();

mediaInfoCache.set(itemId, mediaInfo);
Expand Down

0 comments on commit 796b360

Please sign in to comment.