|
@@ -1,9 +1,9 @@
|
|
<script setup lang="ts">
|
|
<script setup lang="ts">
|
|
import { defineAsyncComponent, ref, computed, onMounted } from "vue";
|
|
import { defineAsyncComponent, ref, computed, onMounted } from "vue";
|
|
-import { useStore } from "vuex";
|
|
|
|
import Toast from "toasters";
|
|
import Toast from "toasters";
|
|
import { useWebsocketsStore } from "@/stores/websockets";
|
|
import { useWebsocketsStore } from "@/stores/websockets";
|
|
import { useStationStore } from "@/stores/station";
|
|
import { useStationStore } from "@/stores/station";
|
|
|
|
+import { useManageStationStore } from "@/stores/manageStation";
|
|
import useSearchYoutube from "@/composables/useSearchYoutube";
|
|
import useSearchYoutube from "@/composables/useSearchYoutube";
|
|
import useSearchMusare from "@/composables/useSearchMusare";
|
|
import useSearchMusare from "@/composables/useSearchMusare";
|
|
|
|
|
|
@@ -17,67 +17,55 @@ const PlaylistTabBase = defineAsyncComponent(
|
|
() => import("@/components/PlaylistTabBase.vue")
|
|
() => import("@/components/PlaylistTabBase.vue")
|
|
);
|
|
);
|
|
|
|
|
|
-const store = useStore();
|
|
|
|
-const { youtubeSearch, searchForSongs, loadMoreSongs } = useSearchYoutube();
|
|
|
|
-const { musareSearch, searchForMusareSongs } = useSearchMusare();
|
|
|
|
-
|
|
|
|
-const { socket } = useWebsocketsStore();
|
|
|
|
-const stationStore = useStationStore();
|
|
|
|
-
|
|
|
|
const props = defineProps({
|
|
const props = defineProps({
|
|
modalUuid: { type: String, default: "" },
|
|
modalUuid: { type: String, default: "" },
|
|
sector: { type: String, default: "station" },
|
|
sector: { type: String, default: "station" },
|
|
disableAutoRequest: { type: Boolean, default: false }
|
|
disableAutoRequest: { type: Boolean, default: false }
|
|
});
|
|
});
|
|
|
|
|
|
|
|
+const { youtubeSearch, searchForSongs, loadMoreSongs } = useSearchYoutube();
|
|
|
|
+const { musareSearch, searchForMusareSongs } = useSearchMusare();
|
|
|
|
+
|
|
|
|
+const { socket } = useWebsocketsStore();
|
|
|
|
+const stationStore = useStationStore();
|
|
|
|
+const manageStationStore = useManageStationStore(props);
|
|
|
|
+
|
|
const tab = ref("songs");
|
|
const tab = ref("songs");
|
|
const sitename = ref("Musare");
|
|
const sitename = ref("Musare");
|
|
const tabs = ref({});
|
|
const tabs = ref({});
|
|
|
|
|
|
const station = computed({
|
|
const station = computed({
|
|
get() {
|
|
get() {
|
|
- if (props.sector === "manageStation")
|
|
|
|
- return store.state.modals.manageStation[props.modalUuid].station;
|
|
|
|
|
|
+ if (props.sector === "manageStation") return manageStationStore.station;
|
|
return stationStore.station;
|
|
return stationStore.station;
|
|
},
|
|
},
|
|
- set(station) {
|
|
|
|
|
|
+ set(value) {
|
|
if (props.sector === "manageStation")
|
|
if (props.sector === "manageStation")
|
|
- store.commit(
|
|
|
|
- `modals/manageStation/${props.modalUuid}/updateStation`,
|
|
|
|
- station
|
|
|
|
- );
|
|
|
|
- else stationStore.updateStation(station);
|
|
|
|
|
|
+ manageStationStore.updateStation(value);
|
|
|
|
+ else stationStore.updateStation(value);
|
|
}
|
|
}
|
|
});
|
|
});
|
|
// const blacklist = computed({
|
|
// const blacklist = computed({
|
|
// get() {
|
|
// get() {
|
|
-// if (props.sector === "manageStation")
|
|
|
|
-// return store.state.modals.manageStation[props.modalUuid]
|
|
|
|
-// .blacklist;
|
|
|
|
|
|
+// if (props.sector === "manageStation") return manageStationStore.blacklist;
|
|
// return stationStore.blacklist;
|
|
// return stationStore.blacklist;
|
|
// },
|
|
// },
|
|
-// set(blacklist) {
|
|
|
|
|
|
+// set(value) {
|
|
// if (props.sector === "manageStation")
|
|
// if (props.sector === "manageStation")
|
|
-// store.commit(
|
|
|
|
-// `modals/manageStation/${props.modalUuid}/setBlacklist`,
|
|
|
|
-// blacklist
|
|
|
|
-// );
|
|
|
|
-// else stationStore.setBlacklist(blacklist);
|
|
|
|
|
|
+// manageStationStore.setBlacklist(value);
|
|
|
|
+// else stationStore.setBlacklist(value);
|
|
// }
|
|
// }
|
|
// });
|
|
// });
|
|
const songsList = computed({
|
|
const songsList = computed({
|
|
get() {
|
|
get() {
|
|
if (props.sector === "manageStation")
|
|
if (props.sector === "manageStation")
|
|
- return store.state.modals.manageStation[props.modalUuid].songsList;
|
|
|
|
|
|
+ return manageStationStore.songsList;
|
|
return stationStore.songsList;
|
|
return stationStore.songsList;
|
|
},
|
|
},
|
|
- set(songsList) {
|
|
|
|
|
|
+ set(value) {
|
|
if (props.sector === "manageStation")
|
|
if (props.sector === "manageStation")
|
|
- store.commit(
|
|
|
|
- `modals/manageStation/${props.modalUuid}/updateSongsList`,
|
|
|
|
- songsList
|
|
|
|
- );
|
|
|
|
- else stationStore.updateSongsList(songsList);
|
|
|
|
|
|
+ manageStationStore.updateSongsList(value);
|
|
|
|
+ else stationStore.updateSongsList(value);
|
|
}
|
|
}
|
|
});
|
|
});
|
|
const musareResultsLeftCount = computed(
|
|
const musareResultsLeftCount = computed(
|