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:
th-ch
2023-03-08 21:12:25 +01:00
committed by GitHub
2 changed files with 3 additions and 3 deletions

View File

@ -22,7 +22,7 @@ const fetchFromGenius = async (metadata) => {
metadata.title
)}`;
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) {
return null;

View File

@ -2,7 +2,7 @@ const { ipcRenderer } = require("electron");
const is = require("electron-is");
module.exports = () => {
ipcRenderer.on("update-song-info", (_, extractedSongInfo) => {
ipcRenderer.on("update-song-info", (_, extractedSongInfo) => setTimeout(() => {
const tabList = document.querySelectorAll("tp-yt-paper-tab");
const tabs = {
upNext: tabList[0],
@ -90,5 +90,5 @@ module.exports = () => {
tabs.lyrics.removeAttribute("disabled");
tabs.lyrics.removeAttribute("aria-disabled");
}
});
}, 500));
};