blob: b4ce7b54ca1ab29ee4a22d0e4971482ef7a4c364 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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");
}
|