Skip to content

Commit

Permalink
Search lyrics online if not found #620
Browse files Browse the repository at this point in the history
  • Loading branch information
vdesabou committed Dec 4, 2023
1 parent 0eda76a commit 88848d6
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
20 changes: 17 additions & 3 deletions spotify-mini-player/src/firstDelimiter.php
Original file line number Diff line number Diff line change
Expand Up @@ -1873,9 +1873,23 @@ function firstDelimiterLyrics($w, $query, $db, $update_in_progress) {
}
}
else {
$w->result(null, 'help', 'No lyrics found!', array('', 'alt' => '', 'cmd' => '', 'shift' => '', 'fn' => '', 'ctrl' => '',), './images/warning.png', 'no', null, '');
echo $w->tojson();
exit;
$w->result(null, serialize(array(
''
/*track_uri*/, ''
/* album_uri */, ''
/* artist_uri */, ''
/* playlist_uri */, ''
/* spotify_command */, ''
/* query */, 'Open▹' . 'https://www.musixmatch.com/search/' . urlencode($track_name) . '%20' . urlencode($artist_name) /* other_settings*/, ''
/* other_action */, ''
/* artist_name */, ''
/* track_name */, ''
/* album_name */, ''
/* track_artwork_path */, ''
/* artist_artwork_path */, ''
/* album_artwork_path */, ''
/* playlist_name */, '', /* playlist_artwork_path */
)), 'Search lyrics for ' . $track_name . ' by ' . $artist_name . ' online', 'This will open your default browser', './images/lyrics.png', 'yes', null, '');
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion spotify-mini-player/src/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -5985,7 +5985,7 @@ function displayLyricsForCurrentTrack($w)
if ($lyrics_url != false) {
exec('open '.$lyrics_url);
} else {
displayNotificationWithArtwork($w, 'No lyrics found!', './images/warning.png', 'Error!');
exec('open ' .'https://www.musixmatch.com/search/' . urlencode($results[1]) . '%20' . urlencode($results[0]));
}
}

Expand Down

0 comments on commit 88848d6

Please sign in to comment.