diff options
author | RaindropsSys <raindrops@equestria.dev> | 2023-11-08 20:59:42 +0100 |
---|---|---|
committer | RaindropsSys <raindrops@equestria.dev> | 2023-11-08 20:59:42 +0100 |
commit | b83a38434156038bc02db74cb93fa8460d0f2f32 (patch) | |
tree | 5229c62153ad640f164ff3d4a837bd8345305e02 /api | |
parent | 4755889793a36a1f33282ee4759445bef1eb2bb2 (diff) | |
download | mist-b83a38434156038bc02db74cb93fa8460d0f2f32.tar.gz mist-b83a38434156038bc02db74cb93fa8460d0f2f32.tar.bz2 mist-b83a38434156038bc02db74cb93fa8460d0f2f32.zip |
Updated 16 files, added 3 files, deleted android/app/release/app-release.apk.zip and renamed android/app/release/app-release.apk (automated)
Diffstat (limited to 'api')
-rw-r--r-- | api/lyrics.php | 14 | ||||
-rw-r--r-- | api/randomFavorites.php | 8 |
2 files changed, 19 insertions, 3 deletions
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 @@ +<?php + +header("X-Frame-Options: SAMEORIGIN"); +require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.php"; +header("Content-Type: application/json"); +global $favorites; +shuffle($favorites); +die(json_encode($favorites));
\ No newline at end of file |