From b83a38434156038bc02db74cb93fa8460d0f2f32 Mon Sep 17 00:00:00 2001 From: RaindropsSys Date: Wed, 8 Nov 2023 20:59:42 +0100 Subject: Updated 16 files, added 3 files, deleted android/app/release/app-release.apk.zip and renamed android/app/release/app-release.apk (automated) --- api/lyrics.php | 14 +++++++++++--- api/randomFavorites.php | 8 ++++++++ 2 files changed, 19 insertions(+), 3 deletions(-) create mode 100644 api/randomFavorites.php (limited to 'api') diff --git a/api/lyrics.php b/api/lyrics.php index 11910d9..d72a17c 100644 --- a/api/lyrics.php +++ b/api/lyrics.php @@ -48,9 +48,17 @@ $id = array_values(array_filter(json_decode(file_get_contents("https://api.geniu $data = []; exec('bash -c "cd /opt/spotify/spotify-lyrics-api; python genius.py ' . $id . '"', $data); $data = array_slice(array_map(function ($i) { - if (str_ends_with($i, "1Embed")) { - return substr($i, 0, -6); - } elseif (str_ends_with($i, "2Embed")) { + if (str_ends_with($i, "1Embed") + || str_ends_with($i, "2Embed") + || str_ends_with($i, "3Embed") + || str_ends_with($i, "4Embed") + || str_ends_with($i, "5Embed") + || str_ends_with($i, "6Embed") + || str_ends_with($i, "7Embed") + || str_ends_with($i, "8Embed") + || str_ends_with($i, "9Embed") + || str_ends_with($i, "0Embed") + ) { return substr($i, 0, -6); } elseif (str_ends_with($i, "Embed")) { return substr($i, 0, -5); diff --git a/api/randomFavorites.php b/api/randomFavorites.php new file mode 100644 index 0000000..8994c6f --- /dev/null +++ b/api/randomFavorites.php @@ -0,0 +1,8 @@ +