From 41c51b8bdb9c8e9fa4a7d56f260d594739d4107e Mon Sep 17 00:00:00 2001 From: RaindropsSys Date: Mon, 30 Oct 2023 23:08:45 +0100 Subject: Updated 35 files and added 28 files (automated) --- .DS_Store | Bin 16388 -> 18436 bytes android/app/release/app-release.apk | Bin 22996167 -> 22996047 bytes android/app/release/app-release.apk.zip | Bin 8300849 -> 8300789 bytes .../dev/equestria/mist/JavaScriptExtensions.kt | 4 +- api/hasStella.php | 11 + api/lyrics.php | 22 +- app/.DS_Store | Bin 6148 -> 6148 bytes app/index.php | 538 +++++++++++++++++---- app/notes/update-0.3.0.php | 26 + app/notes/update-0.4.0.php | 26 + app/notes/update-1.0.0.php | 12 + app/ui/albums.php | 20 +- app/ui/download.php | 5 + app/ui/explore.php | 18 +- app/ui/info.php | 58 ++- app/ui/library.php | 46 ++ app/ui/listing.php | 244 ++++++---- app/ui/lyrics.php | 4 +- app/ui/modal.php | 29 ++ app/ui/navigation.php | 9 +- app/ui/player-mobile.php | 60 ++- app/ui/player.php | 99 +++- app/ui/queue.php | 4 +- app/ui/search.php | 13 +- app/ui/settings.php | 50 +- app/ui/update.php | 26 +- app/ui/welcome-dp.php | 59 +++ assets/.DS_Store | Bin 10244 -> 10244 bytes assets/dark.css | 27 +- assets/icons/back-mobile.svg | 1 + assets/icons/back.svg | 1 + assets/icons/copy.svg | 1 + assets/icons/library.svg | 1 + assets/icons/notes-mobile.svg | 1 + assets/icons/notes-navigation.svg | 1 + assets/icons/notes-normalizer.svg | 1 + assets/icons/notes-release.svg | 1 + assets/icons/stella.svg | 1 + assets/js/common.js | 4 +- assets/js/normalizer.js | 40 ++ assets/js/pako.js | 2 + assets/js/shortcuts.js | 13 +- assets/js/stella.js | 32 ++ assets/native.css | 18 +- assets/styles.css | 75 ++- desktop/.DS_Store | Bin 6148 -> 6148 bytes desktop/main.js | 15 +- includes/.DS_Store | Bin 6148 -> 6148 bytes includes/check.js | 117 +++++ includes/process.js | 21 +- includes/session.php | 16 +- includes/stella.js | 97 ++++ includes/watcher.js | 2 +- manifest.json | 4 +- normalizer/normalizer.html | 171 +++++++ normalizer/sample-a.mp3 | Bin 0 -> 37473 bytes normalizer/sample-b.mp3 | Bin 0 -> 25377 bytes normalizer/sample-c.mp3 | Bin 0 -> 26145 bytes normalizer/sample-d.mp3 | Bin 0 -> 36705 bytes normalizer/sample-e.mp3 | Bin 0 -> 49761 bytes normalizer/sample-f.mp3 | Bin 0 -> 32993 bytes normalizer/sample-g.mp3 | Bin 0 -> 53793 bytes version | 2 +- 63 files changed, 1735 insertions(+), 313 deletions(-) create mode 100644 api/hasStella.php create mode 100644 app/notes/update-0.3.0.php create mode 100644 app/notes/update-0.4.0.php create mode 100644 app/notes/update-1.0.0.php create mode 100644 app/ui/library.php create mode 100644 app/ui/welcome-dp.php create mode 100644 assets/icons/back-mobile.svg create mode 100644 assets/icons/back.svg create mode 100644 assets/icons/copy.svg create mode 100644 assets/icons/library.svg create mode 100644 assets/icons/notes-mobile.svg create mode 100644 assets/icons/notes-navigation.svg create mode 100644 assets/icons/notes-normalizer.svg create mode 100644 assets/icons/notes-release.svg create mode 100644 assets/icons/stella.svg create mode 100644 assets/js/normalizer.js create mode 100644 assets/js/pako.js create mode 100644 assets/js/stella.js create mode 100644 includes/check.js create mode 100644 includes/stella.js create mode 100755 normalizer/normalizer.html create mode 100755 normalizer/sample-a.mp3 create mode 100755 normalizer/sample-b.mp3 create mode 100755 normalizer/sample-c.mp3 create mode 100755 normalizer/sample-d.mp3 create mode 100755 normalizer/sample-e.mp3 create mode 100755 normalizer/sample-f.mp3 create mode 100755 normalizer/sample-g.mp3 diff --git a/.DS_Store b/.DS_Store index 1afbcc2..cc1b887 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/android/app/release/app-release.apk b/android/app/release/app-release.apk index 779688c..d1478d9 100644 Binary files a/android/app/release/app-release.apk and b/android/app/release/app-release.apk differ diff --git a/android/app/release/app-release.apk.zip b/android/app/release/app-release.apk.zip index d6ecb7d..089aac4 100644 Binary files a/android/app/release/app-release.apk.zip and b/android/app/release/app-release.apk.zip differ diff --git a/android/app/src/main/java/dev/equestria/mist/JavaScriptExtensions.kt b/android/app/src/main/java/dev/equestria/mist/JavaScriptExtensions.kt index 8cb1c90..62c3b03 100644 --- a/android/app/src/main/java/dev/equestria/mist/JavaScriptExtensions.kt +++ b/android/app/src/main/java/dev/equestria/mist/JavaScriptExtensions.kt @@ -89,7 +89,7 @@ class JavaScriptExtensions(originalActivity: MainActivity, private val window: W } @JavascriptInterface - fun setNotificationData(title: String, artist: String, album: String, position: Long, duration: Long, playing: Boolean, buffering: Boolean, shuffle: Boolean, repeat: Boolean) { + fun setNotificationData(title: String, artist: String, album: String, position: Long, duration: Long, playing: Boolean, buffering: Boolean) { val playbackStateBuilder = PlaybackStateCompat.Builder() val style = MediaStyle() @@ -141,7 +141,7 @@ class JavaScriptExtensions(originalActivity: MainActivity, private val window: W } override fun onSeekTo(pos: Long) { - view.post { view.evaluateJavascript("window.document.getElementById(\"player\").contentDocument.getElementById(\"player-audio\").currentTime = $pos / 1000;", null) } + view.post { view.evaluateJavascript("window.seekTo($pos / 1000);", null) } } } diff --git a/api/hasStella.php b/api/hasStella.php new file mode 100644 index 0000000..7e335b7 --- /dev/null +++ b/api/hasStella.php @@ -0,0 +1,11 @@ + true, "payload" => $data["lines"] ], JSON_PRETTY_PRINT)); +} elseif (isset($data) && str_starts_with($data["syncType"], "UNSYNCED")) { + die(json_encode([ + "synced" => false, + "payload" => implode("\n", array_map(function ($i) { + return $i["words"]; + }, $data["lines"])) + ], JSON_PRETTY_PRINT)); } $genius = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/app.json"), true)["genius"]; -$id = json_decode(file_get_contents("https://api.genius.com/search?q=" . rawurlencode($song["title"] . " " . $song["artist"]), false, stream_context_create([ +$id = array_values(array_filter(json_decode(file_get_contents("https://api.genius.com/search?q=" . rawurlencode($song["title"] . " " . $song["artist"]), false, stream_context_create([ "http" => [ "method" => "GET", "header" => "Authorization: Bearer " . $genius . "\r\n" ] -])), true)["response"]["hits"][0]["result"]["id"]; +])), true)["response"]["hits"], function ($i) { + return !str_contains(strtolower($i["result"]["artist_names"]), "genius"); +}))[0]["result"]["id"]; $data = []; exec('bash -c "cd /opt/spotify/spotify-lyrics-api; python genius.py ' . $id . '"', $data); $data = array_slice(array_map(function ($i) { if (str_ends_with($i, "1Embed")) { return substr($i, 0, -6); + } elseif (str_ends_with($i, "2Embed")) { + return substr($i, 0, -6); + } elseif (str_ends_with($i, "Embed")) { + return substr($i, 0, -5); } else { return $i; } @@ -48,7 +62,7 @@ $data = array_slice(array_map(function ($i) { if (count($data) > 0) { die(json_encode([ "synced" => false, - "payload" => implode("\n", $data) + "payload" => str_replace("You might also like", "", str_replace("You might also like\n", "", trim(implode("\n", $data)))) ], JSON_PRETTY_PRINT)); } diff --git a/app/.DS_Store b/app/.DS_Store index 1848aaa..3c6d6b1 100644 Binary files a/app/.DS_Store and b/app/.DS_Store differ diff --git a/app/index.php b/app/index.php index 3dc4b44..6989866 100644 --- a/app/index.php +++ b/app/index.php @@ -15,6 +15,9 @@ require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.php"; global $_PROFI + + + @@ -30,10 +33,16 @@ require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.php"; global $_PROFI } -class="web"> +class="web"class="native">
- Initializing... + Mist + +
+ + @@ -52,12 +69,42 @@ require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.php"; global $_PROFI +
+ + - - + +
+
+
+ Back +
+
Albums
+
+ +
+
+

