fix for primary-content linking
This commit is contained in:
parent
5e9e989630
commit
aad33acf0a
2 changed files with 27 additions and 15 deletions
|
@ -2919,6 +2919,7 @@ const app = new Vue({
|
||||||
"include[albums]": "artists",
|
"include[albums]": "artists",
|
||||||
"include[songs]": "artists",
|
"include[songs]": "artists",
|
||||||
"include[music-videos]": "artists",
|
"include[music-videos]": "artists",
|
||||||
|
"include[personal-recommendation]": "primary-content",
|
||||||
"fields[albums]": ["artistName", "artistUrl", "artwork", "contentRating", "editorialArtwork", "editorialVideo", "name", "playParams", "releaseDate", "url"],
|
"fields[albums]": ["artistName", "artistUrl", "artwork", "contentRating", "editorialArtwork", "editorialVideo", "name", "playParams", "releaseDate", "url"],
|
||||||
"fields[artists]": ["name", "url", "artwork"],
|
"fields[artists]": ["name", "url", "artwork"],
|
||||||
"extend[stations]": ["airDate", "supportsAirTimeUpdates"],
|
"extend[stations]": ["airDate", "supportsAirTimeUpdates"],
|
||||||
|
|
|
@ -2,8 +2,9 @@
|
||||||
<div v-observe-visibility="{callback: visibilityChanged}">
|
<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="row">
|
||||||
<div class="col" @click="navigateContent(recom.attributes.title.contentIds[0] ?? '')" :class="{'item-navigate' : (recom?.attributes?.title?.contentIds?.length ?? 0) > 0}">
|
<div class="col">
|
||||||
<h3>{{ recom.attributes.title ? recom.attributes.title.stringForDisplay : " "}}</h3>
|
<h3 @click="navigateContent(recom?.relationships['primary-content']?.data[0] ?? recom?.attributes?.title?.contentIds[0] ?? '')" style="width: fit-content;" :class="{'item-navigate' : (recom?.attributes?.title?.contentIds?.length ?? 0) > 0 | recom?.relationships['primary-content']?.data?.length > 0}">
|
||||||
|
{{ recom.attributes.title ? recom.attributes.title.stringForDisplay : " "}}</h3>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-auto cider-flex-center" v-if="recom.relationships.contents.data.length >= 10">
|
<div class="col-auto cider-flex-center" v-if="recom.relationships.contents.data.length >= 10">
|
||||||
<button class="cd-btn-seeall" @click="showCollection(recom)" >{{app.getLz('term.seeAll')}}</button>
|
<button class="cd-btn-seeall" @click="showCollection(recom)" >{{app.getLz('term.seeAll')}}</button>
|
||||||
|
@ -44,6 +45,10 @@
|
||||||
app.showCollection(recom.relationships.contents, recom.attributes.title ? recom.attributes.title.stringForDisplay : '', 'listen_now')
|
app.showCollection(recom.relationships.contents, recom.attributes.title ? recom.attributes.title.stringForDisplay : '', 'listen_now')
|
||||||
},
|
},
|
||||||
navigateContent: async function (id) {
|
navigateContent: async function (id) {
|
||||||
|
|
||||||
|
if (typeof id != "string") {
|
||||||
|
app.routeView(id)
|
||||||
|
} else {
|
||||||
try{
|
try{
|
||||||
let a = await app.mk.api.v3.music(`/v1/catalog/${app.mk.storefrontId}?ids[albums]=${id}`)
|
let a = await app.mk.api.v3.music(`/v1/catalog/${app.mk.storefrontId}?ids[albums]=${id}`)
|
||||||
let q1 = a.data?.data[0]
|
let q1 = a.data?.data[0]
|
||||||
|
@ -54,6 +59,12 @@
|
||||||
let q2 = b.data?.data[0]
|
let q2 = b.data?.data[0]
|
||||||
if (q2) {
|
if (q2) {
|
||||||
app.routeView(q2)
|
app.routeView(q2)
|
||||||
|
} else {
|
||||||
|
let c = await app.mk.api.v3.music(`/v1/catalog/${app.mk.storefrontId}?ids[playlists]=${id}`)
|
||||||
|
let q3 = c.data?.data[0]
|
||||||
|
if (q3) {
|
||||||
|
app.routeView(q3)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
@ -63,7 +74,7 @@
|
||||||
app.routeView(q2)
|
app.routeView(q2)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue