import{I as n}from"./ItemsListing-f772417c.js";import{I as y,_ as v}from"./ProviderDetails.vue_vue_type_script_setup_true_lang-09daad1c.js";import{d as b,r as h,o as w,b as i,a6 as _,a as k,L as I,c as o,g,f as A,e as a,u as m,j as s,i as p}from"./index-fef80a0b.js";import{o as u}from"./utils-12666f6b.js";import"./eventbus-771fa739.js";import"./VListItem-ffbd5641.js";import"./ListItem-0b81466a.js";import"./Button-8bcfa9cb.js";import"./_plugin-vue_export-helper-c27b6911.js";import"./VTextField-78aee9b7.js";import"./VVirtualScroll-8fc6e2a1.js";import"./VMenu-fbaa74ce.js";import"./VCard-c054bc7f.js";import"./VCardText-6ea04424.js";import"./VSpacer-3e41f36f.js";/* empty css              */import"./VAlert-ca55d6e3.js";import"./Container-eb2e118f.js";import"./Toolbar-7a96321e.js";import"./VList-5ec4033f.js";import"./VToolbar-82238121.js";import"./VInfiniteScroll-0016ce41.js";import"./layout-58a35fd6.js";import"./VDialog-36d910a1.js";import"./VChip-c36452fb.js";const D=p("br",null,null,-1),B=p("br",null,null,-1),Z=b({__name:"ArtistDetails",props:{itemId:{},provider:{}},setup(c){const r=c,t=h(),l=async function(){t.value=await i.getArtist(r.itemId,r.provider)};w(()=>{if(r.provider=="library"){const e=i.subscribe(_.MEDIA_ITEM_UPDATED,l,`library://artist/${r.itemId}`);k(e)}}),I(()=>r.itemId,e=>{e&&l()},{immediate:!0});const d=async function(e){return await i.getArtistAlbums(r.itemId,r.provider,e.libraryOnly)},f=async function(e){return await i.getArtistTracks(r.itemId,r.provider,e.libraryOnly)};return(e,E)=>(o(),g("section",null,[A(y,{item:t.value},null,8,["item"]),t.value?(o(),a(n,{key:0,itemtype:"artisttracks","parent-item":t.value,"show-provider":!0,"show-favorites-only-filter":!0,"show-library-only-filter":t.value.provider=="library"&&m(u)(t.value).length>0,"show-refresh-button":!1,"show-track-number":!1,"load-items":f,"sort-keys":["name","sort_name","album"],title:e.$t("tracks"),"allow-collapse":!0},null,8,["parent-item","show-library-only-filter","title"])):s("",!0),D,t.value?(o(),a(n,{key:1,itemtype:"artistalbums","parent-item":t.value,"show-provider":!0,"show-favorites-only-filter":!0,"show-library-only-filter":t.value.provider=="library"&&m(u)(t.value).length>0,"show-refresh-button":!1,"load-items":d,"sort-keys":["name","sort_name","year"],title:e.$t("albums"),"allow-collapse":!0},null,8,["parent-item","show-library-only-filter","title"])):s("",!0),B,t.value?(o(),a(v,{key:2,"item-details":t.value},null,8,["item-details"])):s("",!0)]))}});export{Z as default};
