fix playing tracks from search page

This commit is contained in:
geoffrey45
2022-10-07 20:04:01 +03:00
committed by Mungai Njoroge
parent 6adf5df4c6
commit ffecfac8c7
5 changed files with 18 additions and 4 deletions
+2 -1
View File
@@ -77,12 +77,13 @@ function getSource() {
name: Routes.search, name: Routes.search,
params: { params: {
query: source.query, query: source.query,
page: "tracks",
}, },
}, },
}; };
default: default:
return { name: "👻 Ghost source", location: {} }; return { name: "👻 No source", location: {} };
} }
} }
-1
View File
@@ -5,7 +5,6 @@
class="ellip" class="ellip"
:style="{ :style="{
fontSize: small ? '0.85rem' : smaller ? 'small' : '', fontSize: small ? '0.85rem' : smaller ? 'small' : '',
padding: '0 .25rem'
}" }"
> >
<div v-if="artists === null || artists.length === 0"> <div v-if="artists === null || artists.length === 0">
+1 -1
View File
@@ -80,7 +80,7 @@ const routes = [
{ {
path: "/search/:page", path: "/search/:page",
name: "SearchView", name: "SearchView",
component: () => import("@/views/SearchView/main.vue"), component: () => import("@/views/SearchView"),
}, },
{ {
path: "/queue", path: "/queue",
+3
View File
@@ -0,0 +1,3 @@
import SearchView from "./main.vue";
export default SearchView;
+12 -1
View File
@@ -1,7 +1,11 @@
<template> <template>
<div class="search-tracks-view"> <div class="search-tracks-view">
<div class="no-scroll"> <div class="no-scroll">
<Layout :no_header="true" :tracks="search.tracks.value" /> <Layout
:no_header="true"
:tracks="search.tracks.value"
@playFromPage="playFromSearch"
/>
</div> </div>
</div> </div>
</template> </template>
@@ -9,8 +13,15 @@
<script setup lang="ts"> <script setup lang="ts">
import Layout from "@/layouts/HeaderAndVList.vue"; import Layout from "@/layouts/HeaderAndVList.vue";
import useSearchStore from "@/stores/search"; import useSearchStore from "@/stores/search";
import useQueueStore from "@/stores/queue";
const search = useSearchStore(); const search = useSearchStore();
const queue = useQueueStore();
function playFromSearch(index: number) {
queue.playFromSearch(search.query, search.tracks.value);
queue.play(index);
}
</script> </script>
<style lang="scss"> <style lang="scss">