mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-12 19:01:47 +00:00
synced-lyrics: make the lyrics search more reliable (#2343)
* fix: comparing multiple artists on a single track * fix: get song info on startup * chore: also split on commas * chore: re-apply .toLowerCase() on the artist names * chore: remove redundant code * chore: attempt at improving the initial videodata * oops * eureka! * stuff
This commit is contained in:
@ -200,6 +200,26 @@ export default (api: YoutubePlayer) => {
|
||||
for (const status of ['playing', 'pause'] as const) {
|
||||
video.addEventListener(status, playPausedHandlers[status]);
|
||||
}
|
||||
|
||||
if (!isNaN(video.duration)) {
|
||||
const {
|
||||
title, author,
|
||||
video_id: videoId,
|
||||
list: playlistId
|
||||
} = api.getVideoData();
|
||||
|
||||
const { playerOverlays } = api.getWatchNextResponse();
|
||||
|
||||
sendSongInfo(<VideoDataChangeValue>{
|
||||
title, author, videoId, playlistId,
|
||||
|
||||
isUpcoming: false,
|
||||
lengthSeconds: video.duration,
|
||||
loading: true,
|
||||
|
||||
uhhh: { playerOverlays }
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function sendSongInfo(videoData: VideoDataChangeValue) {
|
||||
|
||||
Reference in New Issue
Block a user