Merge branch 'develop' of https://github.com/ciderapp/Cider into develop

This commit is contained in:
vapormusic 2022-04-12 22:34:19 +07:00
commit 6deb9df6d2
11 changed files with 1065 additions and 234 deletions

View file

@ -67,7 +67,7 @@
app.showMenuPanel({
items: {
"save": {
name: "Open artwork in browser",
name: app.getLz('action.openArtworkInBrowser'),
action: () => {
window.open(app.getMediaItemArtwork(self.url, 1024, 1024))
}

View file

@ -83,6 +83,8 @@
<div v-if="categoriesReady || getCategories()">
<div>
<div class="col" v-if="categoriesView != null && categoriesView != [] && categoriesView[0].attributes != null && categoriesView[0].attributes.title != null">
<h3>{{$root.getLz('home.recentlyPlayed')}}</h3>
<mediaitem-square :kind="'385'" size="600" v-for="item in recentlyPlayed.limit(10)" :item="item" :imagesize="800"></mediaitem-square>
<h3>{{categoriesView[0].attributes.title.stringForDisplay ?? ""}}</h3>
</div>
<mediaitem-square :kind="'385'" size="600"
@ -102,6 +104,7 @@
data: function () {
return {
app: this.$root,
recentlyPlayed: [],
categoriesView: [],
categoriesReady: false,
}
@ -114,8 +117,15 @@
return false
}
},
async seeAllHistory() {
let hist = await app.mk.api.v3.music(`/v1/me/recent/played/tracks`, {
l: this.$root.mklang
})
this.recentlyPlayed = hist.data.data
},
async getCategories() {
if (this.categoriesView != [] && this.categoriesView.length > 0) { this.categoriesReady = true; return await true; } else {
await this.seeAllHistory()
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&l=${this.$root.mklang}`);
this.categoriesView = response.data.data;
console.log(this.categoriesView)