From b83a38434156038bc02db74cb93fa8460d0f2f32 Mon Sep 17 00:00:00 2001 From: RaindropsSys Date: Wed, 8 Nov 2023 20:59:42 +0100 Subject: Updated 16 files, added 3 files, deleted android/app/release/app-release.apk.zip and renamed android/app/release/app-release.apk (automated) --- .DS_Store | Bin 18436 -> 18436 bytes android/.idea/deploymentTargetDropDown.xml | 15 +- android/app/release/app-release.apk | Bin 22997059 -> 0 bytes android/app/release/app-release.apk.zip | Bin 8301290 -> 0 bytes android/app/release/app-release.apka | Bin 0 -> 23034331 bytes android/gradle/libs.versions.toml | 2 +- android/gradle/wrapper/gradle-wrapper.properties | 2 +- api/lyrics.php | 14 +- api/randomFavorites.php | 8 + app/.DS_Store | Bin 6148 -> 6148 bytes app/index.php | 300 +++++++++++++---------- app/notes/update-1.7.2.php | 12 + app/ui/listing.php | 4 +- app/ui/settings.php | 7 +- app/ui/update.php | 2 +- assets/.DS_Store | Bin 10244 -> 10244 bytes assets/icons/notes-bugs.svg | 1 + assets/styles.css | 4 - oauth/.DS_Store | Bin 6148 -> 6148 bytes oauth/callback-native/index.php | 4 +- oauth/callback/index.php | 4 +- version | 2 +- 22 files changed, 215 insertions(+), 166 deletions(-) delete mode 100644 android/app/release/app-release.apk delete mode 100644 android/app/release/app-release.apk.zip create mode 100644 android/app/release/app-release.apka create mode 100644 api/randomFavorites.php create mode 100644 app/notes/update-1.7.2.php create mode 100644 assets/icons/notes-bugs.svg diff --git a/.DS_Store b/.DS_Store index 10781c2..ef436c2 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/android/.idea/deploymentTargetDropDown.xml b/android/.idea/deploymentTargetDropDown.xml index 462cfeb..0c0c338 100644 --- a/android/.idea/deploymentTargetDropDown.xml +++ b/android/.idea/deploymentTargetDropDown.xml @@ -3,20 +3,7 @@ - - - - - - - - - - - - - - + diff --git a/android/app/release/app-release.apk b/android/app/release/app-release.apk deleted file mode 100644 index 5dc2a7d..0000000 Binary files a/android/app/release/app-release.apk and /dev/null differ diff --git a/android/app/release/app-release.apk.zip b/android/app/release/app-release.apk.zip deleted file mode 100644 index aa5811b..0000000 Binary files a/android/app/release/app-release.apk.zip and /dev/null differ diff --git a/android/app/release/app-release.apka b/android/app/release/app-release.apka new file mode 100644 index 0000000..0b3aa69 Binary files /dev/null and b/android/app/release/app-release.apka differ diff --git a/android/gradle/libs.versions.toml b/android/gradle/libs.versions.toml index fde57b9..43e3982 100644 --- a/android/gradle/libs.versions.toml +++ b/android/gradle/libs.versions.toml @@ -1,5 +1,5 @@ [versions] -agp = "8.3.0-alpha07" +agp = "8.3.0-alpha11" kotlin = "1.9.0" core-ktx = "1.10.1" junit = "4.13.2" diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties index 2ff99f2..b3f0697 100644 --- a/android/gradle/wrapper/gradle-wrapper.properties +++ b/android/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ #Fri Oct 27 08:52:38 CEST 2023 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-rc-2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/api/lyrics.php b/api/lyrics.php index 11910d9..d72a17c 100644 --- a/api/lyrics.php +++ b/api/lyrics.php @@ -48,9 +48,17 @@ $id = array_values(array_filter(json_decode(file_get_contents("https://api.geniu $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")) { + if (str_ends_with($i, "1Embed") + || str_ends_with($i, "2Embed") + || str_ends_with($i, "3Embed") + || str_ends_with($i, "4Embed") + || str_ends_with($i, "5Embed") + || str_ends_with($i, "6Embed") + || str_ends_with($i, "7Embed") + || str_ends_with($i, "8Embed") + || str_ends_with($i, "9Embed") + || str_ends_with($i, "0Embed") + ) { return substr($i, 0, -6); } elseif (str_ends_with($i, "Embed")) { return substr($i, 0, -5); diff --git a/api/randomFavorites.php b/api/randomFavorites.php new file mode 100644 index 0000000..8994c6f --- /dev/null +++ b/api/randomFavorites.php @@ -0,0 +1,8 @@ +' } + ] }; document.title = "Mist"; @@ -388,7 +391,7 @@ require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.php"; global $_PROFI function initializePlayerDocument() { playerDocument.getElementById("player-audio").ontimeupdate = playerDocument.getElementById("player-audio").onchange = playerDocument.getElementById("player-audio").onunload = playerDocument.getElementById("player-audio").onstop = () => { - updateDisplay(); + updateDisplay(false); if (playingStella) { if (playerDocument.getElementById("player-audio").paused) { @@ -466,7 +469,7 @@ require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.php"; global $_PROFI window.preloadedGainsBoosted2[window.currentSongID].connect(window.currentNormalizationContext.destination); } - updateDisplay(); + updateDisplay(false); } window.needsDurationChange = true; @@ -481,14 +484,14 @@ require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.php"; global $_PROFI playerDocument.getElementById("player-audio").onpause = () => { if (window.preloadedGains[window.currentSongID]) { try { - window.currentNormalizationSource.disconnect(window.preloadedGains[window.currentSongID]); + window.currentNormalizationSource.disconnect(); if (playingStella) { - window.currentNormalizationSource2.disconnect(window.preloadedGainsBoosted1[window.currentSongID]); - window.currentNormalizationSource3.disconnect(window.preloadedGainsBoosted2[window.currentSongID]); + window.currentNormalizationSource2.disconnect(); + window.currentNormalizationSource3.disconnect(); } - window.preloadedGains[window.currentSongID].disconnect(window.currentNormalizationContext.destination); + window.preloadedGains[window.currentSongID].disconnect(); } catch (e) { console.error(e); } @@ -501,16 +504,16 @@ require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.php"; global $_PROFI window.currentNormalizationSource5 ]) { try { - player.disconnect(window.preloadedGainsBoosted1[window.currentSongID]); - window.preloadedGainsBoosted1[window.currentSongID].disconnect(window.currentNormalizationContext.destination); + player.disconnect(); + window.preloadedGainsBoosted1[window.currentSongID].disconnect(); } catch (e) { console.error(e); } } try { - window.currentNormalizationSource1.disconnect(window.preloadedGainsBoosted2[window.currentSongID]); - window.preloadedGainsBoosted2[window.currentSongID].disconnect(window.currentNormalizationContext.destination); + window.currentNormalizationSource1.disconnect(); + window.preloadedGainsBoosted2[window.currentSongID].disconnect(); } catch (e) { console.error(e); } @@ -522,7 +525,7 @@ require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.php"; global $_PROFI return; } - updateDisplay(); + updateDisplay(false); updateAndroidNotification(); } } @@ -535,67 +538,53 @@ require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.php"; global $_PROFI } } - function updateDisplay() { - if (playerDocument.getElementById("player-audio").paused) { - document.title = "Mist"; - } else if (currentSong) { - document.title = currentSong.artist + " — " + currentSong.title; - } else { - document.title = "Mist"; - } - - if (window.discordRichPresenceData !== null && currentSong) window.discordRichPresenceData = { - largeImageKey: "https://" + location.hostname + "/albumart.php?i=" + currentSongID, - state: currentSong.title, - details: currentSong.artist, - smallImageKey: "logo", - smallImageText: "Listening on Mist", - largeImageText: currentSong.album ?? currentSong.artist - }; - - playerDocument.getElementById("info").style.display = "grid"; - playerDocument.getElementById("cover").style.display = "none"; - - if ('mediaSession' in document.getElementById("player").contentWindow.navigator) { - document.getElementById("player").contentWindow.navigator.mediaSession.playbackState = playerDocument.getElementById("player-audio").paused ? "paused" : "playing"; - let state = { - duration: isFinite(playerDocument.getElementById("player-audio").duration) ? playerDocument.getElementById("player-audio").duration : 0, - position: playerDocument.getElementById("player-audio").currentTime, - playbackRate: 1 + function updateDisplay(initial) { + if (initial) { + if (playerDocument.getElementById("player-audio").paused) { + document.title = "Mist"; + } else if (currentSong) { + document.title = currentSong.artist + " — " + currentSong.title; + } else { + document.title = "Mist"; } - document.getElementById("player").contentWindow.navigator.mediaSession.setPositionState(state); - document.getElementById("player").contentWindow.navigator.mediaSession.setActionHandler("play", () => { - playPause(); - }); - document.getElementById("player").contentWindow.navigator.mediaSession.setActionHandler("pause", () => { - playPause(); - }); - document.getElementById("player").contentWindow.navigator.mediaSession.setActionHandler("stop", () => { - stop(); - }); - document.getElementById("player").contentWindow.navigator.mediaSession.setActionHandler("seekbackward", (e) => { - let time = e.seekOffset ?? 10; + if (window.discordRichPresenceData !== null && currentSong) window.discordRichPresenceData = { + largeImageKey: "https://" + location.hostname + "/albumart.php?i=" + currentSongID, + buttons : [ + { label: 'View profile', url: 'https://mist.equestria.horse/profile/?/' } + ], + state: currentSong.title, + details: currentSong.artist, + smallImageKey: "logo", + smallImageText: "Listening on Mist", + largeImageText: currentSong.album ?? currentSong.artist + }; + + playerDocument.getElementById("info").style.display = "grid"; + playerDocument.getElementById("cover").style.display = "none"; + } - if (playerDocument.getElementById("player-audio").currentTime >= time) { - playerDocument.getElementById("player-audio").currentTime -= time; - } else { - playerDocument.getElementById("player-audio").currentTime = 0; - } + if ('mediaSession' in document.getElementById("player").contentWindow.navigator) { + if (initial) { + document.getElementById("player").contentWindow.navigator.mediaSession.playbackState = playerDocument.getElementById("player-audio").paused ? "paused" : "playing"; - if (playingStella) { - playerDocument.getElementById("player-audio-stella-side1").currentTime = playerDocument.getElementById("player-audio").currentTime; - playerDocument.getElementById("player-audio-stella-side2").currentTime = playerDocument.getElementById("player-audio").currentTime; - playerDocument.getElementById("player-audio-stella-side3").currentTime = playerDocument.getElementById("player-audio").currentTime; - playerDocument.getElementById("player-audio-stella-side4").currentTime = playerDocument.getElementById("player-audio").currentTime; - playerDocument.getElementById("player-audio-stella-side5").currentTime = playerDocument.getElementById("player-audio").currentTime; - } - }); - document.getElementById("player").contentWindow.navigator.mediaSession.setActionHandler("seekforward", (e) => { - let time = e.seekOffset ?? 10; + document.getElementById("player").contentWindow.navigator.mediaSession.setActionHandler("play", () => { + playPause(); + }); + document.getElementById("player").contentWindow.navigator.mediaSession.setActionHandler("pause", () => { + playPause(); + }); + document.getElementById("player").contentWindow.navigator.mediaSession.setActionHandler("stop", () => { + stop(); + }); + document.getElementById("player").contentWindow.navigator.mediaSession.setActionHandler("seekbackward", (e) => { + let time = e.seekOffset ?? 10; - if (playerDocument.getElementById("player-audio").currentTime + time < playerDocument.getElementById("player-audio").duration) { - playerDocument.getElementById("player-audio").currentTime += time; + if (playerDocument.getElementById("player-audio").currentTime >= time) { + playerDocument.getElementById("player-audio").currentTime -= time; + } else { + playerDocument.getElementById("player-audio").currentTime = 0; + } if (playingStella) { playerDocument.getElementById("player-audio-stella-side1").currentTime = playerDocument.getElementById("player-audio").currentTime; @@ -604,57 +593,99 @@ require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.php"; global $_PROFI playerDocument.getElementById("player-audio-stella-side4").currentTime = playerDocument.getElementById("player-audio").currentTime; playerDocument.getElementById("player-audio-stella-side5").currentTime = playerDocument.getElementById("player-audio").currentTime; } - } else { + }); + document.getElementById("player").contentWindow.navigator.mediaSession.setActionHandler("seekforward", (e) => { + let time = e.seekOffset ?? 10; + + if (playerDocument.getElementById("player-audio").currentTime + time < playerDocument.getElementById("player-audio").duration) { + playerDocument.getElementById("player-audio").currentTime += time; + + if (playingStella) { + playerDocument.getElementById("player-audio-stella-side1").currentTime = playerDocument.getElementById("player-audio").currentTime; + playerDocument.getElementById("player-audio-stella-side2").currentTime = playerDocument.getElementById("player-audio").currentTime; + playerDocument.getElementById("player-audio-stella-side3").currentTime = playerDocument.getElementById("player-audio").currentTime; + playerDocument.getElementById("player-audio-stella-side4").currentTime = playerDocument.getElementById("player-audio").currentTime; + playerDocument.getElementById("player-audio-stella-side5").currentTime = playerDocument.getElementById("player-audio").currentTime; + } + } else { + next(); + } + }); + document.getElementById("player").contentWindow.navigator.mediaSession.setActionHandler("seekto", (e) => { + if (e.seekTime) { + playerDocument.getElementById("player-audio").currentTime = e.seekTime; + + if (playingStella) { + playerDocument.getElementById("player-audio-stella-side1").currentTime = playerDocument.getElementById("player-audio").currentTime; + playerDocument.getElementById("player-audio-stella-side2").currentTime = playerDocument.getElementById("player-audio").currentTime; + playerDocument.getElementById("player-audio-stella-side3").currentTime = playerDocument.getElementById("player-audio").currentTime; + playerDocument.getElementById("player-audio-stella-side4").currentTime = playerDocument.getElementById("player-audio").currentTime; + playerDocument.getElementById("player-audio-stella-side5").currentTime = playerDocument.getElementById("player-audio").currentTime; + } + } + }); + document.getElementById("player").contentWindow.navigator.mediaSession.setActionHandler("previoustrack", () => { + if (playlist[currentPlaylistPosition - 1]) { + previous(); + } else { + playerDocument.getElementById("player-audio").currentTime = 0; + + if (playingStella) { + playerDocument.getElementById("player-audio-stella-side1").currentTime = playerDocument.getElementById("player-audio").currentTime; + playerDocument.getElementById("player-audio-stella-side2").currentTime = playerDocument.getElementById("player-audio").currentTime; + playerDocument.getElementById("player-audio-stella-side3").currentTime = playerDocument.getElementById("player-audio").currentTime; + playerDocument.getElementById("player-audio-stella-side4").currentTime = playerDocument.getElementById("player-audio").currentTime; + playerDocument.getElementById("player-audio-stella-side5").currentTime = playerDocument.getElementById("player-audio").currentTime; + } + } + }); + document.getElementById("player").contentWindow.navigator.mediaSession.setActionHandler("nexttrack", () => { next(); - } - }); - document.getElementById("player").contentWindow.navigator.mediaSession.setActionHandler("seekto", (e) => { - if (e.seekTime) { - playerDocument.getElementById("player-audio").currentTime = e.seekTime; + }); + } - if (playingStella) { - playerDocument.getElementById("player-audio-stella-side1").currentTime = playerDocument.getElementById("player-audio").currentTime; - playerDocument.getElementById("player-audio-stella-side2").currentTime = playerDocument.getElementById("player-audio").currentTime; - playerDocument.getElementById("player-audio-stella-side3").currentTime = playerDocument.getElementById("player-audio").currentTime; - playerDocument.getElementById("player-audio-stella-side4").currentTime = playerDocument.getElementById("player-audio").currentTime; - playerDocument.getElementById("player-audio-stella-side5").currentTime = playerDocument.getElementById("player-audio").currentTime; - } - } - }); - document.getElementById("player").contentWindow.navigator.mediaSession.setActionHandler("previoustrack", () => { - if (playlist[currentPlaylistPosition - 1]) { - previous(); - } else { - playerDocument.getElementById("player-audio").currentTime = 0; + let state = { + duration: isFinite(playerDocument.getElementById("player-audio").duration) ? playerDocument.getElementById("player-audio").duration : 0, + position: playerDocument.getElementById("player-audio").currentTime, + playbackRate: 1 + } + document.getElementById("player").contentWindow.navigator.mediaSession.setPositionState(state); + } - if (playingStella) { - playerDocument.getElementById("player-audio-stella-side1").currentTime = playerDocument.getElementById("player-audio").currentTime; - playerDocument.getElementById("player-audio-stella-side2").currentTime = playerDocument.getElementById("player-audio").currentTime; - playerDocument.getElementById("player-audio-stella-side3").currentTime = playerDocument.getElementById("player-audio").currentTime; - playerDocument.getElementById("player-audio-stella-side4").currentTime = playerDocument.getElementById("player-audio").currentTime; - playerDocument.getElementById("player-audio-stella-side5").currentTime = playerDocument.getElementById("player-audio").currentTime; - } - } - }); - document.getElementById("player").contentWindow.navigator.mediaSession.setActionHandler("nexttrack", () => { - next(); - }); + if (initial) { + if (currentPlaylistPosition === 0) { + playerDocument.getElementById("btn-previous").classList.add("disabled"); + playerDocumentMobile.getElementById("btn-previous").classList.add("disabled"); + } else { + playerDocument.getElementById("btn-previous").classList.remove("disabled"); + playerDocumentMobile.getElementById("btn-previous").classList.remove("disabled"); + } + + if (currentPlaylistPosition === playlist.length - 1) { + playerDocument.getElementById("btn-next").classList.add("disabled"); + playerDocumentMobile.getElementById("btn-next").classList.add("disabled"); + } else { + playerDocument.getElementById("btn-next").classList.remove("disabled"); + playerDocumentMobile.getElementById("btn-next").classList.remove("disabled"); + } } - if (currentPlaylistPosition === 0) { - playerDocument.getElementById("btn-previous").classList.add("disabled"); - playerDocumentMobile.getElementById("btn-previous").classList.add("disabled"); - } else { - playerDocument.getElementById("btn-previous").classList.remove("disabled"); - playerDocumentMobile.getElementById("btn-previous").classList.remove("disabled"); + if (initial) { + if (window.currentSong) { + playerDocument.getElementById("title").innerText = playerDocumentMobile.getElementById("title").innerText = window.currentSong.title; + playerDocument.getElementById("artist").innerText = playerDocumentMobile.getElementById("artist").innerText = window.currentSong.artist; + playerDocument.getElementById("album").innerText = playerDocumentMobile.getElementById("album").innerText = window.currentSong.album; + playerDocument.getElementById("album-art").src = playerDocumentMobile.getElementById("album-art").src = "/assets/content/" + window.currentSongID + ".jpg"; + playerDocumentMobile.getElementById("album-art-bg").style.backgroundImage = "url('/assets/content/" + window.currentSongID + ".jpg')"; + } } - if (currentPlaylistPosition === playlist.length - 1) { - playerDocument.getElementById("btn-next").classList.add("disabled"); - playerDocumentMobile.getElementById("btn-next").classList.add("disabled"); + if (document.hidden) return; + + if (isFinite(playerDocument.getElementById("player-audio").duration)) { + playerDocument.getElementById("seekbar").style.width = playerDocumentMobile.getElementById("seekbar").style.width = ((playerDocument.getElementById("player-audio").currentTime / playerDocument.getElementById("player-audio").duration) * 100) + "%"; } else { - playerDocument.getElementById("btn-next").classList.remove("disabled"); - playerDocumentMobile.getElementById("btn-next").classList.remove("disabled"); + playerDocument.getElementById("seekbar").style.width = playerDocumentMobile.getElementById("seekbar").style.width = "0"; } if (isFinite(playerDocument.getElementById("player-audio").duration)) { @@ -670,20 +701,6 @@ require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.php"; global $_PROFI } else { playerDocument.getElementById("btn-play-icon").src = playerDocumentMobile.getElementById("btn-play-icon").src = "/assets/icons/pause.svg"; } - - if (window.currentSong) { - playerDocument.getElementById("title").innerText = playerDocumentMobile.getElementById("title").innerText = window.currentSong.title; - playerDocument.getElementById("artist").innerText = playerDocumentMobile.getElementById("artist").innerText = window.currentSong.artist; - playerDocument.getElementById("album").innerText = playerDocumentMobile.getElementById("album").innerText = window.currentSong.album; - playerDocument.getElementById("album-art").src = playerDocumentMobile.getElementById("album-art").src = "/assets/content/" + window.currentSongID + ".jpg"; - playerDocumentMobile.getElementById("album-art-bg").style.backgroundImage = "url('/assets/content/" + window.currentSongID + ".jpg')"; - } - - if (isFinite(playerDocument.getElementById("player-audio").duration)) { - playerDocument.getElementById("seekbar").style.width = playerDocumentMobile.getElementById("seekbar").style.width = ((playerDocument.getElementById("player-audio").currentTime / playerDocument.getElementById("player-audio").duration) * 100) + "%"; - } else { - playerDocument.getElementById("seekbar").style.width = playerDocumentMobile.getElementById("seekbar").style.width = "0"; - } } window.playPause = () => { @@ -755,7 +772,7 @@ require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.php"; global $_PROFI window.updateRepeat = () => { if (window.currentSong) { - updateDisplay(); + updateDisplay(false); } if (window.repeat) { @@ -792,7 +809,7 @@ require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.php"; global $_PROFI window.updateShuffle = () => { if (window.currentSong) { - updateDisplay(); + updateDisplay(false); } if (window.shuffle) { @@ -815,14 +832,14 @@ require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.php"; global $_PROFI } } - window.shuffleList = (playlistID) => { + window.shuffleList = async (playlistID) => { window.shuffle = true; playerDocument.getElementById("btn-shuffle-icon").src = playerDocumentMobile.getElementById("btn-shuffle-icon").src = "/assets/icons/shuffle-on.svg"; if (playlistID) { if (playlistID === "favorites") { window.currentPlaylistID = playlistID; - window.playlist = favorites; + window.playlist = await (await fetch("/api/randomFavorites.php")).json(); } else if (playlistID.startsWith("album:")) { window.currentPlaylistID = playlistID; window.playlist = albums[playlistID.substring(6)].tracks; @@ -834,7 +851,10 @@ require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.php"; global $_PROFI window.playlist = []; } - window.playlist = shuffleArray(window.playlist); + if (playlistID && playlistID !== "favorites") { + window.playlist = shuffleArray(window.playlist); + } + window.playSong(window.playlist[0], "keep"); } @@ -866,6 +886,11 @@ require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.php"; global $_PROFI } playerDocument.getElementById("player-audio").pause(); + playerDocument.getElementById("player-audio-stella-side1").pause(); + playerDocument.getElementById("player-audio-stella-side2").pause(); + playerDocument.getElementById("player-audio-stella-side3").pause(); + playerDocument.getElementById("player-audio-stella-side4").pause(); + playerDocument.getElementById("player-audio-stella-side5").pause(); playerDocument.getElementById("player-audio").currentTime = 0; window.playingStella = false; @@ -892,7 +917,7 @@ require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.php"; global $_PROFI window.currentSong = songs[id]; window.currentSongID = id; - updateDisplay(); + updateDisplay(true); updateAndroidNotification(); if (document.getElementById("ui").contentWindow.refreshQueue) document.getElementById("ui").contentWindow.refreshQueue(); @@ -904,9 +929,9 @@ require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.php"; global $_PROFI if (stellaCompatible) { window.preloaded[id] = await Stella.build("/assets/content/" + id + ".stella"); - window.preloadedGains[id] = await normalizeAudio(window.preloaded[id].stems.other.buffer, 0); - window.preloadedGainsBoosted1[id] = await normalizeAudio(window.preloaded[id].stems.other.buffer, .05); - window.preloadedGainsBoosted2[id] = await normalizeAudio(window.preloaded[id].stems.other.buffer, .1); + window.preloadedGains[id] = await normalizeAudio(window.preloaded[id].stems.vocals.buffer, 0); + window.preloadedGainsBoosted1[id] = await normalizeAudio(window.preloaded[id].stems.vocals.buffer, .05); + window.preloadedGainsBoosted2[id] = await normalizeAudio(window.preloaded[id].stems.vocals.buffer, .1); } else { if (!window.preloaded[id]) { window.buffering = true; @@ -929,6 +954,8 @@ require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.php"; global $_PROFI preloadMore(); window.needsDurationChange = true; + if (window.currentSongID !== id) return; + if (!stellaCompatible) { if (!window.preloadedURLs[id]) { window.preloadedURLs[id] = localStorage.getItem("data-saving") ? URL.createObjectURL(window.preloadedBlobs[id]) : URL.createObjectURL(window.preloadedBlobs[id]); @@ -1098,7 +1125,10 @@ require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.php"; global $_PROFI window.discordRichPresenceData = null; } else { window.discordRichPresenceData = { - largeImageKey: "logo" + largeImageKey: "logo", + buttons : [ + { label: 'View profile', url: 'https://mist.equestria.horse/profile/?/' } + ] }; } diff --git a/app/notes/update-1.7.2.php b/app/notes/update-1.7.2.php new file mode 100644 index 0000000..ee9d110 --- /dev/null +++ b/app/notes/update-1.7.2.php @@ -0,0 +1,12 @@ + +

What's new in Mist?

+ +
+
+ +
+
Application improvements
+
We have caught and fixed numerous issues you might have encountered with the app to improve your experience.
+
+
+
\ No newline at end of file diff --git a/app/ui/listing.php b/app/ui/listing.php index 510fa58..d29b355 100644 --- a/app/ui/listing.php +++ b/app/ui/listing.php @@ -116,8 +116,8 @@ if (!$presetList) {
- " onclick="window.parent.playSong('', 'favorites');" style="width: 100px;">Play - " style="width: 100px;" onclick="window.parent.shuffleList('favorites');">Shuffle + " onclick="window.parent.playSong('', 'favorites');" style="width: 100px;">Play + " style="width: 100px;" onclick="window.parent.shuffleList('favorites');">Shuffle
diff --git a/app/ui/settings.php b/app/ui/settings.php index 3ef243d..fe421a0 100644 --- a/app/ui/settings.php +++ b/app/ui/settings.php @@ -110,7 +110,10 @@ window.parent.discordRichPresenceData = null; } else { window.parent.discordRichPresenceData = { - largeImageKey: "logo" + largeImageKey: "logo", + buttons : [ + { label: 'View profile', url: 'https://mist.equestria.horse/profile/?/' } + ] }; } } @@ -239,7 +242,6 @@ Mist version (build ) ·
© Equestria.dev
-

