summaryrefslogtreecommitdiff
path: root/music.php
diff options
context:
space:
mode:
authorlolcat <will@lolcat.ca>2024-02-17 23:22:19 -0500
committerlolcat <will@lolcat.ca>2024-02-17 23:22:19 -0500
commitaddc5a14a93547f630f23e5b6a79cffa2e37d71a (patch)
treea9163ba3a2e24c3c493cdde95e506c0e7e8a772d /music.php
parentedc917f5ee984160a0eef436dabd51696d675964 (diff)
boobs
Diffstat (limited to 'music.php')
-rw-r--r--music.php47
1 files changed, 28 insertions, 19 deletions
diff --git a/music.php b/music.php
index 5bc3e5f..0162d4c 100644
--- a/music.php
+++ b/music.php
@@ -15,10 +15,11 @@ $get = $frontend->parsegetfilters($_GET, $filters);
/*
Captcha
*/
-include "lib/captcha_gen.php";
-new captcha($frontend, $get, $filters, "music", true);
+include "lib/bot_protection.php";
+new bot_protection($frontend, $get, $filters, "music", true);
$payload = [
+ "timetaken" => microtime(true),
"class" => "",
"right-left" => "",
"right-right" => "",
@@ -36,7 +37,10 @@ try{
$categories = [
"song" => "",
"author" => "",
- "playlist" => ""
+ "playlist" => "",
+ "album" => "",
+ "podcast" => "",
+ "user" => ""
];
/*
@@ -48,14 +52,26 @@ if(count($results["song"]) !== 0){
$main = "song";
-}elseif(count($results["author"]) !== 0){
+}elseif(count($results["album"]) !== 0){
- $main = "author";
+ $main = "album";
}elseif(count($results["playlist"]) !== 0){
$main = "playlist";
+}elseif(count($results["podcast"]) !== 0){
+
+ $main = "podcast";
+
+}elseif(count($results["author"]) !== 0){
+
+ $main = "author";
+
+}elseif(count($results["user"]) !== 0){
+
+ $main = "user";
+
}else{
// No results found!
@@ -133,12 +149,15 @@ foreach($categories as $name => $data){
$customhtml = null;
if(
- $name == "song" &&
+ (
+ $name == "song" ||
+ $name == "podcast"
+ ) &&
$item["stream"]["endpoint"] !== null
){
$customhtml =
- '<audio src="' . $item["stream"]["endpoint"] . '?s=' . urlencode($item["stream"]["url"]) . '" controls autostart="false" preload="none">';
+ '<audio src="/audio/' . $item["stream"]["endpoint"] . '?s=' . urlencode($item["stream"]["url"]) . '" controls autostart="false" preload="none">';
}
$categories[$name] .= $frontend->drawtextresult($item, $greentext, $duration, $get["s"], $tabindex, $customhtml);
@@ -177,18 +196,8 @@ foreach($categories as $name => $value){
'<div class="answer-title">' .
'<a class="answer-title" href="?s=' . urlencode($get["s"]);
- switch($name){
-
- case "playlist":
- $payload[$write] .=
- '&type=playlist"><h2>Playlists</h2></a>';
- break;
-
- case "author":
- $payload[$write] .=
- '&type=people"><h2>Authors</h2></a>';
- break;
- }
+ $payload[$write] .=
+ '&type=' . $name . '"><h2>' . ucfirst($name) . 's</h2></a>';
$payload[$write] .=
'</div>' .