diff --git a/src/renderer/views/pages/search.ejs b/src/renderer/views/pages/search.ejs index f056ecdb..e2b69f2c 100644 --- a/src/renderer/views/pages/search.ejs +++ b/src/renderer/views/pages/search.ejs @@ -1,82 +1,97 @@ @@ -86,8 +101,10 @@ props: ['search'], data: function () { return { - app: this.$root - } + app: this.$root, + categoriesView : [], + categoriesReady : false, + } }, methods: { getTopResult() { @@ -96,6 +113,13 @@ } else { return false; } + }, + async getCategories() { + if(this.categoriesView != [] && this.categoriesView.length > 0) {this.categoriesReady = true; return await true;} else { + let response = await this.app.mk.api.v3.music(`/v1/recommendations/${this.app.mk.storefrontId}?timezone=${encodeURIComponent(this.app.formatTimezoneOffset())}&name=search-landing&platform=web&extend=editorialArtwork&art%5Burl%5D=f%2Cc&types=editorial-items%2Capple-curators%2Cactivities`); + this.categoriesView = response.data.data; + this.categoriesReady = true; + return await true;} } } })