fix for badges preventing mediaitem from rendering
This commit is contained in:
parent
f16183781b
commit
3d1156ade1
4 changed files with 18 additions and 15 deletions
|
@ -2408,6 +2408,9 @@ const app = new Vue({
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
getMediaItemArtwork(url, height = 64, width) {
|
getMediaItemArtwork(url, height = 64, width) {
|
||||||
|
if(typeof url == "undefined" || url == "") {
|
||||||
|
return "https://beta.music.apple.com/assets/product/MissingArtworkMusic.svg"
|
||||||
|
}
|
||||||
let newurl = `${url.replace('{w}', width ?? height).replace('{h}', height).replace('{f}', "webp").replace('{c}', ((width === 900) ? "sr" : "cc"))}`;
|
let newurl = `${url.replace('{w}', width ?? height).replace('{h}', height).replace('{f}', "webp").replace('{c}', ((width === 900) ? "sr" : "cc"))}`;
|
||||||
|
|
||||||
if (newurl.includes("900x516")) {
|
if (newurl.includes("900x516")) {
|
||||||
|
|
|
@ -15,11 +15,11 @@
|
||||||
template: '#mediaitem-artwork',
|
template: '#mediaitem-artwork',
|
||||||
props: {
|
props: {
|
||||||
size: {
|
size: {
|
||||||
type: String,
|
type: [String, Number],
|
||||||
default: '120'
|
default: '120'
|
||||||
},
|
},
|
||||||
width: {
|
width: {
|
||||||
type: Number,
|
type: [String, Number],
|
||||||
required: false
|
required: false
|
||||||
},
|
},
|
||||||
url: {
|
url: {
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
<div class="badge-container" v-if="itemBadges.length != 0">
|
<div class="badge-container" v-if="itemBadges.length != 0">
|
||||||
<div class="socialBadge" v-for="badge in itemBadges.limit(1)">
|
<div class="socialBadge" v-for="badge in itemBadges.limit(1)">
|
||||||
<mediaitem-artwork
|
<mediaitem-artwork
|
||||||
:url="badge.attributes.artwork.url"
|
:url="(badge.attributes.artwork ? badge.attributes.artwork.url : '')"
|
||||||
:size="32"></mediaitem-artwork>
|
:size="32"></mediaitem-artwork>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -27,18 +27,18 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row" v-if="app.isDev">
|
<!-- <div class="row" v-if="app.isDev">-->
|
||||||
<div class="col">
|
<!-- <div class="col">-->
|
||||||
<h3>Your Favorites</h3>
|
<!-- <h3>Your Favorites</h3>-->
|
||||||
<div class="well">
|
<!-- <div class="well">-->
|
||||||
<div class="hint-text" v-if="favorites.length == 0">Items you have added to your favorites will
|
<!-- <div class="hint-text" v-if="favorites.length == 0">Items you have added to your favorites will-->
|
||||||
appear here.
|
<!-- appear here.-->
|
||||||
</div>
|
<!-- </div>-->
|
||||||
<mediaitem-scroller-horizontal kind="small" :items="favorites"
|
<!-- <mediaitem-scroller-horizontal kind="small" :items="favorites"-->
|
||||||
:item="item"></mediaitem-scroller-horizontal>
|
<!-- :item="item"></mediaitem-scroller-horizontal>-->
|
||||||
</div>
|
<!-- </div>-->
|
||||||
</div>
|
<!-- </div>-->
|
||||||
</div>
|
<!-- </div>-->
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col madeforyou-col">
|
<div class="col madeforyou-col">
|
||||||
<h3>Made For You</h3>
|
<h3>Made For You</h3>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue