replaced See All text with History text next to recently played

This commit is contained in:
booploops 2022-02-10 16:29:56 -08:00
parent 379180f992
commit 54bea15925

View file

@ -8,7 +8,7 @@
<h3>{{app.getLz('home.recentlyPlayed')}}</h3>
</div>
<div class="col-auto nopadding flex-center">
<button class="cd-btn-seeall" @click="seeAllHistory()">{{app.getLz('term.seeAll')}}</button>
<button class="cd-btn-seeall" @click="seeAllHistory()">{{app.getLz('term.history')}}</button>
</div>
</div>
<div class="well artistfeed-well">
@ -72,8 +72,7 @@
</div>
<div class="well">
<vue-horizontal v-if="isSectionReady('friendsListeningTo')">
<mediaitem-square kind="small" v-for="item in friendsListeningTo"
:item="item"></mediaitem-square>
<mediaitem-square kind="small" v-for="item in friendsListeningTo" :item="item"></mediaitem-square>
</vue-horizontal>
<div class="spinner" v-else></div>
</div>
@ -86,7 +85,7 @@
<script>
Vue.component('cider-home', {
template: '#cider-home',
data: function () {
data: function() {
return {
app: this.$root,
followedArtists: this.$root.cfg.home.followedArtists,
@ -112,7 +111,9 @@
},
methods: {
async seeAllHistory() {
let hist = await app.mk.api.v3.music(`/v1/me/recent/played/tracks`, { l : this.$root.mklang})
let hist = await app.mk.api.v3.music(`/v1/me/recent/played/tracks`, {
l: this.$root.mklang
})
app.showCollection(hist.data, app.getLz('term.history'))
},
isSectionReady(section) {
@ -122,7 +123,7 @@
let self = this
return {
name: "Remove from Favorites",
action: function (item) {
action: function(item) {
let index = self.favoriteItems.findIndex(x => x.id == item.id)
if (index > -1) {
self.favoriteItems.splice(index, 1)
@ -143,12 +144,16 @@
}
}
if (playlists.length != 0) {
this.app.mk.api.v3.music(`/v1/catalog/${app.mk.storefrontId}/playlists/${playlists.toString()}`, { l : this.$root.mklang}).then(playlistsData => {
this.app.mk.api.v3.music(`/v1/catalog/${app.mk.storefrontId}/playlists/${playlists.toString()}`, {
l: this.$root.mklang
}).then(playlistsData => {
self.favorites.push(...playlistsData.data)
})
}
if (libraryPlaylists.length != 0) {
this.app.mk.api.v3.music(`v1/me/library/playlists/${playlists.toString()}`, { l : this.$root.mklang}).then(playlistsData => {
this.app.mk.api.v3.music(`v1/me/library/playlists/${playlists.toString()}`, {
l: this.$root.mklang
}).then(playlistsData => {
self.favorites.push(...playlistsData.data)
})
}
@ -185,7 +190,7 @@
return section
};
})[0].relationships.contents.data
} catch (err) { }
} catch (err) {}
self.sectionsReady.push("madeForYou")
try {
@ -195,7 +200,7 @@
return section
};
})[0].relationships.contents.data
} catch (err) { }
} catch (err) {}
self.sectionsReady.push("recentlyPlayed")
self.sectionsReady.push("friendsListeningTo")
});