mirror of
https://github.com/owntone/owntone-server.git
synced 2024-12-27 15:45:56 -05:00
2 lines
2.2 KiB
JavaScript
2 lines
2.2 KiB
JavaScript
import{C as g}from"./ContentWithHeading.js";import{G as p}from"./GroupByList.js";import{L as k}from"./ListAlbums.js";import{L as w}from"./ListTracks.js";import{T as v}from"./TabsMusic.js";import{_ as C,r as i,o as x,c as $,d as s,w as t,e as u,a as o,t as r,b as h}from"./index.js";import"./CoverArtwork.js";import"./ModalDialogAlbum.js";import"./spotify-web-api.js";const d={load(e){return Promise.all([u.search({type:"album",expression:"time_added after 8 weeks ago and media_kind is music having track_count > 3 order by time_added desc",limit:3}),u.search({type:"track",expression:"time_played after 8 weeks ago and media_kind is music order by time_played desc",limit:3})])},set(e,n){e.recently_added=new p(n[0].data.albums),e.recently_played=new p(n[1].data.tracks)}},L={name:"PageMusic",components:{ContentWithHeading:g,ListAlbums:k,ListTracks:w,TabsMusic:v},beforeRouteEnter(e,n,l){d.load(e).then(c=>{l(a=>d.set(a,c))})},beforeRouteUpdate(e,n,l){const c=this;d.load(e).then(a=>{d.set(c,a),l()})},data(){return{recently_added:[],recently_played:{items:[]},selected_track:{}}}},B={class:"fd-page-with-tabs"},T=["textContent"],M={class:"level"},N={class:"level-item"},P=["textContent"],V={class:"level"},E={class:"level-item"};function G(e,n,l,c,a,R){const f=i("tabs-music"),y=i("list-albums"),m=i("router-link"),_=i("content-with-heading"),b=i("list-tracks");return x(),$("div",B,[s(f),s(_,null,{"heading-left":t(()=>[o("p",{class:"title is-4",textContent:r(e.$t("page.music.recently-added.title"))},null,8,T)]),content:t(()=>[s(y,{albums:a.recently_added},null,8,["albums"])]),footer:t(()=>[o("nav",M,[o("p",N,[s(m,{class:"button is-light is-small is-rounded",to:{name:"music-recently-added"}},{default:t(()=>[h(r(e.$t("page.music.show-more")),1)]),_:1})])])]),_:1}),s(_,null,{"heading-left":t(()=>[o("p",{class:"title is-4",textContent:r(e.$t("page.music.recently-played.title"))},null,8,P)]),content:t(()=>[s(b,{tracks:a.recently_played},null,8,["tracks"])]),footer:t(()=>[o("nav",V,[o("p",E,[s(m,{class:"button is-light is-small is-rounded",to:{name:"music-recently-played"}},{default:t(()=>[h(r(e.$t("page.music.show-more")),1)]),_:1})])])]),_:1})])}const z=C(L,[["render",G]]);export{z as default};
|