fix playlist reordering

+ fix mediasession handler
This commit is contained in:
Shiny Nematoda 2024-02-25 08:11:40 +00:00
parent 9094d21d2c
commit ab9ebbced0
4 changed files with 582 additions and 534 deletions

View file

@ -24,12 +24,10 @@ onMounted(() => {
new Sortable(pl.value, {
handle: '.pl-handle',
animation: 150,
onEnd: e => {
data.state.urls.splice(
e.newIndex,
0,
data.state.urls.splice(e.oldIndex, 1)[0],
);
onUpdate: ({ oldIndex, newIndex }) => {
const { urls } = data.state;
urls.splice(newIndex-1, 0, urls.splice(oldIndex-1, 1)[0]);
data.state.urls = urls;
},
});
});