fix for badges preventing mediaitem from rendering

This commit is contained in:
booploops 2022-01-04 00:10:34 -08:00
parent f16183781b
commit 3d1156ade1
4 changed files with 18 additions and 15 deletions

View file

@ -2408,6 +2408,9 @@ const app = new Vue({
}
},
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"))}`;
if (newurl.includes("900x516")) {

View file

@ -15,11 +15,11 @@
template: '#mediaitem-artwork',
props: {
size: {
type: String,
type: [String, Number],
default: '120'
},
width: {
type: Number,
type: [String, Number],
required: false
},
url: {

View file

@ -19,7 +19,7 @@
<div class="badge-container" v-if="itemBadges.length != 0">
<div class="socialBadge" v-for="badge in itemBadges.limit(1)">
<mediaitem-artwork
:url="badge.attributes.artwork.url"
:url="(badge.attributes.artwork ? badge.attributes.artwork.url : '')"
:size="32"></mediaitem-artwork>
</div>
</div>

View file

@ -27,18 +27,18 @@
</div>
</div>
</div>
<div class="row" v-if="app.isDev">
<div class="col">
<h3>Your Favorites</h3>
<div class="well">
<div class="hint-text" v-if="favorites.length == 0">Items you have added to your favorites will
appear here.
</div>
<mediaitem-scroller-horizontal kind="small" :items="favorites"
:item="item"></mediaitem-scroller-horizontal>
</div>
</div>
</div>
<!-- <div class="row" v-if="app.isDev">-->
<!-- <div class="col">-->
<!-- <h3>Your Favorites</h3>-->
<!-- <div class="well">-->
<!-- <div class="hint-text" v-if="favorites.length == 0">Items you have added to your favorites will-->
<!-- appear here.-->
<!-- </div>-->
<!-- <mediaitem-scroller-horizontal kind="small" :items="favorites"-->
<!-- :item="item"></mediaitem-scroller-horizontal>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<div class="row">
<div class="col madeforyou-col">
<h3>Made For You</h3>