mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-11 10:31:47 +00:00
fix(download): Crashes due to genius-lyrics feature
This commit is contained in:
@ -55,7 +55,7 @@ const sendError = (error: Error, source?: string) => {
|
||||
const cause = error.cause ? `\n\n${String(error.cause)}` : '';
|
||||
const message = `${error.toString()}${songNameMessage}${cause}`;
|
||||
|
||||
console.error(message);
|
||||
console.error(message, error, error?.stack);
|
||||
dialog.showMessageBox({
|
||||
type: 'info',
|
||||
buttons: ['OK'],
|
||||
|
||||
@ -78,9 +78,9 @@ const getLyricsList = async (queryString: string): Promise<string | null> => {
|
||||
*/
|
||||
const info = await response.json() as GetGeniusLyric;
|
||||
const url = info
|
||||
.response
|
||||
.sections
|
||||
.find((section) => section.type === 'song')?.hits[0].result.url;
|
||||
?.response
|
||||
?.sections
|
||||
?.find((section) => section.type === 'song')?.hits[0]?.result?.url;
|
||||
|
||||
if (url) {
|
||||
return await getLyrics(url);
|
||||
|
||||
Reference in New Issue
Block a user