Repeat song on double click only if there is a previous item

This commit is contained in:
ferferga 2020-06-18 10:15:30 +02:00
parent 989c99521f
commit 0e2b960ae7
2 changed files with 2 additions and 2 deletions

View File

@ -161,7 +161,7 @@ define(['require', 'datetime', 'itemHelper', 'events', 'browser', 'imageLoader',
if (currentPlayer) { if (currentPlayer) {
if (currentPlayer.id === 'htmlaudioplayer' && (currentPlayer._currentTime <= 5 || !playbackManager.previousTrack(currentPlayer))) { if (currentPlayer.id === 'htmlaudioplayer' && (currentPlayer._currentTime <= 5 || !playbackManager.previousTrack(currentPlayer))) {
// Cancel this event if doubleclick is fired // Cancel this event if doubleclick is fired
if (e.originalEvent.detail > 1) { if (e.originalEvent.detail > 1 && playbackManager.previousTrack(currentPlayer)) {
return; return;
} }
playbackManager.seekPercent(0, currentPlayer); playbackManager.seekPercent(0, currentPlayer);

View File

@ -707,7 +707,7 @@ define(['browser', 'datetime', 'backdrop', 'libraryBrowser', 'listView', 'imageL
if (currentPlayer) { if (currentPlayer) {
if (currentPlayer.id === 'htmlaudioplayer' && (currentPlayer._currentTime <= 5 || !playbackManager.previousTrack(currentPlayer))) { if (currentPlayer.id === 'htmlaudioplayer' && (currentPlayer._currentTime <= 5 || !playbackManager.previousTrack(currentPlayer))) {
// Cancel this event if doubleclick is fired // Cancel this event if doubleclick is fired
if (e.originalEvent.detail > 1) { if (e.originalEvent.detail > 1 && playbackManager.previousTrack(currentPlayer)) {
return; return;
} }
playbackManager.seekPercent(0, currentPlayer); playbackManager.seekPercent(0, currentPlayer);