+

- + '); window.parent._modal.hide();">Continue
diff --git a/assets/.DS_Store b/assets/.DS_Store index 45c9d8c..1f9a269 100644 Binary files a/assets/.DS_Store and b/assets/.DS_Store differ diff --git a/assets/icons/notes-bugs.svg b/assets/icons/notes-bugs.svg new file mode 100644 index 0000000..ad79b28 --- /dev/null +++ b/assets/icons/notes-bugs.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/styles.css b/assets/styles.css index 890a13e..f661cdd 100644 --- a/assets/styles.css +++ b/assets/styles.css @@ -447,10 +447,6 @@ body.native #lyrics-page { } } -#badges { - -webkit-app-region: drag; -} - .dropdown-item:active img { filter: invert(1); } diff --git a/oauth/.DS_Store b/oauth/.DS_Store index 1333ff9..d23a8fa 100644 Binary files a/oauth/.DS_Store and b/oauth/.DS_Store differ diff --git a/oauth/callback-native/index.php b/oauth/callback-native/index.php index c289957..5095734 100644 --- a/oauth/callback-native/index.php +++ b/oauth/callback-native/index.php @@ -38,7 +38,9 @@ if (isset($result["access_token"])) { $result = $result_orig = curl_exec($crl); $result = json_decode($result, true); - if (!in_array($result["id"], $app["allowed"])) { + $isAllowed = in_array("5fe2cdf1-cff8-470e-a54a-ad1c713b0387", array_map(function ($i) { return $i["id"]; }, $result["transitiveGroups"])); + + if (!$isAllowed) { header("HTTP/1.1 403 Forbidden"); die("Not allowed to log in to this application. This will be reported."); } diff --git a/oauth/callback/index.php b/oauth/callback/index.php index bbb3322..f57e124 100644 --- a/oauth/callback/index.php +++ b/oauth/callback/index.php @@ -38,7 +38,9 @@ if (isset($result["access_token"])) { $result = $result_orig = curl_exec($crl); $result = json_decode($result, true); - if (!in_array($result["id"], $app["allowed"])) { + $isAllowed = in_array("5fe2cdf1-cff8-470e-a54a-ad1c713b0387", array_map(function ($i) { return $i["id"]; }, $result["transitiveGroups"])); + + if (!$isAllowed) { header("HTTP/1.1 403 Forbidden"); die("Not allowed to log in to this application. This will be reported."); } diff --git a/version b/version index 9dbb0c0..bbf649f 100644 --- a/version +++ b/version @@ -1 +1 @@ -1.7.0 \ No newline at end of file +1.7.3 \ No newline at end of file -- cgit