Merge branch 'local' into develop

This commit is contained in:
vapormusic 2022-02-26 13:19:58 +07:00 committed by GitHub
commit 46ccfa1393
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
26 changed files with 205 additions and 158 deletions

View file

@ -1,7 +1,7 @@
<script type="text/x-template" id="artist-chip">
<div class="artist-chip" @click.self="route">
<div class="artist-chip__image">
<mediaitem-artwork v-if="artist.id != null" :url="artist.attributes.artwork.url" :size="32"></mediaitem-artwork>
<mediaitem-artwork v-if="artist.id != null" :url="artistimage" :size="32"></mediaitem-artwork>
</div>
<div class="artist-chip__name">
<span>{{ item.attributes.name }}</span>
@ -16,24 +16,30 @@
props: {
item: {
type: Object,
required: true
required: true,
}
},
data: function() {
return {
artist: {
id: null
}
},
artistimage : ''
}
},
template: '#artist-chip',
async mounted() {
let artistId = this.item.id
let artistId = this.item.id
if(typeof this.item.relationships.catalog == "object") {
artistId = this.item.relationships.catalog.data[0].id
}
app.mk.api.v3.music(`/v1/catalog/${app.mk.storefrontId}/artists/${artistId}`).then(response => {
app.mk.api.music(`/v1/catalog/${app.mk.storefrontId}/artists/${artistId}`).then(async (response) => {
this.artist = response.data.data[0];
if (this.artistimage == '' && artistId != null){
this.artistimage = (await this.$root.loadArtistImage(artistId) ?? '').replace('300x300','50x50')
}
});
},
methods: {

View file

@ -58,8 +58,8 @@
},
async select(e) {
let u = this.item
let u1 = await app.mk.api.v3.music(`/v1/me/library/artists/${u.id}/albums`, {
"platform": "web",
let u1 = await app.mk.api.music(`/v1/me/library/artists/${u.id}/albums`, {
platform: "auto",
"include[library-albums]": "artists,tracks",
"include[library-artists]": "catalog",
"fields[artists]": "url",

View file

@ -1,6 +1,6 @@
<script type="text/x-template" id="listennow-child">
<div v-observe-visibility="{callback: visibilityChanged}">
<template v-if="isVisible && recom.attributes.display.kind != 'MusicSuperHeroShelf'">
<template v-if="isVisible && recom.attributes.display?.kind != 'MusicSuperHeroShelf'">
<div class="row">
<div class="col">
<h3>{{ recom.attributes.title ? recom.attributes.title.stringForDisplay : ""}}</h3>
@ -9,7 +9,7 @@
<button class="cd-btn-seeall" @click="app.showCollection(recom.relationships.contents, recom.attributes.title ? recom.attributes.title.stringForDisplay : '', 'listen_now')" >{{app.getLz('term.seeAll')}}</button>
</div>
</div>
<template v-if="recom.attributes.display.kind == 'MusicCoverShelf'">
<template v-if="!recom.id.startsWith('6-') && index != 0">
<mediaitem-scroller-horizontal-large
:items="recom.relationships.contents.data.limit(10)"></mediaitem-scroller-horizontal-large>
</template>
@ -18,7 +18,7 @@
:items="recom.relationships.contents.data.limit(10)"></mediaitem-scroller-horizontal-sp>
</template>
</template>
<template v-else-if="recom.attributes.display.kind != 'MusicSuperHeroShelf'">
<template v-else-if="recom.attributes.display?.kind != 'MusicSuperHeroShelf'">
<div style="height:330px"> </div>
</template>
@ -27,11 +27,11 @@
<script>
Vue.component('listennow-child', {
template: "#listennow-child",
props: ["recom"],
props: ["recom", "index"],
data: function () {
return {
isVisible: true,
app: this.$root
app: this.$root,
}
},
methods: {

View file

@ -539,8 +539,8 @@
var playlistId = id
function getPlaylist(id, isLibrary) {
if (isLibrary) {
return this.app.mk.api.v3.music(`/v1/me/library/playlists/${id}`)
} else { return this.app.mk.api.v3.music(`/v1/catalog/${app.mk.storefrontId}/playlists/${id}`) }
return this.app.mk.api.music(`/v1/me/library/playlists/${id}`)
} else { return this.app.mk.api.music(`/v1/catalog/${app.mk.storefrontId}/playlists/${id}`) }
}
try {
getPlaylist(id, isLibrary).then(res => {

View file

@ -10,7 +10,7 @@
</div>
<div class="artwork" @click='app.routeView(item)'>
<mediaitem-artwork
:url="getArtworkUrl()"
:url="mainimageurl"
:video="(item.attributes != null && item.attributes.editorialVideo != null) ? (item.attributes.editorialVideo.motionDetailSquare ? item.attributes.editorialVideo.motionDetailSquare.video : (item.attributes.editorialVideo.motionSquareVideo1x1 ? item.attributes.editorialVideo.motionSquareVideo1x1.video : '')) : '' "
:size="size"
shadow="subtle"
@ -77,7 +77,8 @@
app: this.$root,
badges: this.$root.socialBadges.badgeMap,
itemBadges: [],
unavailable: false
unavailable: false,
mainimageurl: '',
}
},
async mounted() {
@ -91,6 +92,7 @@
this.unavailable = true
}
}
this.getMainImage()
},
methods: {
getBgColor() {
@ -150,7 +152,7 @@
let friends = this.badges[id]
if (friends) {
friends.forEach(function (friend) {
self.app.mk.api.v3.music(`/v1/social/${app.mk.storefrontId}/social-profiles/${friend}`).then(data => {
self.app.mk.api.music(`/v1/social/${app.mk.storefrontId}/social-profiles/${friend}`).then(data => {
self.itemBadges.push(data.data.data[0])
})
})
@ -170,7 +172,7 @@
let kind = this.item.type ?? this.item.attributes.playParams.kind
let truekind = (!kind.endsWith("s")) ? (kind + "s") : kind;
if (truekind == "musicVideos") {truekind = "music-videos"}
let res = await app.mk.api.v3.music(`/v1/catalog/${app.mk.storefrontId}/?ids[${truekind}]=${this.item.attributes.playParams.id ?? this.item.id}`,params);
let res = await app.mk.api.music(`/v1/catalog/${app.mk.storefrontId}/?ids[${truekind}]=${this.item.attributes.playParams.id ?? this.item.id}`,params);
res = res.data.data[0]
this.addedToLibrary = (res && res.attributes && res.attributes.inLibrary) ? res.attributes.inLibrary : false
} else {
@ -186,13 +188,13 @@
let kind = this.item.type ?? this.item.attributes.playParams.kind
let truekind = (!kind.endsWith("s")) ? (kind + "s") : kind;
if (truekind == "musicVideos") {truekind = "music-videos"}
let res = await app.mk.api.v3.music(`/v1/catalog/${app.mk.storefrontId}/?ids[${truekind}]=${this.item.attributes.playParams.id ?? this.item.id}`,params);
let res = await app.mk.api.music(`/v1/catalog/${app.mk.storefrontId}/?ids[${truekind}]=${this.item.attributes.playParams.id ?? this.item.id}`,params);
res= res.data.data[0]
if (res && res.relationships && res.relationships.library && res.relationships.library.data && res.relationships.library.data.length > 0) {
id = res.relationships.library.data[0].id
}
app.mk.api.v3.music(`v1/me/library/${truekind}/${id.toString()}`,{},
app.mk.api.music(`v1/me/library/${truekind}/${id.toString()}`,{},
{
fetchOptions: {
method: "DELETE"
@ -205,7 +207,10 @@
);
},
getArtworkUrl(size = -1, includeUrl = false) {
let artwork = this.item.attributes.artwork ? this.item.attributes.artwork.url : ''
let artwork = this.item.attributes?.artwork ? this.item.attributes.artwork?.url : ''
// if (artwork == '' && this.item.type == "artists" && this.item.id != null) {
// artwork = (await app.loadArtistImage(this.item.id)).toString();
// }
if(size != -1) {
artwork = artwork.replace('{w}', size).replace('{h}', size).replace('{f}', "webp").replace('{c}', ((size === 900) ? "sr" : "cc"))
}
@ -220,6 +225,12 @@
return `url("${artwork}")`
}
},
async getMainImage(){
this.mainimageurl = this.getArtworkUrl()
if (this.mainimageurl == '' && this.item.id != null && this.item.type == "artists") {
this.mainimageurl = await this.app.loadArtistImage(this.item.id)
}
},
getClasses() {
let type = this.item.type
if (this.kind != "") {

View file

@ -66,7 +66,7 @@
},
methods: {
async getHistory() {
let history = await app.mk.api.v3.music(`/v1/me/recent/played/tracks`, { l : this.$root.mklang})
let history = await app.mk.api.music(`/v1/me/recent/played/tracks`, { l : this.$root.mklang})
this.history = history.data.data
},
select(e, position) {

View file

@ -88,7 +88,7 @@
console.log(sendTo)
let type = item.type.replace("library-", "")
let typeTo = sendTo.type
this.$root.mk.api.v3.music(`/v1/me/library/${type}/${item.id}/parent`, {}, {
this.$root.mk.api.music(`/v1/me/library/${type}/${item.id}/parent`, {}, {
fetchOptions: {
method: "PUT",
body: JSON.stringify({
@ -197,7 +197,7 @@
this.getChildren()
this.toggleFolder()
this.$root.mk.api.v3.music(`v1/me/library/playlist-folders/${item.id}/children`).then(data => {
this.$root.mk.api.music(`v1/me/library/playlist-folders/${item.id}/children`).then(data => {
let children = data.data.data;
children.forEach(child => {
if(!self.$root.playlists.listing.find(listing => listing.id == child.id)) {

View file

@ -83,7 +83,7 @@
src="musickit.js?v=1"></script>
<script>
if (typeof MusicKit == 'undefined') {
document.write(unescape("%3Cscript src='https://js-cdn.music.apple.com/musickit/v2/amp/musickit.js' type='text/javascript'%3E%3C/script%3E"));
document.write(unescape("%3Cscript src='https://js-cdn.music.apple.com/musickit/v2/musickit.js' type='text/javascript'%3E%3C/script%3E"));
}
</script>
<script src="./js/fast-plural-rules.js"></script>

View file

@ -1,6 +1,6 @@
<script type="text/x-template" id="cider-applecurator">
<div class="content-inner">
<h1 class="header-text">{{ data.attributes.shortName ?? data.attributes.name}}</h1>
<h1 class="header-text">{{ data.attributes?.shortName ?? data.attributes?.name}}</h1>
<template v-if="data.relationships && data.relationships.grouping">
<template v-for="(recom,index) in data.relationships.grouping.data[0].relationships.tabs.data[0].relationships.children.data">
<div class="row">
@ -26,6 +26,10 @@
</template>
</template>
</template>
<template v-if="data.relationships && data.relationships.playlists">
<mediaitem-square :size="'300'" :item="playlist" v-for="(playlist,index) in data.relationships.playlists.data">
</mediaitem-square>
</template>
</div>
</script>

View file

@ -87,7 +87,7 @@
}
try {
const chunkArtistData = await Promise.all(chunks.map(chunk =>
this.app.mk.api.v3.music(`/v1/catalog/${app.mk.storefrontId}/artists?ids=${chunk.toString()}&views=latest-release&include[songs]=albums&fields[albums]=artistName,artistUrl,artwork,contentRating,editorialArtwork,editorialVideo,name,playParams,releaseDate,url,trackCount&limit[artists:top-songs]=2&art[url]=f`)))
this.app.mk.api.music(`/v1/catalog/${app.mk.storefrontId}/artists?ids=${chunk.toString()}&views=latest-release&include[songs]=albums&fields[albums]=artistName,artistUrl,artwork,contentRating,editorialArtwork,editorialVideo,name,playParams,releaseDate,url,trackCount&limit[artists:top-songs]=2&art[url]=f`)))
chunkArtistData.forEach(chunkResult =>
chunkResult.data.data.forEach(item => {
self.artists.push(item)

View file

@ -12,7 +12,7 @@
<div class="artist-image" v-if="!(data.attributes.editorialVideo && (data.attributes.editorialVideo.motionArtistWide16x9 || data.attributes.editorialVideo.motionArtistFullscreen16x9))">
<mediaitem-artwork
shadow="large"
:url="data.attributes.artwork ? data.attributes.artwork.url : ''"
:url="artistimage"
size="190" type="artists"></mediaitem-artwork>
<button class="overlay-play" @click="app.mk.setStationQueue({artist:'a-'+data.id}).then(()=>{
app.mk.play()
@ -35,7 +35,7 @@
</button>
</div>
<div class="artworkContainer" v-if="!(data.attributes.editorialVideo && (data.attributes.editorialVideo.motionArtistWide16x9 || data.attributes.editorialVideo.motionArtistFullscreen16x9))">
<artwork-material :url="data.attributes.artwork.url" size="190" images="1"></artwork-material>
<artwork-material :url="data.attributes.artwork?.url ?? ''" size="190" images="1"></artwork-material>
</div>
</div>
<div class="floating-header" :style="{opacity: (headerVisible ? 0 : 1),'pointer-events': (headerVisible ? 'none' : '')}">
@ -143,9 +143,18 @@
return {
topSongsExpanded: false,
app: this.$root,
headerVisible: true
headerVisible: true,
artistimage : ''
}
},
mounted: async function () {
this.artistimage = this.data.attributes?.artwork ? this.data.attributes.artwork?.url : ''
if (this.artistimage == '' && this.data.id != null){
this.artistimage = await this.app.loadArtistImage(this.data.id)
}
},
methods: {
isHeaderVisible(visible) {
this.headerVisible = visible

View file

@ -259,7 +259,7 @@
let friends = badges[id]
if (friends) {
friends.forEach(function (friend) {
self.app.mk.api.v3.music(`/v1/social/${app.mk.storefrontId}/social-profiles/${friend}`).then(data => {
self.app.mk.api.music(`/v1/social/${app.mk.storefrontId}/social-profiles/${friend}`).then(data => {
self.itemBadges.push(data.data.data[0])
})
})
@ -323,7 +323,7 @@
}
let kind = this.data.attributes.playParams.kind ?? this.data.type ?? '';
const truekind = (!kind.endsWith("s")) ? (kind + "s") : kind;
app.mk.api.v3.music(`v1/me/library/${truekind}/${id.toString()}`, {},
app.mk.api.music(`v1/me/library/${truekind}/${id.toString()}`, {},
{
fetchOptions: {
method: "DELETE"
@ -369,7 +369,7 @@
return
}
console.log('sds', this.convert())
await app.mk.api.v3.music(
await app.mk.api.music(
`/v1/me/library/playlists/${this.data.attributes.playParams.id}/tracks`,
{},
{
@ -449,7 +449,7 @@
if (route === '') {
return
}
app.mk.api.v3.music(route).then(res => {
app.mk.api.music(route).then(res => {
console.log(res.data.data[0].attributes.url)
app.copyToClipboard(res.data.data[0].attributes.url)
})

View file

@ -84,7 +84,7 @@
}
this.loading = true
this.api.v3.music(this.data.next, app.collectionList.requestBody).then((response) => {
this.api.music(this.data.next, app.collectionList.requestBody).then((response) => {
console.log(response)
if (!app.collectionList.response.groups) {
this.data.data = this.data.data.concat(response.data.data);

View file

@ -127,7 +127,7 @@
},
methods: {
async seeAllHistory() {
let hist = await app.mk.api.v3.music(`/v1/me/recent/played/tracks`, {
let hist = await app.mk.api.music(`/v1/me/recent/played/tracks`, {
l: this.$root.mklang
})
app.showCollection(hist.data, app.getLz('term.history'))
@ -160,14 +160,14 @@
}
}
if (playlists.length != 0) {
this.app.mk.api.v3.music(`/v1/catalog/${app.mk.storefrontId}/playlists/${playlists.toString()}`, {
this.app.mk.api.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()}`, {
this.app.mk.api.music(`v1/me/library/playlists/${playlists.toString()}`, {
l: this.$root.mklang
}).then(playlistsData => {
self.favorites.push(...playlistsData.data)
@ -184,7 +184,7 @@
}
try {
const chunkArtistData = await Promise.all(chunks.map(chunk =>
this.app.mk.api.v3.music(`/v1/catalog/${app.mk.storefrontId}/artists?ids=${chunk.toString()}&views=latest-release&include[songs]=albums&fields[albums]=artistName,artistUrl,artwork,contentRating,editorialArtwork,editorialVideo,name,playParams,releaseDate,url,trackCount&limit[artists:top-songs]=2&art[url]=f`)))
this.app.mk.api.music(`/v1/catalog/${app.mk.storefrontId}/artists?ids=${chunk.toString()}&views=latest-release&include[songs]=albums&fields[albums]=artistName,artistUrl,artwork,contentRating,editorialArtwork,editorialVideo,name,playParams,releaseDate,url,trackCount&limit[artists:top-songs]=2&art[url]=f`)))
chunkArtistData.forEach(chunkResult =>
chunkResult.data.data.forEach(item => {
if (item.views["latest-release"].data.length != 0) {
@ -204,7 +204,7 @@
},
async getListenNowData() {
let self = this
this.app.mk.api.v3.music(`/v1/me/recommendations?timezone=${encodeURIComponent(app.formatTimezoneOffset())}&name=listen-now&with=friendsMix,library,social&art[social-profiles:url]=c&art[url]=c,f&omit[resource]=autos&relate[editorial-items]=contents&extend=editorialCard,editorialVideo&extend[albums]=artistUrl&extend[library-albums]=artistUrl,editorialVideo&extend[playlists]=artistNames,editorialArtwork,editorialVideo&extend[library-playlists]=artistNames,editorialArtwork,editorialVideo&extend[social-profiles]=topGenreNames&include[albums]=artists&include[songs]=artists&include[music-videos]=artists&fields[albums]=artistName,artistUrl,artwork,contentRating,editorialArtwork,editorialVideo,name,playParams,releaseDate,url&fields[artists]=name,url&extend[stations]=airDate,supportsAirTimeUpdates&meta[stations]=inflectionPoints&types=artists,albums,editorial-items,library-albums,library-playlists,music-movies,music-videos,playlists,stations,uploaded-audios,uploaded-videos,activities,apple-curators,curators,tv-shows,social-upsells&platform=web&l=${this.$root.mklang}`).then((data) => {
this.app.mk.api.music(`/v1/me/recommendations?timezone=${encodeURIComponent(app.formatTimezoneOffset())}&name=listen-now&with=friendsMix,library&art[social-profiles:url]=c&art[url]=c,f&omit[resource]=autos&relate[editorial-items]=contents&extend=editorialCard,editorialVideo&extend[albums]=artistUrl&extend[library-albums]=artistUrl,editorialVideo&extend[playlists]=artistNames,editorialArtwork,editorialVideo&extend[library-playlists]=artistNames,editorialArtwork,editorialVideo&extend[social-profiles]=topGenreNames&include[albums]=artists&include[songs]=artists&include[music-videos]=artists&fields[albums]=artistName,artistUrl,artwork,contentRating,editorialArtwork,editorialVideo,name,playParams,releaseDate,url&fields[artists]=name,url&extend[stations]=airDate,supportsAirTimeUpdates&meta[stations]=inflectionPoints&types=artists,albums,editorial-items,library-albums,library-playlists,music-videos,playlists,stations,activities,apple-curators,curators&platform=auto&l=${this.$root.mklang}`).then((data) => {
console.log(data.data.data[1])
try {
self.madeForYou = data.data.data.filter(section => {
@ -227,7 +227,7 @@
self.sectionsReady.push("friendsListeningTo")
});
app.mk.api.v3.music("/v1/me/social/profile/").then((response) => {
app.mk.api.music("/v1/me/social/profile/").then((response) => {
self.profile = response.data.data[0]
})

View file

@ -30,7 +30,7 @@
mounted() {
this.$nextTick(async function () {
if (this.$data.videos == null || this.$data.videos.length == 0)
this.$data.videos = (await this.$root.mk.api.v3.music('/v1/me/library/music-videos')).data?.data ?? []
this.$data.videos = (await this.$root.mk.api.music('/v1/me/library/music-videos')).data?.data ?? []
this.$data.loaded = true
})
}

View file

@ -1,8 +1,8 @@
<script type="text/x-template" id="cider-listen-now">
<div class="content-inner">
<h1 class="header-text">{{app.getLz('term.listenNow')}}</h1>
<template v-for="recom in data.data">
<listennow-child :recom="recom"></listennow-child>
<template v-for="(recom, index) in data.data">
<listennow-child :index="index" :recom="recom"></listennow-child>
</template>
</div>
</script>

View file

@ -283,7 +283,7 @@
let friends = badges[id]
if (friends) {
friends.forEach(function (friend) {
self.app.mk.api.v3.music(`/v1/social/${app.mk.storefrontId}/social-profiles/${friend}`).then(data => {
self.app.mk.api.music(`/v1/social/${app.mk.storefrontId}/social-profiles/${friend}`).then(data => {
self.itemBadges.push(data.data.data[0])
})
})
@ -347,7 +347,7 @@
}
let kind = this.data.attributes.playParams.kind ?? this.data.type ?? '';
const truekind = (!kind.endsWith("s")) ? (kind + "s") : kind;
app.mk.api.v3.music(`v1/me/library/${truekind}/${id.toString()}`, {},
app.mk.api.music(`v1/me/library/${truekind}/${id.toString()}`, {},
{
fetchOptions: {
method: "DELETE"
@ -393,7 +393,7 @@
return
}
console.log('sds', this.convert())
await app.mk.api.v3.music(
await app.mk.api.music(
`/v1/me/library/playlists/${this.data.attributes.playParams.id}/tracks`,
{},
{
@ -473,7 +473,7 @@
if (route === '') {
return
}
app.mk.api.v3.music(route).then(res => {
app.mk.api.music(route).then(res => {
console.log(res.data.data[0].attributes.url)
app.copyToClipboard(res.data.data[0].attributes.url)
})

View file

@ -165,7 +165,7 @@
}
},
async mounted() {
let podcastShow = await app.mk.api.v3.podcasts(`/v1/me/library/podcasts?include=episodes`)
let podcastShow = await app.mk.api.podcasts(`/v1/me/library/podcasts?include=episodes`)
this.podcasts = podcastShow.data.data
if (podcastShow.data.next) {
await this.getNext(podcastShow.data.next)
@ -190,7 +190,7 @@
if(this.search.term == "") {
return
}
app.mk.api.v3.podcasts("/v1/catalog/us/search", {term: this.search.term, types: ["podcasts"], limit: 25}).then(response => {
app.mk.api.podcasts("/v1/catalog/us/search", {term: this.search.term, types: ["podcasts"], limit: 25}).then(response => {
console.log(response)
self.search.results = response.data.results.podcasts.data
})
@ -215,7 +215,7 @@
},
async getEpisodes(podcast) {
this.episodes = []
let eps = await app.mk.api.v3.podcasts(`/v1/catalog/${app.mk.storefrontId}/podcasts/${podcast.id}?include=episodes`)
let eps = await app.mk.api.podcasts(`/v1/catalog/${app.mk.storefrontId}/podcasts/${podcast.id}?include=episodes`)
eps.data.data[0].relationships.episodes.data.forEach(ep => {
this.episodes.push(ep)
@ -226,7 +226,7 @@
},
async getNextEpisodes(next, podcastId) {
let podcastShow = await app.mk.api.v3.podcasts(next)
let podcastShow = await app.mk.api.podcasts(next)
if(podcastId != this.podcastSelected.id) {
return
}
@ -238,7 +238,7 @@
}
},
async getNext(next) {
let podcastShow = await app.mk.api.v3.podcasts(next)
let podcastShow = await app.mk.api.podcasts(next)
this.podcasts = this.podcasts.concat(podcastShow.data.data)
if (podcastShow.data.next) {
await this.getNext(podcastShow.data.next)

View file

@ -97,12 +97,12 @@
},
async mounted() {
// Get available years
let year = await app.mk.api.v3.music("/v1/me/music-summaries/search?extend=inLibrary&period=year&fields[music-summaries]=period%2Cyear&include[music-summaries]=playlist")
let year = await app.mk.api.music("/v1/me/music-summaries/search?extend=inLibrary&period=year&fields[music-summaries]=period%2Cyear&include[music-summaries]=playlist")
this.years = year.data.data
this.years.reverse()
localStorage.setItem("seenReplay", true)
this.getReplayYear();
const musicGenre = await app.mk.api.v3.music(`/v1/catalog/${app.mk.storefrontId}/genres/34`)
const musicGenre = await app.mk.api.music(`/v1/catalog/${app.mk.storefrontId}/genres/34`)
this.musicTypeGenre = musicGenre.data.data[0].attributes.name
},
methods: {
@ -145,10 +145,10 @@
},
async getReplayYear(year = new Date().getFullYear()) {
this.loaded.id = -1
let response = await app.mk.api.v3.music(`/v1/me/music-summaries/year-${year}?extend=inLibrary&views=top-artists%2Ctop-albums%2Ctop-songs&include[music-summaries]=playlist&include[playlists]=tracks&includeOnly=playlist%2Ctracks%2Csong%2Cartist%2Calbum`)
let response = await app.mk.api.music(`/v1/me/music-summaries/year-${year}?extend=inLibrary&views=top-artists%2Ctop-albums%2Ctop-songs&include[music-summaries]=playlist&include[playlists]=tracks&includeOnly=playlist%2Ctracks%2Csong%2Cartist%2Calbum`)
let replayData = response.data.data[0]
// extended playlist
let playlist = await app.mk.api.v3.music(replayData.relationships.playlist.data[0].href, {extend: "editorialArtwork,editorialVideo"})
let playlist = await app.mk.api.music(replayData.relationships.playlist.data[0].href, {extend: "editorialArtwork,editorialVideo"})
replayData.playlist = playlist.data.data[0]
this.loaded = replayData
}

View file

@ -116,7 +116,7 @@
},
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&l=${this.$root.mklang}`);
let response = await this.app.mk.api.music(`/v1/recommendations/${this.app.mk.storefrontId}?timezone=${encodeURIComponent(this.app.formatTimezoneOffset())}&name=search-landing&platform=auto&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)
this.categoriesReady = true;

View file

@ -21,7 +21,7 @@
}
},
async mounted() {
app.mk.api.v3.music("/v1/catalog/us/artists/669831761").then(response => {
app.mk.api.music("/v1/catalog/us/artists/669831761").then(response => {
this.artist = response.data.data[0];
this.artistLoaded = true;
});