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) --- app/.DS_Store | Bin 6148 -> 6148 bytes app/index.php | 52 ++++++++---- app/ui/albums.php | 2 +- app/ui/explore.php | 54 ------------ app/ui/favorites.php | 29 ++++++- app/ui/home.php | 137 ++++++++++++++++++++++++++++++ app/ui/info.php | 1 + app/ui/library.php | 2 +- app/ui/listing.php | 56 ++++++++----- app/ui/logout.php | 6 ++ app/ui/navigation.php | 4 +- app/ui/player.php | 63 +++++++++----- app/ui/search.php | 4 +- app/ui/settings.php | 226 +++++++++++++++++++++++++++++++++++++++++++++++--- app/ui/update.php | 2 +- app/ui/welcome-dp.php | 59 ------------- app/ui/welcome.php | 2 +- 17 files changed, 507 insertions(+), 192 deletions(-) delete mode 100644 app/ui/explore.php create mode 100644 app/ui/home.php create mode 100644 app/ui/logout.php delete mode 100644 app/ui/welcome-dp.php (limited to 'app') diff --git a/app/.DS_Store b/app/.DS_Store index 3c6d6b1..7889376 100644 Binary files a/app/.DS_Store and b/app/.DS_Store differ diff --git a/app/index.php b/app/index.php index 6989866..601c974 100644 --- a/app/index.php +++ b/app/index.php @@ -37,11 +37,7 @@ require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.php"; global $_PROFI - - - - Explore - - - - - - - - - - -
-
-
- Back -
-
Explore
-
- -
-
-
- -
-
- -
-
- - -
-
- -
- -

To search for content on Mist, start by typing the name of a song, artist or album. Any corresponding results will show up. Should anything you need be missing, you can contact your administrator to ask for more content to be added.

-
- -

- - \ No newline at end of file diff --git a/app/ui/favorites.php b/app/ui/favorites.php index f1ebe30..76821fd 100644 --- a/app/ui/favorites.php +++ b/app/ui/favorites.php @@ -2,13 +2,38 @@ header("X-Frame-Options: SAMEORIGIN"); require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.php"; -global $songs; global $favorites; +global $songs; global $favorites; global $_PROFILE; $hasAlbum = false; $favoritesList = true; $list = []; -foreach ($favorites as $id) { +if (!isset($_GET["u"])) { + header("Location: favorites.php?u=" . $_PROFILE["id"]); + die(); +} + +$correctFavorites = $favorites; + +if (preg_match("/[^a-f0-9-]/m", $_GET["u"]) == 0 && $_GET["u"] !== $_PROFILE["id"]) { + if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/users/" . $_GET["u"] . "-privacy.json")) { + $userPrivacy = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/users/" . $_GET["u"] . "-privacy.json"), true); + if ($userPrivacy["listen"] >= 1) { + $userId = $_GET["u"]; + $correctFavorites = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/users/" . $_GET["u"] . "-favorites.json"), true); + } else { + header("Location: favorites.php?u=" . $_PROFILE["id"]); + die(); + } + } else { + header("Location: favorites.php?u=" . $_PROFILE["id"]); + die(); + } +} else { + $userId = $_PROFILE["id"]; +} + +foreach ($correctFavorites as $id) { if (isset($songs[$id])) $list[$id] = $songs[$id]; } diff --git a/app/ui/home.php b/app/ui/home.php new file mode 100644 index 0000000..e51c790 --- /dev/null +++ b/app/ui/home.php @@ -0,0 +1,137 @@ + + + + + + + + + Home + + + + + + + + + + + + + +
+
+ + + +
+ +
+
+ +
+
+
+
+
+
+
+
+ +
+ + +
+ + + +

+ + \ No newline at end of file diff --git a/app/ui/info.php b/app/ui/info.php index d21e431..d857509 100644 --- a/app/ui/info.php +++ b/app/ui/info.php @@ -201,6 +201,7 @@ function getChannelConfiguration($c) {
favoriteSong('');" id="btn-favorite-">.svg" style="pointer-events: none; filter: invert(1); width: 24px; height: 24px; margin-right: 5px;"> + Close
diff --git a/app/ui/listing.php b/app/ui/listing.php index d32525b..510fa58 100644 --- a/app/ui/listing.php +++ b/app/ui/listing.php @@ -87,15 +87,30 @@ if (!$presetList) { + +

- +

Favorites

-

+

+ +

Click on the heart icon near a song to add it to this list.
@@ -153,7 +168,7 @@ if (!$presetList) {

Add music to your library

Browse millions of songs and collect your favorites here.

-
Browse Mist
+
Browse Mist
@@ -183,29 +198,16 @@ if (!$presetList) { } - let items = Array.from(document.getElementsByClassName("track")).map(i => { return { title: i.getAttribute("data-item-track"), artist: i.getAttribute("data-item-artist"), id: i.id } }); - - const fuse = new Fuse(items, { - keys: [ - { - name: 'title', - weight: 1 - }, - { - name: 'artist', - weight: .5 - } - ] - }); + let items = Array.from(document.getElementsByClassName("track")).map(i => { return { title: i.getAttribute("data-item-track").toLowerCase().replace(/[^a-z\d ]/mg, " ").replace(/ +/mg, " "), artist: i.getAttribute("data-item-artist").toLowerCase().replace(/[^a-z\d ]/mg, " ").replace(/ +/mg, " "), id: i.id } }); function updateFilter() { - let query = document.getElementById("filter").value.trim(); + let query = document.getElementById("filter").value.trim().toLowerCase().replace(/[^a-z\d ]/mg, " ").replace(/ +/mg, " "); if (query !== "") { document.getElementById("search-results").style.display = "flex"; document.getElementById("main-list").style.display = "none"; - let results = items.filter(i => i.title.toLowerCase().replace(/[^a-z\d ]/mg, " ").replace(/ +/mg, " ").includes(query.toLowerCase().replace(/[^a-z\d ]/mg, " ").replace(/ +/mg, " ")) || i.artist.toLowerCase().replace(/[^a-z\d ]/mg, " ").replace(/ +/mg, " ").includes(query.toLowerCase().replace(/[^a-z\d ]/mg, " ").replace(/ +/mg, " "))); + let results = items.filter(i => i.title.includes(query) || i.artist.includes(query)).slice(0, 50); document.getElementById("search-results").innerHTML = ""; for (let result of results) { @@ -216,8 +218,24 @@ if (!$presetList) { document.getElementById("main-list").style.display = "flex"; } } + + function changeView() { + location.href = "favorites.php?u=" + document.getElementById("favorites-user-select").value; + } + +

\ No newline at end of file diff --git a/app/ui/logout.php b/app/ui/logout.php new file mode 100644 index 0000000..0ea605e --- /dev/null +++ b/app/ui/logout.php @@ -0,0 +1,6 @@ + + \ No newline at end of file diff --git a/app/ui/navigation.php b/app/ui/navigation.php index dacaa94..0125418 100644 --- a/app/ui/navigation.php +++ b/app/ui/navigation.php @@ -36,8 +36,8 @@
-- cgit