From e61e581a2b66b0444db01d884465ea913929e343 Mon Sep 17 00:00:00 2001 From: RaindropsSys Date: Tue, 31 Oct 2023 17:04:34 +0100 Subject: Updated 27 files, added 12 files and deleted 3 files (automated) --- includes/session.php | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'includes/session.php') diff --git a/includes/session.php b/includes/session.php index e9f9f30..4bda760 100644 --- a/includes/session.php +++ b/includes/session.php @@ -29,12 +29,28 @@ if (!file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/users")) mkdir($_SERVER[ if (!file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/users/" . $_PROFILE["id"] . "-favorites.json")) file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/users/" . $_PROFILE["id"] . "-favorites.json", "[]"); if (!file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/users/" . $_PROFILE["id"] . "-library.json")) file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/users/" . $_PROFILE["id"] . "-library.json", "[]"); if (!file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/users/" . $_PROFILE["id"] . "-history.json")) file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/users/" . $_PROFILE["id"] . "-history.json", "[]"); +if (!file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/users/" . $_PROFILE["id"] . "-privacy.json")) file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/users/" . $_PROFILE["id"] . "-privacy.json", json_encode([ + "profile" => 2, + "library" => 0, + "history" => 0, + "favorites" => 0, + "custom" => 1, + "listen" => 0 +])); +if (!file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/users/" . $_PROFILE["id"] . "-profileSettings.json")) file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/users/" . $_PROFILE["id"] . "-profileSettings.json", json_encode([ + "nsfw" => false, + "description" => "", + "banner" => "" +])); +file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/users/" . $_PROFILE["id"] . "-profile.json", json_encode($_PROFILE)); $albums = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/assets/content/albums.json"), true); $songs = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/assets/content/songs.json"), true); $favorites = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/users/" . $_PROFILE["id"] . "-favorites.json"), true); $library = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/users/" . $_PROFILE["id"] . "-library.json"), true); $history = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/users/" . $_PROFILE["id"] . "-history.json"), true); +$privacy = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/users/" . $_PROFILE["id"] . "-privacy.json"), true); +$profile = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/users/" . $_PROFILE["id"] . "-profileSettings.json"), true); $albums = array_map(function ($i) { $i["artist"] = str_replace(";", ", ", $i["artist"]); @@ -111,7 +127,7 @@ function displayList($list, $hasAlbum = false) { global $albums; global $favorit } function getInfo(id) { - window.parent.openModal((window.parent.songs[id]?.artist ?? "Unknown artist") + " - " + (window.parent.songs[id]?.title ?? "Unknown song"), "info.php?i=" + id); + window.parent.openModal((window.parent.songs[id]?.artist ?? "Unknown artist") + " - " + (window.parent.songs[id]?.title ?? "Unknown song"), "info.php?i=" + id, true); } function enqueue(id) { -- cgit