🔨 Add music add
This commit is contained in:
parent
65684c2317
commit
798617bf89
@ -40,7 +40,9 @@ eventQueuStore.$subscribe((mutation, state) => {
|
|||||||
let event = eventQueuStore.shift();
|
let event = eventQueuStore.shift();
|
||||||
if (event?.uuid) {
|
if (event?.uuid) {
|
||||||
if (
|
if (
|
||||||
snacks.value.filter((value) => value.text == event?.text).length == 0
|
snacks.value.filter(
|
||||||
|
(value) => event?.type == "error" && value.text == event?.text
|
||||||
|
).length == 0
|
||||||
) {
|
) {
|
||||||
snacks.value.push({
|
snacks.value.push({
|
||||||
snack: true,
|
snack: true,
|
||||||
|
@ -145,7 +145,7 @@
|
|||||||
</v-row>
|
</v-row>
|
||||||
<v-row class="mt-2 px-lg-6 px-0">
|
<v-row class="mt-2 px-lg-6 px-0">
|
||||||
<v-col class="d-flex justify-start">
|
<v-col class="d-flex justify-start">
|
||||||
<v-menu :close-on-content-click="false">
|
<v-menu :close-on-content-click="false" v-model="urlPopup">
|
||||||
<template v-slot:activator="{ props }">
|
<template v-slot:activator="{ props }">
|
||||||
<v-btn
|
<v-btn
|
||||||
icon="mdi-plus"
|
icon="mdi-plus"
|
||||||
@ -156,30 +156,32 @@
|
|||||||
v-bind="props"
|
v-bind="props"
|
||||||
></v-btn>
|
></v-btn>
|
||||||
</template>
|
</template>
|
||||||
<v-card min-width="300" v-model="urlPopup">
|
<v-card min-width="300">
|
||||||
<v-card-content>
|
<v-card-content>
|
||||||
<v-text-field
|
<v-form @submit.prevent="add">
|
||||||
v-model="url"
|
<v-text-field
|
||||||
density="compact"
|
v-model="url"
|
||||||
variant="outlined"
|
density="compact"
|
||||||
label="Url"
|
variant="outlined"
|
||||||
hide-details="auto"
|
label="Url"
|
||||||
color="primary"
|
hide-details="auto"
|
||||||
autofocus
|
color="primary"
|
||||||
:loading="urlLoading"
|
autofocus
|
||||||
:disabled="urlLoading"
|
:loading="urlLoading"
|
||||||
>
|
:disabled="urlLoading"
|
||||||
<template v-slot:append>
|
>
|
||||||
<v-icon
|
<template v-slot:append>
|
||||||
@click="add"
|
<v-icon
|
||||||
color="primary"
|
@click="add"
|
||||||
:style="urlLoading ? '' : 'opacity: 1'"
|
color="primary"
|
||||||
:disabled="urlLoading"
|
:style="urlLoading ? '' : 'opacity: 1'"
|
||||||
>
|
:disabled="urlLoading"
|
||||||
mdi-plus-circle
|
>
|
||||||
</v-icon>
|
mdi-plus-circle
|
||||||
</template>
|
</v-icon>
|
||||||
</v-text-field>
|
</template>
|
||||||
|
</v-text-field>
|
||||||
|
</v-form>
|
||||||
</v-card-content>
|
</v-card-content>
|
||||||
</v-card>
|
</v-card>
|
||||||
</v-menu>
|
</v-menu>
|
||||||
@ -287,6 +289,7 @@ import type { Guild } from "@/data/guild/Guild";
|
|||||||
import type { Status } from "@/data/music/Status";
|
import type { Status } from "@/data/music/Status";
|
||||||
import * as audioService from "@/services/audioService";
|
import * as audioService from "@/services/audioService";
|
||||||
import { getVoiceChannels } from "@/services/guildService";
|
import { getVoiceChannels } from "@/services/guildService";
|
||||||
|
import { useEventQueuStore } from "@/stores/eventQueu";
|
||||||
import { computed } from "@vue/reactivity";
|
import { computed } from "@vue/reactivity";
|
||||||
import { ref, watch } from "vue";
|
import { ref, watch } from "vue";
|
||||||
import { onBeforeRouteLeave, onBeforeRouteUpdate } from "vue-router";
|
import { onBeforeRouteLeave, onBeforeRouteUpdate } from "vue-router";
|
||||||
@ -470,6 +473,12 @@ function add() {
|
|||||||
urlLoading.value = false;
|
urlLoading.value = false;
|
||||||
urlPopup.value = false;
|
urlPopup.value = false;
|
||||||
url.value = "";
|
url.value = "";
|
||||||
|
const eventQueuStore = useEventQueuStore();
|
||||||
|
eventQueuStore.push({
|
||||||
|
uuid: undefined,
|
||||||
|
type: "success",
|
||||||
|
text: "Track added to playlist !",
|
||||||
|
});
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
urlLoading.value = false;
|
urlLoading.value = false;
|
||||||
|
Loading…
Reference in New Issue
Block a user