some support for editorial-contents
This commit is contained in:
parent
556713bc32
commit
bb78a255e7
3 changed files with 24 additions and 8 deletions
|
@ -1507,6 +1507,14 @@ const app = new Vue({
|
||||||
});
|
});
|
||||||
window.location.hash = `${kind}/${id}`
|
window.location.hash = `${kind}/${id}`
|
||||||
document.querySelector("#app-content").scrollTop = 0
|
document.querySelector("#app-content").scrollTop = 0
|
||||||
|
} else if (kind == "editorial-elements") {
|
||||||
|
console.log(item)
|
||||||
|
if (item.relationships?.contents?.data != null && item.relationships?.contents?.data.length > 0){
|
||||||
|
this.routeView(item.relationships.contents.data[0])
|
||||||
|
} else if (item.attributes?.link?.url != null){
|
||||||
|
window.open(item.attributes.link.url)
|
||||||
|
}
|
||||||
|
|
||||||
} else if (kind.toString().includes("artist")) {
|
} else if (kind.toString().includes("artist")) {
|
||||||
app.getArtistInfo(id, isLibrary)
|
app.getArtistInfo(id, isLibrary)
|
||||||
window.location.hash = `${kind}/${id}${isLibrary ? "/" + isLibrary : ''}`
|
window.location.hash = `${kind}/${id}${isLibrary ? "/" + isLibrary : ''}`
|
||||||
|
|
|
@ -2,13 +2,13 @@
|
||||||
<vue-horizontal>
|
<vue-horizontal>
|
||||||
<template v-if="browsesp">
|
<template v-if="browsesp">
|
||||||
<mediaitem-mvview-sp
|
<mediaitem-mvview-sp
|
||||||
:item="item ? (item.attributes.kind ? item : ((item.relationships && item.relationships.contents ) ? item.relationships.contents.data[0] : item)) : []"
|
:item="item ? ((item.attributes?.kind != null || item.attributes?.type == 'editorial-elements') ? item : ((item.relationships && item.relationships.contents ) ? item.relationships.contents.data[0] : item)) : []"
|
||||||
:imagesize="imagesize"
|
:imagesize="imagesize"
|
||||||
:badge="item.attributes" v-for="item in items"></mediaitem-mvview-sp>
|
:badge="item.attributes" v-for="item in items"></mediaitem-mvview-sp>
|
||||||
</template>
|
</template>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
<mediaitem-square :kind="kind" size="600"
|
<mediaitem-square :kind="kind" size="600"
|
||||||
:item="item ? (item.attributes.kind ? item : ((item.relationships && item.relationships.contents ) ? item.relationships.contents.data[0] : item)) : []"
|
:item="item ? ((item.attributes?.kind != null || item.type == 'editorial-elements') ? item : ((item.relationships && item.relationships.contents ) ? item.relationships.contents.data[0] : item)) : []"
|
||||||
:imagesize="imagesize"
|
:imagesize="imagesize"
|
||||||
v-for="item in items"></mediaitem-square>
|
v-for="item in items"></mediaitem-square>
|
||||||
</template>
|
</template>
|
||||||
|
@ -43,6 +43,8 @@
|
||||||
app: this.$root,
|
app: this.$root,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {}
|
// mounted(){
|
||||||
|
// console.log('hes',this.items)
|
||||||
|
// }
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
|
@ -36,7 +36,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="info-rect" :class="{'info-rect-card': kind == 'card'}" :style="{'--bgartwork': getArtworkUrl(size, true)}">
|
<div class="info-rect" :class="{'info-rect-card': kind == 'card'}" :style="{'--bgartwork': getArtworkUrl(size, true)}">
|
||||||
<div class="title" v-if="item.attributes.artistNames == null || kind!= 'card'" @click='app.routeView(item)'>
|
<div class="title" v-if="item.attributes.artistNames == null || kind!= 'card'" @click='app.routeView(item)'>
|
||||||
<div class="item-navigate text-overflow-elipsis">{{ item.attributes.name }}</div>
|
<div class="item-navigate text-overflow-elipsis">{{ item.attributes?.name ?? (item.relationships?.contents?.data[0]?.attributes?.name ?? '') }}</div>
|
||||||
<div class="explicit-icon" v-if="item.attributes && item.attributes.contentRating == 'explicit'" style= "background-image: url(./assets/explicit.svg);height: 12px;width: 12px;filter: contrast(0);background-repeat: no-repeat;margin-top: 2.63px;margin-left: 4px;"></div>
|
<div class="explicit-icon" v-if="item.attributes && item.attributes.contentRating == 'explicit'" style= "background-image: url(./assets/explicit.svg);height: 12px;width: 12px;filter: contrast(0);background-repeat: no-repeat;margin-top: 2.63px;margin-left: 4px;"></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="subtitle item-navigate text-overflow-elipsis" @click="getSubtitleNavigation()"
|
<div class="subtitle item-navigate text-overflow-elipsis" @click="getSubtitleNavigation()"
|
||||||
|
@ -77,7 +77,7 @@
|
||||||
addedToLibrary: false,
|
addedToLibrary: false,
|
||||||
guid: this.uuidv4(),
|
guid: this.uuidv4(),
|
||||||
noplay: ["apple-curators"],
|
noplay: ["apple-curators"],
|
||||||
nomenu: ["artists", "stations", "apple-curators"],
|
nomenu: ["artists", "stations", "apple-curators", "editorial-elements"],
|
||||||
app: this.$root,
|
app: this.$root,
|
||||||
badges: this.$root.socialBadges.badgeMap,
|
badges: this.$root.socialBadges.badgeMap,
|
||||||
itemBadges: [],
|
itemBadges: [],
|
||||||
|
@ -149,7 +149,7 @@
|
||||||
},
|
},
|
||||||
async getBadges() {
|
async getBadges() {
|
||||||
const self = this
|
const self = this
|
||||||
const id = (this.item.attributes.playParams ? this.item.attributes.playParams.id : null) || this.item.id
|
const id = ((this.item.attributes?.playParams ?? false) ? this.item.attributes?.playParams.id : null) || this.item.id
|
||||||
if (id && this.badges[id]) {
|
if (id && this.badges[id]) {
|
||||||
let friends = this.badges[id]
|
let friends = this.badges[id]
|
||||||
if (friends) {
|
if (friends) {
|
||||||
|
@ -215,7 +215,7 @@
|
||||||
}
|
}
|
||||||
switch (this.kind) {
|
switch (this.kind) {
|
||||||
case "385":
|
case "385":
|
||||||
artwork = this.item.attributes.editorialArtwork.subscriptionHero.url
|
artwork = this.item.attributes.editorialArtwork?.subscriptionHero?.url ?? (this.item.attributes.artwork?.url ?? (this.item.relationships?.contents?.data[0]?.attributes?.editorialArtwork?.subscriptionHero?.url ?? ''))
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if(!includeUrl) {
|
if(!includeUrl) {
|
||||||
|
@ -225,7 +225,12 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
getClasses() {
|
getClasses() {
|
||||||
let type = this.item.type
|
let type = []
|
||||||
|
try{
|
||||||
|
type = this.item.type
|
||||||
|
|
||||||
|
}catch(e) {console.log('sd',this.item)}
|
||||||
|
|
||||||
if (this.kind != "") {
|
if (this.kind != "") {
|
||||||
type = this.kind
|
type = this.kind
|
||||||
}
|
}
|
||||||
|
@ -233,6 +238,7 @@
|
||||||
default:
|
default:
|
||||||
return []
|
return []
|
||||||
break;
|
break;
|
||||||
|
case "editorial-elements":
|
||||||
case "card":
|
case "card":
|
||||||
return ["mediaitem-card"]
|
return ["mediaitem-card"]
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue