summaryrefslogtreecommitdiff
path: root/api/addLibrary.php
blob: 6c0633c9d1e260560af48db51d46a2042fa277d4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
<?php

require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.php";
global $songs; global $_PROFILE; global $library;

if (!isset($_GET["i"])) return;

if (!in_array($_GET["i"], $library)) {
    $library[] = $_GET["i"];
}

file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/users/" . $_PROFILE["id"] . "-library.json", json_encode($library));