mirror of
https://github.com/owntone/owntone-server.git
synced 2025-01-14 08:15:02 -05:00
2 lines
2.7 KiB
JavaScript
2 lines
2.7 KiB
JavaScript
import{G as g,a as x}from"./GroupByList.js";import{C}from"./ContentWithHeading.js";import{I as y}from"./IndexButtonList.js";import{L as w}from"./ListAlbums.js";import{M as B}from"./ModalDialogGenre.js";import{_ as G,e as c,r as l,o as L,c as q,d as o,w as d,a as s,t as _}from"./index.js";import"./CoverArtwork.js";import"./ModalDialogAlbum.js";const u={load(e){return Promise.all([c.library_genre(e.params.name,e.query.media_kind),c.library_genre_albums(e.params.name,e.query.media_kind)])},set(e,n){e.genre=n[0].data,e.albums_list=new g(n[1].data.albums),e.albums_list.group(x("name_sort",!0))}},v={name:"PageGenreAlbums",components:{ContentWithHeading:C,IndexButtonList:y,ListAlbums:w,ModalDialogGenre:B},beforeRouteEnter(e,n,a){u.load(e).then(r=>{a(t=>u.set(t,r))})},beforeRouteUpdate(e,n,a){if(!this.albums_list.isEmpty()){a();return}const r=this;u.load(e).then(t=>{u.set(r,t),a()})},data(){return{albums_list:new g,genre:{},media_kind:this.$route.query.media_kind,show_details_modal:!1}},methods:{open_tracks(){this.show_details_modal=!1,this.$router.push({name:"genre-tracks",params:{name:this.genre.name},query:{media_kind:this.media_kind}})},play(){c.player_play_expression(`genre is "${this.genre.name}" and media_kind is ${this.media_kind}`,!0)}}},z=["textContent"],A={class:"buttons is-centered"},E=["textContent"],N={class:"heading has-text-centered-mobile"},P=["textContent"],D=s("span",null," | ",-1),I=["textContent"];function M(e,n,a,r,t,m){const h=l("index-button-list"),p=l("mdicon"),b=l("list-albums"),f=l("modal-dialog-genre"),k=l("content-with-heading");return L(),q("div",null,[o(k,null,{options:d(()=>[o(h,{index:t.albums_list.indexList},null,8,["index"])]),"heading-left":d(()=>[s("p",{class:"title is-4",textContent:_(t.genre.name)},null,8,z)]),"heading-right":d(()=>[s("div",A,[s("a",{class:"button is-small is-light is-rounded",onClick:n[0]||(n[0]=i=>t.show_details_modal=!0)},[o(p,{class:"icon",name:"dots-horizontal",size:"16"})]),s("a",{class:"button is-small is-dark is-rounded",onClick:n[1]||(n[1]=(...i)=>m.play&&m.play(...i))},[o(p,{class:"icon",name:"shuffle",size:"16"}),s("span",{textContent:_(e.$t("page.genre.shuffle"))},null,8,E)])])]),content:d(()=>[s("p",N,[s("span",{textContent:_(e.$t("page.genre.album-count",{count:t.genre.album_count}))},null,8,P),D,s("a",{class:"has-text-link",onClick:n[2]||(n[2]=(...i)=>m.open_tracks&&m.open_tracks(...i)),textContent:_(e.$t("page.genre.track-count",{count:t.genre.track_count}))},null,8,I)]),o(b,{albums:t.albums_list},null,8,["albums"]),o(f,{genre:t.genre,media_kind:t.media_kind,show:t.show_details_modal,onClose:n[3]||(n[3]=i=>t.show_details_modal=!1)},null,8,["genre","media_kind","show"])]),_:1})])}const F=G(v,[["render",M]]);export{F as default};
|