show albums from artist at the bottom of album page

+ add a testing genres strip in album page
+ misc refactors
This commit is contained in:
geoffrey45
2022-11-24 12:01:39 +03:00
committed by Mungai Njoroge
parent da852e72f3
commit 4a49d48011
14 changed files with 211 additions and 24 deletions
+20 -1
View File
@@ -4,8 +4,12 @@ import { ComputedRef } from "vue";
import { AlbumDisc } from "./../../interfaces";
import { FuseTrackOptions } from "@/composables/enums";
import { content_width } from "@/stores/content-width";
import { getAlbumTracks } from "../../composables/fetch/album";
import {
getAlbumsFromArtist,
getAlbumTracks,
} from "../../composables/fetch/album";
import { AlbumInfo, Artist, FuseResult, Track } from "../../interfaces";
import { useNotifStore } from "../notification";
@@ -49,6 +53,7 @@ export default defineStore("album", {
info: <AlbumInfo>{},
rawTracks: <Track[]>[],
artists: <Artist[]>[],
albumArtists: <{ artist: string; albums: AlbumInfo[] }[]>[],
bio: null,
}),
actions: {
@@ -62,9 +67,23 @@ export default defineStore("album", {
this.rawTracks = album.tracks;
this.info = album.info;
},
async fetchArtistAlbums() {
const albumartist = this.info.albumartist;
const cardWidth = 8 * 16;
const visible_cards = Math.floor(content_width.value / cardWidth);
this.albumArtists = await getAlbumsFromArtist(
albumartist,
visible_cards,
this.info.albumhash
);
},
resetQuery() {
this.query = "";
},
resetAlbumArtists() {
this.albumArtists = [];
},
},
getters: {
discs(): Disc {