mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-16 20:52:06 +00:00
Merge pull request #1052 from Araxeus/fix-lyrics-bugs
[lyrics-genius] Fix lyrics not showing up or showing up when they shouldn't
This commit is contained in:
@ -22,7 +22,7 @@ const fetchFromGenius = async (metadata) => {
|
|||||||
metadata.title
|
metadata.title
|
||||||
)}`;
|
)}`;
|
||||||
let response = await fetch(
|
let response = await fetch(
|
||||||
`https://genius.com/api/search/multi?per_page=5&q=${encodeURI(queryString)}`
|
`https://genius.com/api/search/multi?per_page=5&q=${encodeURIComponent(queryString)}`
|
||||||
);
|
);
|
||||||
if (!response.ok) {
|
if (!response.ok) {
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
@ -2,7 +2,7 @@ const { ipcRenderer } = require("electron");
|
|||||||
const is = require("electron-is");
|
const is = require("electron-is");
|
||||||
|
|
||||||
module.exports = () => {
|
module.exports = () => {
|
||||||
ipcRenderer.on("update-song-info", (_, extractedSongInfo) => {
|
ipcRenderer.on("update-song-info", (_, extractedSongInfo) => setTimeout(() => {
|
||||||
const tabList = document.querySelectorAll("tp-yt-paper-tab");
|
const tabList = document.querySelectorAll("tp-yt-paper-tab");
|
||||||
const tabs = {
|
const tabs = {
|
||||||
upNext: tabList[0],
|
upNext: tabList[0],
|
||||||
@ -90,5 +90,5 @@ module.exports = () => {
|
|||||||
tabs.lyrics.removeAttribute("disabled");
|
tabs.lyrics.removeAttribute("disabled");
|
||||||
tabs.lyrics.removeAttribute("aria-disabled");
|
tabs.lyrics.removeAttribute("aria-disabled");
|
||||||
}
|
}
|
||||||
});
|
}, 500));
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user