-

Albums

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, " "))); document.getElementById("search-results").innerHTML = ""; for (let result of results) { - document.getElementById("search-results").innerHTML += document.getElementById(result.item.id).outerHTML; + document.getElementById("search-results").innerHTML += document.getElementById(result.id).outerHTML; } } else { document.getElementById("search-results").style.display = "none"; diff --git a/app/ui/download.php b/app/ui/download.php index 13f76b0..dad8eef 100644 --- a/app/ui/download.php +++ b/app/ui/download.php @@ -58,6 +58,11 @@ function getSize($bytes) {
diff --git a/app/ui/explore.php b/app/ui/explore.php index 7edfdf1..c93beff 100644 --- a/app/ui/explore.php +++ b/app/ui/explore.php @@ -11,7 +11,7 @@ - explore + Explore @@ -21,13 +21,23 @@ - + +
+
+
+ Back +
+
Explore
+
+ +
+
+

-

Explore

-
+
diff --git a/app/ui/info.php b/app/ui/info.php index fd4fad5..d21e431 100644 --- a/app/ui/info.php +++ b/app/ui/info.php @@ -1,4 +1,4 @@ - Mist Stella - No + + + + Yes (#, Version ) + + No + + Copyright @@ -172,7 +187,20 @@ function getChannelConfiguration($c) { File size (AAC-LC) + + File size (Stella) + + + + + - + + + + +
+ favoriteSong('');" id="btn-favorite-">.svg" style="pointer-events: none; filter: invert(1); width: 24px; height: 24px; margin-right: 5px;">
\ No newline at end of file diff --git a/app/ui/library.php b/app/ui/library.php new file mode 100644 index 0000000..c6b5658 --- /dev/null +++ b/app/ui/library.php @@ -0,0 +1,46 @@ + + + + + + + + + Library + + + + + + + + + + + + + + +

+ + \ No newline at end of file diff --git a/app/ui/listing.php b/app/ui/listing.php index 9ad227f..d32525b 100644 --- a/app/ui/listing.php +++ b/app/ui/listing.php @@ -50,7 +50,15 @@ if (!$presetList) { - listing + + <?php if (isset($favoritesList) && !$hasAlbum): ?> + Favorites + <?php elseif ($hasAlbum): ?> + <?= $albums[$_GET["a"]]["title"] ?> + <?php else: ?> + Songs + <?php endif; ?> + @@ -60,130 +68,156 @@ if (!$presetList) { - + +
+
+
+ Back +
+
Songs
+ +
+ +
+ +
+
-
-
-
- -

Songs

- -
- -
-

Favorites

-

-
- Click on the heart icon near a song to add it to this list. -
-
-
- " onclick="window.parent.playSong('', 'favorites');" style="width: 100px;">Play - " style="width: 100px;" onclick="window.parent.shuffleList('favorites');">Shuffle - +
+
+ +
+ + - -
- .jpg" style="height: 20vw; width: 20vw; border-radius: .75vw;"> -
-

-

-
+
+ +
+ .jpg" style="height: 20vw; width: 20vw; border-radius: .75vw;"> +
+

+

+
+ 0): ?> - - · Hi-Res Lossless - -
-
-
class="nolibrary"> - - ');" style="width: 100px;">Play - ');">Shuffle - - Add to library - + · + + Hi-Res Lossless + · + + Mist Stella +
-
- - - - -
-
- -

Add music to your library

-

Browse millions of songs and collect your favorites here.

-
Browse Mist
+
- - -
- - +
+ + + + +
+
+ +

Add music to your library

+

Browse millions of songs and collect your favorites here.

+
Browse Mist
+
+
+ +
+ +
- + } + -

-
+

\ No newline at end of file diff --git a/app/ui/lyrics.php b/app/ui/lyrics.php index bd24832..8f50931 100644 --- a/app/ui/lyrics.php +++ b/app/ui/lyrics.php @@ -43,7 +43,7 @@ } - +
@@ -112,6 +112,7 @@ document.getElementById("loading").style.display = "none"; document.getElementById("not-playing").style.display = "none"; + document.getElementById("lyrics-synced").style.top = "0px"; document.getElementById("lyrics-synced").innerHTML = "
" + window.lyrics[lastID].payload.map(i => `
${i.words}
`).join("") + "
"; @@ -123,6 +124,7 @@ document.getElementById("loading").style.display = "none"; document.getElementById("not-playing").style.display = "none"; + document.getElementById("lyrics-unsynced").scrollTop = false; document.getElementById("lyrics-unsynced").innerText = window.lyrics[lastID].payload.replaceAll("\n\n\n", "\n"); } } else { diff --git a/app/ui/modal.php b/app/ui/modal.php index b8f1cfb..ec3e663 100644 --- a/app/ui/modal.php +++ b/app/ui/modal.php @@ -45,5 +45,34 @@ window.parent.document.getElementById("modal").style.display = "none"; }); + + + + \ No newline at end of file diff --git a/app/ui/navigation.php b/app/ui/navigation.php index 9344791..dacaa94 100644 --- a/app/ui/navigation.php +++ b/app/ui/navigation.php @@ -39,13 +39,16 @@ -