move listen now to its seperate file

This commit is contained in:
vapormusic 2021-12-13 20:51:54 +07:00
parent 6a84de815b
commit 9d7251f20c
5 changed files with 39 additions and 39 deletions

View file

@ -13,10 +13,6 @@ Vue.component('lyrics-view', {
methods: {} methods: {}
}); });
Vue.component('cider-listen-now', {
template: "#cider-listen-now",
props: ["data"]
})
const MusicKitTools = { const MusicKitTools = {
getHeader() { getHeader() {
@ -481,7 +477,7 @@ const app = new Vue({
console.log(artistId) console.log(artistId)
} }
} }
catch (e) {console.log(e)} catch (e) {}
} }
console.log(artistId); console.log(artistId);
if (artistId != "") if (artistId != "")
@ -504,7 +500,7 @@ const app = new Vue({
console.log(albumId) console.log(albumId)
} }
} }
catch (e) {console.log(e)} catch (e) {}
} }
if (albumId != "") if (albumId != "")
{ {
@ -526,7 +522,7 @@ const app = new Vue({
console.log(labelId) console.log(labelId)
} }
} }
catch (e) {console.log(e)} catch (e) {}
} }
if (labelId != "") if (labelId != "")
{ {
@ -1108,7 +1104,6 @@ const app = new Vue({
} }
if (lrcfile == "") { if (lrcfile == "") {
console.log('track not found');
app.loadAMLyrics() app.loadAMLyrics()
} else { } else {
// process lrcfile to json here // process lrcfile to json here
@ -1142,7 +1137,6 @@ const app = new Vue({
} }
} catch (e) { } catch (e) {
console.log(e); console.log(e);
console.log('track not found ??');
app.loadAMLyrics() app.loadAMLyrics()
} }
} else { //4xx rejected } else { //4xx rejected
@ -1195,10 +1189,8 @@ const app = new Vue({
if (track != "" & track != "No Title Found") { if (track != "" & track != "No Title Found") {
if (app.mxmtoken != null && app.mxmtoken != '') { if (app.mxmtoken != null && app.mxmtoken != '') {
console.log("we good");
getMXMSubs(track, artist, app.mxmtoken, lang, time) getMXMSubs(track, artist, app.mxmtoken, lang, time)
} else { } else {
console.log("get token");
getToken(1, track, artist, '', lang, time); getToken(1, track, artist, '', lang, time);
} }
} }

View file

@ -403,31 +403,7 @@
</script> </script>
<!-- Listen Now --> <!-- Listen Now -->
<script type="text/x-template" id="cider-listen-now"> <%- include('pages/listen_now') %>
<div class="content-inner">
<h1 class="header-text">Listen Now</h1>
<template v-for="recom in data.data">
<div class="row">
<div class="col">
<h3>{{ recom.attributes.title ? recom.attributes.title.stringForDisplay : ""}}</h3>
</div>
<div class="col-auto flex-center" v-if="recom.relationships.contents.data.length >= 10">
<button class="cd-btn-seeall">See All</button>
</div>
</div>
<template v-if="recom.attributes.display.kind == 'MusicCoverShelf'">
<mediaitem-scroller-horizontal-large
:items="recom.relationships.contents.data.limit(10)"></mediaitem-scroller-horizontal-large>
</template>
<template v-else-if="recom.attributes.display.kind == 'MusicSuperHeroShelf'">
</template>
<template v-else>
<mediaitem-scroller-horizontal-sp
:items="recom.relationships.contents.data.limit(10)"></mediaitem-scroller-horizontal-sp>
</template>
</template>
</div>
</script>
<!-- Playlists / Albums --> <!-- Playlists / Albums -->
<%- include('pages/cider-playlist') %> <%- include('pages/cider-playlist') %>

View file

@ -61,7 +61,7 @@
<div class="playlist-time"> <div class="playlist-time">
{{data.attributes.releaseDate}} {{data.attributes.releaseDate}}
</div> </div>
<div class="playlist-time" @click="app.searchAndNavigate(data,'recordLabel') " style="width: 50%;"> <div class="playlist-time item-navigate" @click="app.searchAndNavigate(data,'recordLabel') " style="width: 50%;">
{{data.attributes.copyright}} {{data.attributes.copyright}}
</div> </div>
<div class="playlist-time">{{app.getTotalTime()}}</div> <div class="playlist-time">{{app.getTotalTime()}}</div>

View file

@ -0,0 +1,32 @@
<script type="text/x-template" id="cider-listen-now">
<div class="content-inner">
<h1 class="header-text">Listen Now</h1>
<template v-for="recom in data.data">
<div class="row">
<div class="col">
<h3>{{ recom.attributes.title ? recom.attributes.title.stringForDisplay : ""}}</h3>
</div>
<div class="col-auto flex-center" v-if="recom.relationships.contents.data.length >= 10">
<button class="cd-btn-seeall">See All</button>
</div>
</div>
<template v-if="recom.attributes.display.kind == 'MusicCoverShelf'">
<mediaitem-scroller-horizontal-large
:items="recom.relationships.contents.data.limit(10)"></mediaitem-scroller-horizontal-large>
</template>
<template v-else-if="recom.attributes.display.kind == 'MusicSuperHeroShelf'">
</template>
<template v-else>
<mediaitem-scroller-horizontal-sp
:items="recom.relationships.contents.data.limit(10)"></mediaitem-scroller-horizontal-sp>
</template>
</template>
</div>
</script>
<script>
Vue.component('cider-listen-now', {
template: "#cider-listen-now",
props: ["data"]
})
</script>

View file

@ -41,11 +41,11 @@
<div class="col"> <div class="col">
<h3>{{ data.views["top-releases"].attributes.title ?? ""}}</h3> <h3>{{ data.views["top-releases"].attributes.title ?? ""}}</h3>
</div> </div>
<div class="col-auto flex-center" v-if="data.views['latest-releases'].data.length >= 10"> <div class="col-auto flex-center" v-if="data.views['top-releases'].data.length >= 10">
<button class="cd-btn-seeall" @click="app.showRecordLabelView(data.id, data.attributes.name + ' - Top Releases', 'top-releases')">See All</button> <button class="cd-btn-seeall" @click="app.showRecordLabelView(data.id, data.attributes.name + ' - Top Releases', 'top-releases')">See All</button>
</div> </div>
</div> </div>
<mediaitem-square-large :item="item" v-for="item in data.views['latest-releases'].data"> <mediaitem-square-large :item="item" v-for="item in data.views['top-releases'].data">
</mediaitem-square-large> </mediaitem-square-large>
</div> </div>
</div> </div>