allow listennow "more like" nav to work
This commit is contained in:
parent
2e5cab40fd
commit
5e9e989630
1 changed files with 24 additions and 1 deletions
|
@ -2,7 +2,7 @@
|
|||
<div v-observe-visibility="{callback: visibilityChanged}">
|
||||
<template v-if="isVisible && recom.attributes.display.kind != 'MusicSuperHeroShelf'">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="col" @click="navigateContent(recom.attributes.title.contentIds[0] ?? '')" :class="{'item-navigate' : (recom?.attributes?.title?.contentIds?.length ?? 0) > 0}">
|
||||
<h3>{{ recom.attributes.title ? recom.attributes.title.stringForDisplay : " "}}</h3>
|
||||
</div>
|
||||
<div class="col-auto cider-flex-center" v-if="recom.relationships.contents.data.length >= 10">
|
||||
|
@ -42,6 +42,29 @@
|
|||
showCollection: function (recom) {
|
||||
console.debug(recom)
|
||||
app.showCollection(recom.relationships.contents, recom.attributes.title ? recom.attributes.title.stringForDisplay : '', 'listen_now')
|
||||
},
|
||||
navigateContent: async function (id) {
|
||||
try{
|
||||
let a = await app.mk.api.v3.music(`/v1/catalog/${app.mk.storefrontId}?ids[albums]=${id}`)
|
||||
let q1 = a.data?.data[0]
|
||||
if (q1) {
|
||||
app.routeView(q1)
|
||||
} else {
|
||||
let b = await app.mk.api.v3.music(`/v1/catalog/${app.mk.storefrontId}?ids[artists]=${id}`)
|
||||
let q2 = b.data?.data[0]
|
||||
if (q2) {
|
||||
app.routeView(q2)
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
let b = await app.mk.api.v3.music(`/v1/catalog/${app.mk.storefrontId}?ids[artists]=${id}`)
|
||||
let q2 = b.data?.data[0]
|
||||
if (q2) {
|
||||
app.routeView(q2)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue