diff options
Diffstat (limited to 'albumart.php')
-rw-r--r-- | albumart.php | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/albumart.php b/albumart.php index c2551fd..0a7e445 100644 --- a/albumart.php +++ b/albumart.php @@ -1,11 +1,13 @@ <?php $songs = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/assets/content/songs.json"), true); +$albums = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/assets/content/albums.json"), true); -if (!isset($_GET["i"]) || !isset($songs[$_GET["i"]])) { +if (!isset($_GET["i"]) || (!isset($songs[$_GET["i"]]) && !isset($albums[$_GET["i"]]))) { die(); } +header("Cache-Control: public, max-age=604800, immutable"); header("Content-Type: image/jpeg"); header("Content-Length: " . filesize($_SERVER['DOCUMENT_ROOT'] . "/assets/content/" . $_GET["i"] . ".jpg")); readfile($_SERVER['DOCUMENT_ROOT'] . "/assets/content/" . $_GET["i"] . ".jpg");
\ No newline at end of file |