Skip to content

Commit

Permalink
feat: womp womp
Browse files Browse the repository at this point in the history
  • Loading branch information
cryptofyre committed Aug 3, 2024
1 parent 555ba74 commit cacbe46
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/sh.cider.streamdeck.sdPlugin/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,15 @@ async function checkAuthKey() {
}
try {
const data = await comRPC("GET", "active", true);
if (data.error) {
if (data.error || undefined || null) {
alertContexts();
$SD.getGlobalSettings();
} else {
startWebSocket();
}
} catch (error) {
alertContexts();
$SD.getGlobalSettings();
}
}

Expand Down Expand Up @@ -144,7 +146,8 @@ function startWebSocket() {
CiderApp.onerror = () => setTimeout(checkAuthKey, 5000);

} catch (error) {
setTimeout(startWebSocket, 5000);
// Retry connection on failure.
$SD.getGlobalSettings();
}
}

Expand Down Expand Up @@ -178,7 +181,7 @@ async function setAdaptiveData({ inLibrary, inFavorites }) {
async function setData({ state, attributes }) {
setPlaybackStatus(state);

const artwork = attributes.artwork?.url?.replace('{w}', attributes.artwork.width).replace('{h}', attributes.artwork.height);
const artwork = attributes.artwork?.url?.replace('{w}', attributes?.artwork?.width).replace('{h}', attributes?.artwork?.height);
const songName = attributes.name;
const artistName = attributes.artistName;
const albumName = attributes.albumName;
Expand Down

0 comments on commit cacbe46

Please sign in to comment.