fix for artwork on playlists/albums, put some wip code for navigation events for history navigation
This commit is contained in:
parent
a892305c09
commit
22194be526
4 changed files with 56 additions and 34 deletions
|
@ -30,11 +30,6 @@ Vue.component('cider-listen-now', {
|
||||||
props: ["data"]
|
props: ["data"]
|
||||||
})
|
})
|
||||||
|
|
||||||
Vue.component('cider-playlist', {
|
|
||||||
template: "#cider-playlist",
|
|
||||||
props: ["data"]
|
|
||||||
})
|
|
||||||
|
|
||||||
const MusicKitTools = {
|
const MusicKitTools = {
|
||||||
getHeader() {
|
getHeader() {
|
||||||
return new Headers({
|
return new Headers({
|
||||||
|
@ -57,6 +52,18 @@ function msToMinSec(ms) {
|
||||||
return minutes + ":" + (seconds < 10 ? '0' : '') + seconds;
|
return minutes + ":" + (seconds < 10 ? '0' : '') + seconds;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class NavigationEvent {
|
||||||
|
constructor(page, onnavigate, scrollPosition) {
|
||||||
|
this.page = page;
|
||||||
|
this.onnavigate = onnavigate;
|
||||||
|
this.scrollPosition = scrollPosition;
|
||||||
|
}
|
||||||
|
navigate() {
|
||||||
|
this.onnavigate();
|
||||||
|
document.querySelector("#app-content").scrollTop = this.scrollPosition;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const app = new Vue({
|
const app = new Vue({
|
||||||
el: "#app",
|
el: "#app",
|
||||||
data: {
|
data: {
|
||||||
|
@ -116,7 +123,8 @@ const app = new Vue({
|
||||||
drawerOpened: false,
|
drawerOpened: false,
|
||||||
drawerState: "queue"
|
drawerState: "queue"
|
||||||
},
|
},
|
||||||
page: "artist-page"
|
page: "artist-page",
|
||||||
|
pageHistory: [],
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
async init() {
|
async init() {
|
||||||
|
@ -242,6 +250,11 @@ const app = new Vue({
|
||||||
app.getTypeFromID((kind),(id), (isLibrary));} else {
|
app.getTypeFromID((kind),(id), (isLibrary));} else {
|
||||||
app.playMediaItemById((id),(kind), (isLibrary), item.attributes.url ?? '')
|
app.playMediaItemById((id),(kind), (isLibrary), item.attributes.url ?? '')
|
||||||
}
|
}
|
||||||
|
document.querySelector("#app-content").scrollTop = 0
|
||||||
|
},
|
||||||
|
pushNavigationEvent(item){
|
||||||
|
let self = this
|
||||||
|
|
||||||
},
|
},
|
||||||
getArtistInfo(id, isLibrary){
|
getArtistInfo(id, isLibrary){
|
||||||
var query = {"omit[resource]": "autos",
|
var query = {"omit[resource]": "autos",
|
||||||
|
|
|
@ -1845,7 +1845,7 @@ input[type=range].web-slider::-webkit-slider-runnable-track {
|
||||||
}
|
}
|
||||||
.playlist-display .playlist-info .playlist-desc {
|
.playlist-display .playlist-info .playlist-desc {
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
font-size: 1.1rem;
|
font-size: 1em;
|
||||||
flex-shrink: unset;
|
flex-shrink: unset;
|
||||||
margin-right: 5px;
|
margin-right: 5px;
|
||||||
}
|
}
|
||||||
|
|
|
@ -365,33 +365,8 @@
|
||||||
</div>
|
</div>
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<!-- Album / Playlist View -->
|
<!-- Playlists / Albums -->
|
||||||
<script type="text/x-template" id="cider-playlist">
|
<%- include('pages/cider-playlist') %>
|
||||||
<div class="content-inner">
|
|
||||||
<template v-if="data != [] && data.attributes != []">
|
|
||||||
<div class="playlist-display row">
|
|
||||||
<div class="col-auto">
|
|
||||||
<mediaitem-artwork
|
|
||||||
:url="(data.attributes != null && data.attributes.artwork != null) ? data.attributes.artwork.url : (data.relationships.tracks.data.length > 0 ? data.relationships.tracks.data[0].attributes.artwork.url ?? '':'')"
|
|
||||||
size="200"
|
|
||||||
></mediaitem-artwork>
|
|
||||||
</div>
|
|
||||||
<div class="col playlist-info">
|
|
||||||
<div class="playlist-name">{{data.attributes.name ?? (data.attributes.title ?? '') ?? ''}}</div>
|
|
||||||
<div class="playlist-artist" v-if="data.attributes.artistName">{{data.attributes.artistName ??
|
|
||||||
''}}
|
|
||||||
</div>
|
|
||||||
<div class="playlist-desc"
|
|
||||||
v-html="((data.attributes.editorialNotes) ? (data.attributes.editorialNotes.short ?? (data.attributes.editorialNotes.standard ?? '') ) : (data.attributes.description ? (data.attributes.description.short ?? (data.attributes.description.standard ?? '')) : ''))"></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<mediaitem-list-item :item="item"
|
|
||||||
v-for="item in data.relationships.tracks.data"></mediaitem-list-item>
|
|
||||||
<div class="playlist-time">{{app.getTotalTime()}}</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<!-- Search -->
|
<!-- Search -->
|
||||||
<script type="text/x-template" id="cider-search">
|
<script type="text/x-template" id="cider-search">
|
||||||
|
|
|
@ -0,0 +1,34 @@
|
||||||
|
<script type="text/x-template" id="cider-playlist">
|
||||||
|
<div class="content-inner">
|
||||||
|
<template v-if="data != [] && data.attributes != []">
|
||||||
|
<div class="playlist-display row">
|
||||||
|
<div class="col-auto flex-center">
|
||||||
|
<div style="width: 200px;height:200px;">
|
||||||
|
<mediaitem-artwork
|
||||||
|
:url="(data.attributes != null && data.attributes.artwork != null) ? data.attributes.artwork.url : (data.relationships.tracks.data.length > 0 ? data.relationships.tracks.data[0].attributes.artwork.url ?? '':'')"
|
||||||
|
size="200"
|
||||||
|
></mediaitem-artwork>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col playlist-info">
|
||||||
|
<div class="playlist-name">{{data.attributes.name ?? (data.attributes.title ?? '') ?? ''}}</div>
|
||||||
|
<div class="playlist-artist" v-if="data.attributes.artistName">{{data.attributes.artistName ??
|
||||||
|
''}}
|
||||||
|
</div>
|
||||||
|
<div class="playlist-desc"
|
||||||
|
v-html="((data.attributes.editorialNotes) ? (data.attributes.editorialNotes.short ?? (data.attributes.editorialNotes.standard ?? '') ) : (data.attributes.description ? (data.attributes.description.short ?? (data.attributes.description.standard ?? '')) : ''))"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<mediaitem-list-item :item="item"
|
||||||
|
v-for="item in data.relationships.tracks.data"></mediaitem-list-item>
|
||||||
|
<div class="playlist-time">{{app.getTotalTime()}}</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</script>
|
||||||
|
<script>
|
||||||
|
Vue.component('cider-playlist', {
|
||||||
|
template: "#cider-playlist",
|
||||||
|
props: ["data"]
|
||||||
|
})
|
||||||
|
</script>
|
Loading…
Add table
Add a link
Reference in a new issue