add dlna and ui fixes

This commit is contained in:
vapormusic 2022-08-31 17:43:57 +07:00
parent d5ade09aa7
commit a023bd619c
10 changed files with 64 additions and 46 deletions

View file

@ -2007,9 +2007,10 @@ const app = new Vue({
include: "grouping,playlists",
extend: "editorialArtwork",
"art[url]": "f",
});
}).then(() => {
kind = "appleCurator";
window.location.hash = `${kind}/${id}`;
document.querySelector("#app-content").scrollTop = 0;
document.querySelector("#app-content").scrollTop = 0});
} else if (kind == "editorial-elements" || kind == "editorial-items") {
console.debug(item);
if (item.relationships?.contents?.data != null && item.relationships?.contents?.data.length > 0) {
@ -4022,6 +4023,7 @@ const app = new Vue({
}
},
getMediaItemArtwork(url, height = 64, width) {
try {
if (typeof url == "undefined" || url == "") {
return "./assets/MissingArtwork.svg";
}
@ -4029,7 +4031,7 @@ const app = new Vue({
if (width) {
width = parseInt(width * window.devicePixelRatio);
}
let newurl = `${url
let newurl = `${(url ?? "")
.replace("{w}", width ?? height)
.replace("{h}", height)
.replace("{f}", "webp")
@ -4038,7 +4040,11 @@ const app = new Vue({
if (newurl.includes("900x516")) {
newurl = newurl.replace("900x516cc", "900x516sr").replace("900x516bb", "900x516sr");
}
return newurl;
return newurl;}
catch (e) {
console.log(url)
return "./assets/MissingArtwork.svg"
}
},
_rgbToRgb(rgb = [0, 0, 0]) {
// if rgb

View file

@ -15,7 +15,7 @@
</div>
<div class="artwork">
<mediaitem-artwork
:url="item.attributes?.editorialArtwork.subscriptionHero.url ?? item.attributes?.artwork"
:url="item.attributes?.editorialArtwork?.subscriptionHero?.url ?? 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 : '')) : '' "
:size="516" :width="900"
></mediaitem-artwork>

View file

@ -45,9 +45,9 @@
<div class="title"
:title="item.attributes?.name ?? (item.relationships?.contents?.data[0]?.attributes?.name ?? (item.attributes?.editorialNotes?.name ?? ''))"
v-if="item.attributes.artistNames == null || kind != 'card'" @click='app.routeView(item)'>
<div class="item-navigate text-overflow-elipsis">{{ item.attributes?.name.replace(/&nbsp;/g, ' ').replace(/Apple Music |^Apple |/g, '') ??
<div class="item-navigate text-overflow-elipsis">{{ (item.attributes?.editorialElementKind == "394" && item.relationships?.contents?.data[0]?.attributes?.shortName != null ) ? item.relationships?.contents?.data[0]?.attributes?.shortName : (item.attributes?.name ? ((removeamtext ) ? item.attributes?.name.replace(/&nbsp;/g, ' ').replace(/Apple Music |^Apple |/g, '') : item.attributes?.name.replace(/&nbsp;/g, ' ')) :
(item.relationships?.contents?.data[0]?.attributes?.name ??
(item.attributes?.editorialNotes?.name ?? '')) }}
(item.attributes?.editorialNotes?.name ?? ''))) }}
</div>
<div class="explicit-icon" v-if="item.attributes && item.attributes.contentRating == 'explicit'"
style="background-image: url(./assets/explicit.svg);height: 12px;width: 12px;filter: contrast(0);background-repeat: no-repeat;margin-top: 2.63px;margin-left: 4px;"></div>
@ -98,6 +98,11 @@ Vue.component('mediaitem-square', {
default: 'cc',
required: false
},
removeamtext: {
type: Boolean,
default: false,
required: false
},
'contextExt': { type: Object, required: false },
},
data: function () {

View file

@ -1,6 +1,6 @@
<script type="text/x-template" id="cider-applecurator">
<div class="content-inner">
<h1 class="header-text">{{ data.attributes.shortName ?? data.attributes.name}}</h1>
<h1 class="header-text">{{ data.attributes?.shortName ?? data.attributes.name}}</h1>
<template v-if="data.relationships && data.relationships.grouping">
<template
v-for="(recom,index) in data.relationships.grouping.data[0].relationships.tabs.data[0].relationships.children.data">
@ -43,6 +43,9 @@
return {
app: this.$root
}
}
},
mounted() {
console.log('ping')
},
})
</script>

View file

@ -142,10 +142,10 @@
</div>
</div>
<div class="categories">
<mediaitem-square :kind="'385'" :imageformat="'bb'" size="600"
<mediaitem-square :kind="'385'" :imageformat="'bb'" size="600" :removeamtext="true"
:item="item ? (item.attributes.kind ? item : ((item.relationships && item.relationships.contents ) ? item.relationships.contents.data[0] : item)) : []"
:imagesize="800"
v-for="item of getFlattenedCategories()">
v-for="item of getFlattenedCategories()"/>
</div>
</div>
</div>