aboutsummaryrefslogtreecommitdiff
path: root/oworadio/credits
diff options
context:
space:
mode:
authorMinteck <nekostarfan@gmail.com>2021-09-11 19:42:09 +0200
committerMinteck <nekostarfan@gmail.com>2021-09-11 19:42:09 +0200
commit2c014c29f2cf7a519152937f82ff67c0ef23d84f (patch)
tree158ce653bc4ff3edbb59ce6fbd3f9d94ef594a6a /oworadio/credits
parent067d7fa420f6f07f1a26586f293f92f7f40e3d05 (diff)
downloadmain-2c014c29f2cf7a519152937f82ff67c0ef23d84f.tar.gz
main-2c014c29f2cf7a519152937f82ff67c0ef23d84f.tar.bz2
main-2c014c29f2cf7a519152937f82ff67c0ef23d84f.zip
Commit
Diffstat (limited to 'oworadio/credits')
-rw-r--r--oworadio/credits/index.php17
1 files changed, 17 insertions, 0 deletions
diff --git a/oworadio/credits/index.php b/oworadio/credits/index.php
new file mode 100644
index 0000000..b4ce7b5
--- /dev/null
+++ b/oworadio/credits/index.php
@@ -0,0 +1,17 @@
+<?php
+
+exec("mpc -p 6601 current", $song);
+$db = json_decode(file_get_contents("/mnt/oworadio-backend/downloader/metadata/stats.json"), true);
+$id = explode(".", $song[0])[0];
+
+foreach ($db as $iid => $item) {
+ if ($item["id"] === $id) {
+ $cid = $iid;
+ }
+}
+
+if (isset($db[$cid]["title"]) && trim($db[$cid]["title"]) !== "") {
+ echo(implode(", ", $db[$cid]["artists"]) . " ยท " . $db[$cid]["title"]);
+} else {
+ echo("Unknown Song");
+} \ No newline at end of file