some fixes

This commit is contained in:
vapormusic 2022-05-21 14:19:34 +07:00
parent c2ddaf2d4a
commit 22cd975635
3 changed files with 29 additions and 20 deletions

View file

@ -1678,10 +1678,10 @@ const app = new Vue({
}) })
}, },
routeView(item) { routeView(item) {
let kind = (item.attributes.playParams ? (item.attributes.playParams.kind ?? (item.type ?? '')) : (item.type ?? '')); let kind = (item.attributes?.playParams ? (item.attributes?.playParams?.kind ?? (item.type ?? '')) : (item.type ?? ''));
let id = (item.attributes.playParams ? (item.attributes.playParams.id ?? (item.id ?? '')) : (item.id ?? '')); let id = (item.attributes?.playParams ? (item.attributes?.playParams?.id ?? (item.id ?? '')) : (item.id ?? ''));
; console.log(item);
let isLibrary = item.attributes.playParams ? (item.attributes.playParams.isLibrary ?? false) : false; let isLibrary = item.attributes?.playParams ? (item.attributes?.playParams?.isLibrary ?? false) : false;
if (kind.includes("playlist") || kind.includes("album")) { if (kind.includes("playlist") || kind.includes("album")) {
app.showingPlaylist = []; app.showingPlaylist = [];
} }
@ -1701,8 +1701,10 @@ const app = new Vue({
this.routeView(item.relationships.contents.data[0]) this.routeView(item.relationships.contents.data[0])
} else if (item.attributes?.link?.url != null) { } else if (item.attributes?.link?.url != null) {
if (item.attributes.link.url.includes("viewMultiRoom")) { if (item.attributes.link.url.includes("viewMultiRoom")) {
const params = new Proxy(new URLSearchParams(item.attributes.link.url), {
id = item.attributes.link.url.substring(item.attributes.link.url.lastIndexOf("=") + 1) get: (searchParams, prop) => searchParams.get(prop),
});
id = params.fcId
app.getTypeFromID("multiroom", id, false, { app.getTypeFromID("multiroom", id, false, {
platform: "web", platform: "web",
extend: "editorialArtwork,uber,lockupStyle" extend: "editorialArtwork,uber,lockupStyle"

View file

@ -1,30 +1,30 @@
<script type="text/x-template" id="mediaitem-mvview-sp"> <script type="text/x-template" id="mediaitem-mvview-sp">
<div style="position: relative; display: inline-flex;"> <div style="position: relative; display: inline-flex;">
<div @click.self='app.routeView(item)' <div @click.self='log(item);app.routeView(item)'
class="cd-mediaitem-mvview"> class="cd-mediaitem-mvview">
<div style="height: 70px; min-height: 70px; max-height: 70px; width: 100%; margin-left: 5px;"> <div style="height: 70px; min-height: 70px; max-height: 70px; width: 100%; margin-left: 5px;">
<div class="title-browse-sp bold " @click='app.routeView(item)' style="color: darkgrey;"> <div class="title-browse-sp bold " @click='log(item);app.routeView(item)' style="color: darkgrey;">
{{ badge ? badge.designBadge : ''}} {{ badge ? badge?.designBadge : ''}}
</div> </div>
<div class="title-browse-sp "> <div class="title-browse-sp ">
{{ (badge != null && badge.designTag != null) ? badge.designTag : (item.attributes.name ?? '') }} {{ (badge != null && badge?.designTag != null) ? badge?.designTag : (item.attributes?.name ?? '') }}
</div> </div>
<div class="title-browse-sp semibold" style="color: darkgrey;"> <div class="title-browse-sp semibold" style="color: darkgrey;">
{{ (item.attributes.artistName ?? (item.attributes.curatorName ?? '')) }} {{ (item?.attributes?.artistName ?? (item?.attributes?.curatorName ?? '')) }}
</div> </div>
</div> </div>
<div class="artwork"> <div class="artwork">
<mediaitem-artwork <mediaitem-artwork
:url="item.attributes.artwork ? item.attributes.artwork.url : ''" :url="item.attributes?.artwork ? item.attributes?.artwork?.url : ''"
: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 : '')) : '' " :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="516" :width="900" :size="516" :width="900"
></mediaitem-artwork> ></mediaitem-artwork>
</div> </div>
<div class="cd-mediaitem-mvview-overlay" @click.self='app.routeView(item)'> <div class="cd-mediaitem-mvview-overlay" @click.self='log(item);app.routeView(item)'>
<div class="button" style=" <div class="button" style="
border-radius: 50%; border-radius: 50%;
background: rgba(50,50,50,0.7);" background: rgba(50,50,50,0.7);"
:style="[(!(item.attributes.playParams ? (item.attributes.playParams.kind ?? (item.type ?? '')): (item.type ?? '')).includes('radioStation') && !(item.attributes.playParams ? (item.attributes.playParams.kind ?? (item.type ?? '')): (item.type ?? '')).includes('song')) ? :style="[(!(item.attributes?.playParams ? (item.attributes?.playParams?.kind ?? (item.type ?? '')): (item.type ?? '')).includes('radioStation') && !(item.attributes?.playParams ? (item.attributes?.playParams?.kind ?? (item.type ?? '')): (item.type ?? '')).includes('song')) ?
{'margin': '205px', {'margin': '205px',
'margin-left': '260px', 'margin-bottom': '140px', 'margin-left': '260px', 'margin-bottom': '140px',
width: '30px', width: '30px',
@ -37,11 +37,11 @@
</div> </div>
</div> </div>
</div> </div>
<div class="cd-mediaitem-mvview-overlay" @click.self='app.routeView(item)' tabindex="0"> <div class="cd-mediaitem-mvview-overlay" @click.self='log(item);app.routeView(item)' tabindex="0">
<div class="button" style=" <div class="button" style="
border-radius: 50%; border-radius: 50%;
background: rgba(50,50,50,0.7);" background: rgba(50,50,50,0.7);"
:style="[(!(item.attributes.playParams ? (item.attributes.playParams.kind ?? (item.type ?? '')): (item.type ?? '')).includes('radioStation') && !(item.attributes.playParams ? (item.attributes.playParams.kind ?? (item.type ?? '')): (item.type ?? '')).includes('song')) ? :style="[(!(item.attributes?.playParams ? (item.attributes?.playParams?.kind ?? (item.type ?? '')): (item.type ?? '')).includes('radioStation') && !(item.attributes?.playParams ? (item.attributes?.playParams?.kind ?? (item.type ?? '')): (item.type ?? '')).includes('song')) ?
{'margin': '205px', {'margin': '205px',
'margin-left': '260px', 'margin-bottom': '140px', 'margin-left': '260px', 'margin-bottom': '140px',
width: '30px', width: '30px',
@ -65,6 +65,10 @@
app: this.$root, app: this.$root,
} }
}, },
methods: {} methods: {
log(item) {
console.log(item);
},
}
}); });
</script> </script>

View file

@ -2,9 +2,12 @@
<vue-horizontal> <vue-horizontal>
<template v-if="browsesp"> <template v-if="browsesp">
<mediaitem-mvview-sp <mediaitem-mvview-sp
:item="item ? ((item.attributes?.kind != null || item.attributes?.type == 'editorial-elements') ? item : ((item.relationships && item.relationships.contents ) ? item.relationships.contents.data[0] : item)) : []" :item="
((item?.attributes?.kind != null || item?.attributes?.type == 'editorial-elements')
? item :
((item.relationships && item.relationships.contents ) ? item.relationships.contents.data[0] : item)) ?? (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" :key="item?.id ?? ''" <mediaitem-square :kind="kind" size="600" :key="item?.id ?? ''"