Display lyrics on UI if synced lyrics present in metadata (#1406)
Signed-off-by: Chirag Lulla <lullachirag239@gmail.com>
This commit is contained in:
@@ -56,6 +56,7 @@ const Player = () => {
|
|||||||
clearPriorAudioLists: false,
|
clearPriorAudioLists: false,
|
||||||
showDestroy: true,
|
showDestroy: true,
|
||||||
showDownload: false,
|
showDownload: false,
|
||||||
|
showLyric: true,
|
||||||
showReload: false,
|
showReload: false,
|
||||||
toggleMode: !isDesktop,
|
toggleMode: !isDesktop,
|
||||||
glassBg: false,
|
glassBg: false,
|
||||||
|
|||||||
@@ -23,11 +23,15 @@ const initialState = {
|
|||||||
const mapToAudioLists = (item) => {
|
const mapToAudioLists = (item) => {
|
||||||
// If item comes from a playlist, trackId is mediaFileId
|
// If item comes from a playlist, trackId is mediaFileId
|
||||||
const trackId = item.mediaFileId || item.id
|
const trackId = item.mediaFileId || item.id
|
||||||
|
const { lyrics } = item
|
||||||
|
const timestampRegex =
|
||||||
|
/(\[([0-9]{1,2}:)?([0-9]{1,2}:)([0-9]{1,2})(\.[0-9]{1,2})?\])/g
|
||||||
return {
|
return {
|
||||||
trackId,
|
trackId,
|
||||||
uuid: uuidv4(),
|
uuid: uuidv4(),
|
||||||
song: item,
|
song: item,
|
||||||
name: item.title,
|
name: item.title,
|
||||||
|
lyric: timestampRegex.test(lyrics) ? lyrics : '',
|
||||||
singer: item.artist,
|
singer: item.artist,
|
||||||
duration: item.duration,
|
duration: item.duration,
|
||||||
musicSrc: subsonic.streamUrl(trackId),
|
musicSrc: subsonic.streamUrl(trackId),
|
||||||
|
|||||||
Reference in New Issue
Block a user