owntone-server/htdocs/assets/PageAudiobooksArtist.js
2023-12-14 20:00:28 +00:00

2 lines
2.0 KiB
JavaScript

import{C as w}from"./ContentWithHeading.js";import{G as b}from"./GroupByList.js";import{L as C}from"./ListAlbums.js";import{M as y}from"./ModalDialogArtist.js";import{_ as k,e as c,r as l,o as x,c as A,d as n,w as d,a as e,t as u}from"./index.js";import"./CoverArtwork.js";import"./ModalDialogAlbum.js";const r={load(t){return Promise.all([c.library_artist(t.params.id),c.library_artist_albums(t.params.id)])},set(t,s){t.artist=s[0].data,t.albums=new b(s[1].data)}},v={name:"PageAudiobooksArtist",components:{ContentWithHeading:w,ListAlbums:C,ModalDialogArtist:y},beforeRouteEnter(t,s,a){r.load(t).then(i=>{a(o=>r.set(o,i))})},beforeRouteUpdate(t,s,a){if(!this.albums.isEmpty()){a();return}const i=this;r.load(t).then(o=>{r.set(i,o),a()})},data(){return{artist:{},albums:new b,show_details_modal:!1}},methods:{play(){c.player_play_uri(this.albums.items.map(t=>t.uri).join(","),!1)}}},B=["textContent"],z={class:"buttons is-centered"},E=["textContent"],L=["textContent"];function P(t,s,a,i,o,p){const _=l("mdicon"),h=l("list-albums"),f=l("modal-dialog-artist"),g=l("content-with-heading");return x(),A("div",null,[n(g,null,{"heading-left":d(()=>[e("p",{class:"title is-4",textContent:u(o.artist.name)},null,8,B)]),"heading-right":d(()=>[e("div",z,[e("a",{class:"button is-small is-light is-rounded",onClick:s[0]||(s[0]=m=>o.show_details_modal=!0)},[n(_,{class:"icon",name:"dots-horizontal",size:"16"})]),e("a",{class:"button is-small is-dark is-rounded",onClick:s[1]||(s[1]=(...m)=>p.play&&p.play(...m))},[n(_,{class:"icon",name:"play",size:"16"}),e("span",{textContent:u(t.$t("page.audiobooks.artist.play"))},null,8,E)])])]),content:d(()=>[e("p",{class:"heading has-text-centered-mobile",textContent:u(t.$t("page.audiobooks.artist.album-count",{count:o.artist.album_count}))},null,8,L),n(h,{albums:o.albums},null,8,["albums"]),n(f,{show:o.show_details_modal,artist:o.artist,onClose:s[2]||(s[2]=m=>o.show_details_modal=!1)},null,8,["show","artist"])]),_:1})])}const H=k(v,[["render",P]]);export{H as default};