mirror of
https://github.com/Dvorinka/swingmusic-extended.git
synced 2026-06-04 20:43:04 +00:00
convert track_id --> trackid
This commit is contained in:
@@ -37,7 +37,7 @@ const putCommas = (artists) => {
|
||||
|
||||
function updateNext(song_) {
|
||||
const index = state.queue.value.findIndex(
|
||||
(item) => item.track_id === song_.track_id
|
||||
(item) => item.trackid === song_.trackid
|
||||
);
|
||||
|
||||
if (index === queue.value.length - 1) {
|
||||
@@ -52,7 +52,7 @@ function updateNext(song_) {
|
||||
|
||||
function updatePrev(song) {
|
||||
const index = state.queue.value.findIndex(
|
||||
(item) => item.track_id === song.track_id
|
||||
(item) => item.trackid === song.trackid
|
||||
);
|
||||
|
||||
if (index === 0) {
|
||||
@@ -81,7 +81,7 @@ const readQueue = () => {
|
||||
};
|
||||
|
||||
const updateQueue = async (song, type) => {
|
||||
playAudio.playAudio(song.track_id);
|
||||
playAudio.playAudio(song.trackid);
|
||||
let list;
|
||||
|
||||
switch (type) {
|
||||
@@ -93,7 +93,7 @@ const updateQueue = async (song, type) => {
|
||||
break;
|
||||
}
|
||||
|
||||
if (state.queue.value[0].track_id !== list[0].track_id) {
|
||||
if (state.queue.value[0].trackid !== list[0].trackid) {
|
||||
const new_queue = list;
|
||||
localStorage.setItem("queue", JSON.stringify(new_queue));
|
||||
state.queue.value = new_queue;
|
||||
|
||||
@@ -13,11 +13,11 @@ const playing = ref(state.is_playing);
|
||||
|
||||
const url = "http://0.0.0.0:9876/file/";
|
||||
|
||||
const playAudio = (track_id) => {
|
||||
const playAudio = (trackid) => {
|
||||
const elem = document.getElementsByClassName('progress-bar')[0];
|
||||
const bottom_elem = document.getElementsByClassName('progress-bar')[1];
|
||||
|
||||
const full_path = url + encodeURIComponent(track_id);
|
||||
const full_path = url + encodeURIComponent(trackid);
|
||||
|
||||
new Promise((resolve, reject) => {
|
||||
audio.src = full_path;
|
||||
@@ -43,13 +43,13 @@ const playAudio = (track_id) => {
|
||||
};
|
||||
|
||||
function playNext() {
|
||||
playAudio(perks.next.value.track_id);
|
||||
playAudio(perks.next.value.trackid);
|
||||
perks.current.value = perks.next.value;
|
||||
media.showMediaNotif();
|
||||
}
|
||||
|
||||
function playPrev() {
|
||||
playAudio(state.prev.value.track_id);
|
||||
playAudio(state.prev.value.trackid);
|
||||
perks.current.value = perks.prev.value;
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ function seek(position) {
|
||||
|
||||
function playPause() {
|
||||
if (audio.src === "") {
|
||||
playAudio(perks.current.value.filepath);
|
||||
playAudio(perks.current.value.trackid);
|
||||
}
|
||||
|
||||
if (audio.paused) {
|
||||
|
||||
Reference in New Issue
Block a user