mirror of
https://github.com/jeffvli/feishin.git
synced 2026-06-19 09:54:18 +02:00
catch errors on desktop scrobble notification failure (#1723)
This commit is contained in:
@@ -219,11 +219,20 @@ export const useScrobble = () => {
|
|||||||
? currentSong.artists.map((artist) => artist.name).join(' · ')
|
? currentSong.artists.map((artist) => artist.name).join(' · ')
|
||||||
: currentSong.artistName;
|
: currentSong.artistName;
|
||||||
|
|
||||||
new Notification(`${currentSong.name}`, {
|
try {
|
||||||
body: `${artists}\n${currentSong.album}`,
|
new Notification(`${currentSong.name}`, {
|
||||||
icon: imageUrlRef.current || undefined,
|
body: `${artists}\n${currentSong.album}`,
|
||||||
silent: true,
|
icon: imageUrlRef.current || undefined,
|
||||||
});
|
silent: true,
|
||||||
|
});
|
||||||
|
} catch (error) {
|
||||||
|
logFn.error('an error occurred while sending a desktop notification', {
|
||||||
|
category: LogCategory.SCROBBLE,
|
||||||
|
meta: {
|
||||||
|
error: error as Error,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}, 1000);
|
}, 1000);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user