From 645c2eb5b717f37ab467b15ebf60d3972abc781f Mon Sep 17 00:00:00 2001 From: jeffvli Date: Fri, 15 Jul 2022 00:03:22 -0700 Subject: [PATCH] Add unknown check for mpris track id (#251) --- CHANGELOG.md | 1 + src/main.dev.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a9b7761..cd3d681 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Fixed certain UI elements from being drag selectable (#350) (Thanks @GermanDarknes) - Fixed application occasionally being invisible due to invalid persisted window settings (#278) - Fixed spanish translation (#333) (Thanks @ami-sc) +- Fixed MPRIS Javascript error due to missing song id on Linux (#251) [0.15.2] - 2022-06-02 diff --git a/src/main.dev.js b/src/main.dev.js index fd4af7b..34e94b2 100644 --- a/src/main.dev.js +++ b/src/main.dev.js @@ -251,7 +251,7 @@ if (isLinux()) { } mprisPlayer.metadata = { - 'mpris:trackid': mprisPlayer.objectPath(`track/${arg.id?.replace('-', '')}`), + 'mpris:trackid': arg?.id ? mprisPlayer.objectPath(`track/${arg.id?.replace('-', '')}`) : '', 'mpris:length': arg.duration ? Math.round((arg.duration || 0) * 1e6) : null, 'mpris:artUrl': arg.image.includes('placeholder') ? null : arg.image, 'xesam:title': arg.title || null,