Skip to content

Commit

Permalink
fix: use address property to form connection url to adapt to new api
Browse files Browse the repository at this point in the history
  • Loading branch information
gloaysa committed Aug 23, 2024
1 parent 24b4a0d commit bb404c9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/store/library.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const getAlbums = async (
const thumbParameters = `url=${thumbUrl}&quality=90&format=png&X-Plex-Token=${player.token}`;
return {
...album,
thumb: `${player.server.uri}/photo/:/transcode?${thumbSize}&${thumbParameters}`,
thumb: `${player.address}:${player.port}/photo/:/transcode?${thumbSize}&${thumbParameters}`,
};
});
const mappedMusicLibrary: LibraryItem = {
Expand Down
6 changes: 3 additions & 3 deletions src/store/media_player.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export async function updateMediaPlayer(mediaPlayer: MediaPlayer, commandId: num
// TODO: this is ultra hacky, need to find where in the data the provider is
let thumb = isTidal
? `https://images.plex.tv/photo/?url=${thumbUrl}`
: `${mediaPlayer.server.uri}/photo/:/transcode?${thumbSize}&${thumbParameters}`;
: `https://${mediaPlayer.address}:${mediaPlayer.port}/photo/:/transcode?${thumbSize}&${thumbParameters}`;
mediaPlayer.metadata = {
...flattenMetadata(currentlyPlaying),
thumb,
Expand Down Expand Up @@ -94,7 +94,7 @@ const getPlayQueues = async (mediaPlayer: MediaPlayer): Promise<Queue | undefine
if (!mediaPlayer.containerKey) {
return undefined;
}
const response = await fetch(`${mediaPlayer.server.uri}${mediaPlayer.containerKey}`, {
const response = await fetch(`https://${mediaPlayer.address}:${mediaPlayer.port}${mediaPlayer.containerKey}`, {
headers: mediaPlayerHeaders(mediaPlayer),
method: "GET",
});
Expand All @@ -108,7 +108,7 @@ export const getLyrics = async (mediaPlayer: MediaPlayer): Promise<Lyrics | unde
if (!mediaPlayer.metadata?.Media.Part.Stream?.key) {
return undefined;
}
const baseUrl = `${mediaPlayer.server.uri}${mediaPlayer.metadata?.Media.Part.Stream?.key}`;
const baseUrl = `https://${mediaPlayer.address}:${mediaPlayer.port}${mediaPlayer.metadata?.Media.Part.Stream?.key}`;
const response = await fetch(baseUrl, {
headers: mediaPlayerHeaders(mediaPlayer),
method: "GET",
Expand Down

0 comments on commit bb404c9

Please sign in to comment.