File tree 1 file changed +7
-4
lines changed
src/plugins/synced-lyrics/renderer/lyrics
1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -52,10 +52,13 @@ export const makeLyricsRequest = async (extractedSongInfo: SongInfo) => {
52
52
const songData : Parameters < typeof getLyricsList > [ 0 ] = {
53
53
title : `${ extractedSongInfo . title } ` ,
54
54
artist : `${ extractedSongInfo . artist } ` ,
55
- album : `${ extractedSongInfo . album } ` ,
56
55
songDuration : extractedSongInfo . songDuration ,
57
56
} ;
58
57
58
+ if ( extractedSongInfo . album ) {
59
+ songData . album = extractedSongInfo . album ;
60
+ }
61
+
59
62
let lyrics ;
60
63
try {
61
64
lyrics = await getLyricsList ( songData ) ;
@@ -78,9 +81,9 @@ export const getLyricsList = async (
78
81
track_name : songData . title ,
79
82
} ) ;
80
83
81
- query . set ( 'album_name' , songData . album ! ) ;
82
- if ( query . get ( 'album_name' ) === 'undefined' ) {
83
- query . delete ( 'album_name' ) ;
84
+
85
+ if ( songData . album ) {
86
+ query . set ( 'album_name' , songData . album ) ;
84
87
}
85
88
86
89
let url = `https://lrclib.net/api/search?${ query . toString ( ) } ` ;
You can’t perform that action at this time.
0 commit comments