mirror of
https://github.com/Dvorinka/swingmusic-extended.git
synced 2026-06-05 04:53:01 +00:00
add playlist store method to reset banner position
This commit is contained in:
committed by
Mungai Njoroge
parent
ceedc22843
commit
d60acaa9ef
@@ -21,6 +21,7 @@ export default defineStore("playlist-tracks", {
|
|||||||
* @param id The id of the playlist to fetch
|
* @param id The id of the playlist to fetch
|
||||||
*/
|
*/
|
||||||
async fetchAll(id: string) {
|
async fetchAll(id: string) {
|
||||||
|
this.resetBannerPos();
|
||||||
const playlist = await getPlaylist(id);
|
const playlist = await getPlaylist(id);
|
||||||
|
|
||||||
this.info = playlist?.info || ({} as Playlist);
|
this.info = playlist?.info || ({} as Playlist);
|
||||||
@@ -43,6 +44,7 @@ export default defineStore("playlist-tracks", {
|
|||||||
this.info = info;
|
this.info = info;
|
||||||
|
|
||||||
this.info = { ...this.info, duration, count };
|
this.info = { ...this.info, duration, count };
|
||||||
|
this.bannerPos = this.info.banner_pos;
|
||||||
},
|
},
|
||||||
plusBannerPos() {
|
plusBannerPos() {
|
||||||
this.bannerPos !== 100 ? (this.bannerPos += 10) : null;
|
this.bannerPos !== 100 ? (this.bannerPos += 10) : null;
|
||||||
@@ -56,6 +58,9 @@ export default defineStore("playlist-tracks", {
|
|||||||
resetQuery() {
|
resetQuery() {
|
||||||
this.query = "";
|
this.query = "";
|
||||||
},
|
},
|
||||||
|
resetBannerPos() {
|
||||||
|
this.bannerPos = 50;
|
||||||
|
},
|
||||||
},
|
},
|
||||||
getters: {
|
getters: {
|
||||||
filteredTracks(): ComputedRef<FuseResult[]> {
|
filteredTracks(): ComputedRef<FuseResult[]> {
|
||||||
|
|||||||
Reference in New Issue
Block a user