fix playing from album bug when there's inconsistent discs

~ eg. when there's no disc 1, but there's disc 2, or 3
This commit is contained in:
geoffrey45
2022-12-24 17:26:03 +03:00
committed by Mungai Njoroge
parent 7f0fe88c43
commit c52390117e
6 changed files with 17 additions and 49 deletions
-24
View File
@@ -1,24 +0,0 @@
<template>
<div class="bottom-content">
<FeaturedArtists :artists="artists" />
<AlbumBio
:bio="bio"
:images="{ album: image, artist: artists[0]?.image }"
/>
</div>
</template>
<script setup lang="ts">
import { Artist } from "@/interfaces";
import FeaturedArtists from "@/components/PlaylistView/FeaturedArtists.vue";
import AlbumBio from "@/components/AlbumView/AlbumBio.vue";
defineProps<{
artists: Artist[];
bio: string | null;
image: string;
}>();
</script>
<style lang="scss"></style>
+2 -4
View File
@@ -11,9 +11,7 @@
<component
:is="item.component"
v-bind="item.props"
@playThis="
playFromAlbum(item.props.track.index - item.props.track.disc)
"
@playThis="playFromAlbum(item.props.track.master_index)"
/>
</div>
</RecycleScroller>
@@ -122,7 +120,7 @@ const scrollerItems = computed(() => {
function playFromAlbum(index: number) {
const { title, albumartists, albumhash } = album.info;
queue.playFromAlbum(title, albumhash, album.allTracks);
queue.playFromAlbum(title, albumhash, album.srcTracks);
queue.play(index);
}