mirror of
https://github.com/Dvorinka/swingmusic-extended.git
synced 2026-06-04 04:23:01 +00:00
clean components
This commit is contained in:
committed by
Mungai Njoroge
parent
74ea700d93
commit
d4f54a21b4
@@ -40,11 +40,12 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { useElementSize, useVirtualList } from "@vueuse/core";
|
||||
import { computed, ref } from "vue";
|
||||
import { useElementSize, useVirtualList } from "@vueuse/core";
|
||||
|
||||
import { Track } from "@/interfaces";
|
||||
import useQStore from "@/stores/queue";
|
||||
|
||||
import SongItem from "@/components/shared/SongItem.vue";
|
||||
|
||||
const props = defineProps<{
|
||||
|
||||
@@ -14,11 +14,18 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { Track } from "@/interfaces";
|
||||
import SongList from "@/components/FolderView/SongList.vue";
|
||||
// @stores
|
||||
import useQueueStore from "@/stores/queue";
|
||||
import useAlbumStore from "@/stores/pages/album";
|
||||
|
||||
// @utils
|
||||
import { Track } from "@/interfaces";
|
||||
|
||||
// @components
|
||||
import SongList from "@/components/FolderView/SongList.vue";
|
||||
|
||||
// @setup
|
||||
|
||||
const props = defineProps<{
|
||||
discs: {
|
||||
[key: string]: Track[];
|
||||
|
||||
@@ -7,20 +7,33 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import useAStore from "@/stores/pages/album";
|
||||
// @libs
|
||||
import {
|
||||
onBeforeRouteLeave,
|
||||
onBeforeRouteUpdate,
|
||||
RouteLocationNormalized,
|
||||
} from "vue-router";
|
||||
|
||||
// @stores
|
||||
import useQueueStore from "@/stores/queue";
|
||||
import useAStore from "@/stores/pages/album";
|
||||
|
||||
// @components
|
||||
import Header from "./Header.vue";
|
||||
import Layout from "@/layouts/HeaderAndVList.vue";
|
||||
import useQueueStore from "@/stores/queue";
|
||||
|
||||
// @vars
|
||||
const album = useAStore();
|
||||
const queue = useQueueStore();
|
||||
|
||||
// @methods
|
||||
function playFromAlbum(index: number) {
|
||||
const { title, artist, hash } = album.info;
|
||||
queue.playFromAlbum(title, artist, hash, album.allTracks);
|
||||
queue.play(index);
|
||||
}
|
||||
|
||||
// @hooks
|
||||
onBeforeRouteUpdate(async (to: RouteLocationNormalized) => {
|
||||
await album
|
||||
.fetchTracksAndArtists(to.params.hash.toString())
|
||||
@@ -32,10 +45,4 @@ onBeforeRouteLeave(() => {
|
||||
album.resetQuery();
|
||||
}, 500);
|
||||
});
|
||||
|
||||
function playFromAlbum(index: number) {
|
||||
const { title, artist, hash } = album.info;
|
||||
queue.playFromAlbum(title, artist, hash, album.allTracks);
|
||||
queue.play(index);
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user