Keyboard shortcut to go to current song (#2029)

* feat(hotkeys): keyboard-shortcut-for-current-song - #1336

Signed-off-by: Pavithra Nair <pmpavithranair@gmail.com>

* Fix previously mentioned bugs

Signed-off-by: Pavithra Nair <pmpavithranair@gmail.com>
Co-authored-by: Pavithra Nair <pmpavithranair@gmail.com>
This commit is contained in:
Robert Sammelson 2022-12-05 13:37:49 -05:00 committed by GitHub
parent cdddd4ce30
commit b5b01f78db
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 1 deletions

View File

@ -25,7 +25,9 @@ const keyHandlers = (audioInstance, playerState) => {
PREV_SONG: (e) => {
if (!e.metaKey && prevSong()) audioInstance && audioInstance.playPrev()
},
CURRENT_SONG: () => {
window.location.href = `#/album/${playerState.current?.song.albumId}/show`
},
NEXT_SONG: (e) => {
if (!e.metaKey && nextSong()) audioInstance && audioInstance.playNext()
},

View File

@ -5,6 +5,7 @@ const keyMap = {
TOGGLE_PLAY: { name: 'toggle_play', sequence: 'space', group: 'Player' },
PREV_SONG: { name: 'prev_song', sequence: 'left', group: 'Player' },
NEXT_SONG: { name: 'next_song', sequence: 'right', group: 'Player' },
CURRENT_SONG: { name: 'current_song', sequence: 'c', group: 'Player' },
VOL_UP: { name: 'vol_up', sequence: '=', group: 'Player' },
VOL_DOWN: { name: 'vol_down', sequence: '-', group: 'Player' },
...(config.enableFavourites && {

View File

@ -393,6 +393,7 @@
"toggle_play": "Play / Pause",
"prev_song": "Previous Song",
"next_song": "Next Song",
"current_song": "Current Song",
"vol_up": "Volume Up",
"vol_down": "Volume Down",
"toggle_love": "Add this track to favourites"