From 481e62a6e0b6e3a32e620aefbaa091018d71b73f Mon Sep 17 00:00:00 2001 From: Bill Thornton Date: Mon, 30 Nov 2020 11:38:51 -0500 Subject: [PATCH] Add check that an item can be played before playing via default action --- src/components/shortcuts.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/components/shortcuts.js b/src/components/shortcuts.js index fe7bfefc90..978fa15814 100644 --- a/src/components/shortcuts.js +++ b/src/components/shortcuts.js @@ -204,11 +204,15 @@ import toast from './toast/toast'; } else if (action === 'play' || action === 'resume') { const startPositionTicks = parseInt(card.getAttribute('data-positionticks') || '0'); - playbackManager.play({ - ids: [playableItemId], - startPositionTicks: startPositionTicks, - serverId: serverId - }); + if (playbackManager.canPlay(item)) { + playbackManager.play({ + ids: [playableItemId], + startPositionTicks: startPositionTicks, + serverId: serverId + }); + } else { + console.warn('Unable to play item', item); + } } else if (action === 'queue') { if (playbackManager.isPlaying()) { playbackManager.queue({