summaryrefslogtreecommitdiff
path: root/app/ui/listing.php
diff options
context:
space:
mode:
authorRaindropsSys <raindrops@equestria.dev>2023-11-29 22:27:20 +0100
committerRaindropsSys <raindrops@equestria.dev>2023-11-29 22:27:20 +0100
commit747d8f88d5a635ba68b3f6288fb8d1f3fe48f83d (patch)
tree66101947d417a29099b1be462ec3029a7a092657 /app/ui/listing.php
parent6f6a92041aae1577a963af9c3a31b46950e15f40 (diff)
downloadmist-747d8f88d5a635ba68b3f6288fb8d1f3fe48f83d.tar.gz
mist-747d8f88d5a635ba68b3f6288fb8d1f3fe48f83d.tar.bz2
mist-747d8f88d5a635ba68b3f6288fb8d1f3fe48f83d.zip
Updated 19 files, added 5 files and deleted app/studio.php (automated)
Diffstat (limited to 'app/ui/listing.php')
-rw-r--r--app/ui/listing.php27
1 files changed, 23 insertions, 4 deletions
diff --git a/app/ui/listing.php b/app/ui/listing.php
index 29a1bce..fdef674 100644
--- a/app/ui/listing.php
+++ b/app/ui/listing.php
@@ -37,9 +37,9 @@ if (!$presetList) {
}
}
-if (!isset($onlyStella)) $onlyStella = false;
+if (!isset($onlyStella)) $onlyStella = 0;
-if ($onlyStella) {
+if ($onlyStella === 1) {
$hasAlbum = false;
$list = $songs;
@@ -56,6 +56,23 @@ if ($onlyStella) {
$list = array_filter($list, function ($i) {
return file_exists($_SERVER['DOCUMENT_ROOT'] . "/assets/content/" . $i . ".stella");
}, ARRAY_FILTER_USE_KEY);
+} elseif ($onlyStella === 2) {
+ $hasAlbum = false;
+ $list = $songs;
+
+ foreach ($albums as $id => $album) {
+ foreach ($album["tracks"] as $track) {
+ $list[$track]["_albumID"] = $id;
+ }
+ }
+
+ uasort($list, function ($a, $b) {
+ return strcmp($a["title"], $b["title"]);
+ });
+
+ $list = array_filter($list, function ($i) {
+ return file_exists($_SERVER['DOCUMENT_ROOT'] . "/assets/content/" . $i . ".webm");
+ }, ARRAY_FILTER_USE_KEY);
}
?>
@@ -76,8 +93,10 @@ if ($onlyStella) {
Favorites
<?php elseif ($hasAlbum): ?>
<?= $albums[$_GET["a"]]["title"] ?>
- <?php elseif ($onlyStella): ?>
+ <?php elseif ($onlyStella === 1): ?>
Mist Stella
+ <?php elseif ($onlyStella === 2): ?>
+ Music videos
<?php else: ?>
Songs
<?php endif; ?>
@@ -97,7 +116,7 @@ if ($onlyStella) {
<div id="ui-back-button" onclick="history.back();" style="display: flex; align-items: center; justify-content: center; text-align: center;<?php if (!$hasAlbum): ?>pointer-events: none; opacity: 0;<?php endif; ?>">
<img src="/assets/icons/back.svg" alt="Back" class="icon">
</div>
- <div style="display: flex; align-items: center; justify-content: center; text-align: center;"><b><?php if (!$hasAlbum && !isset($favoritesList) && !$onlyStella): ?>Songs<?php elseif ($onlyStella): ?>Mist Stella<?php endif; ?></b></div>
+ <div style="display: flex; align-items: center; justify-content: center; text-align: center;"><b><?php if (!$hasAlbum && !isset($favoritesList) && $onlyStella === 0): ?>Songs<?php elseif ($onlyStella === 1): ?>Mist Stella<?php elseif ($onlyStella === 2): ?>Music videos<?php endif; ?></b></div>
<?php if (!$hasAlbum): ?>
<div>
<input placeholder="Filter" id="filter" class="form-control" style="width: 256px;height: 32px;border-top: none;" onchange="updateFilter();" onkeyup="updateFilter();">