mirror of
https://github.com/Dvorinka/swingmusic-extended.git
synced 2026-06-04 20:43:04 +00:00
improve nowPlaying alignment
This commit is contained in:
@@ -37,7 +37,7 @@ const putCommas = (artists) => {
|
||||
};
|
||||
|
||||
function updateNext(song_) {
|
||||
const index = state.queue.value.findIndex((item) => item.id === song_.id);
|
||||
const index = state.queue.value.findIndex((item) => item.track_id === song_.track_id);
|
||||
|
||||
if (index == queue.value.length - 1) {
|
||||
next.value = queue.value[0];
|
||||
@@ -50,7 +50,7 @@ function updateNext(song_) {
|
||||
}
|
||||
|
||||
function updatePrev(song) {
|
||||
const index = state.queue.value.findIndex((item) => item.id === song.track_id);
|
||||
const index = state.queue.value.findIndex((item) => item.track_id === song.track_id);
|
||||
|
||||
if (index == 0) {
|
||||
prev.value = queue.value[queue.value.length - 1];
|
||||
@@ -131,6 +131,7 @@ function focusSearchBox() {
|
||||
|
||||
setTimeout(() => {
|
||||
watch(current, (new_current) => {
|
||||
|
||||
media.showMediaNotif();
|
||||
|
||||
updateNext(new_current);
|
||||
|
||||
@@ -11,7 +11,6 @@ const playing = ref(state.is_playing);
|
||||
const url = "http://0.0.0.0:8901/";
|
||||
|
||||
const playAudio = (path) => {
|
||||
console.log(path)
|
||||
const elem = document.getElementById('progress')
|
||||
const full_path = url + encodeURIComponent(path);
|
||||
|
||||
@@ -42,7 +41,7 @@ function playNext() {
|
||||
}
|
||||
|
||||
function playPrev() {
|
||||
playAudio(perks.prev.value.filepath);
|
||||
playAudio(state.prev.value.filepath);
|
||||
perks.current.value = perks.prev.value;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user