import{I as m}from"./ItemsListing-2b5a8c5f.js";import{I as b,_ as h}from"./ProviderDetails.vue_vue_type_script_setup_true_lang-74f7ff1e.js";import{d as w,r as u,o as _,b as i,a8 as k,a as I,L as g,c as a,g as A,f as D,e as o,j as s,u as p,i as d,aq as c}from"./index-894ae36a.js";import{z as B}from"./VListItem-4174a915.js";import"./VCheckbox-4fd4d9b8.js";import"./eventbus-f225a5d6.js";import"./VCheckboxBtn-24370bba.js";import"./VList-48dd7d0f.js";import"./VCardText-f53aa54e.js";import"./VCard-3391db98.js";import"./VMenu-6b993280.js";import"./_plugin-vue_export-helper-c27b6911.js";import"./ListItem-8a38a33e.js";import"./Button-f6514084.js";import"./VSpacer-46dc65f8.js";/* empty css              */import"./PanelviewItemCompact-b99e3c0c.js";import"./VAlert-a768baba.js";import"./Container-0e8820c0.js";import"./Toolbar-43508ce0.js";import"./VToolbar-92b7b4d6.js";import"./VTextField-d7aa64d7.js";import"./VInfiniteScroll-3988a0eb.js";import"./layout-ca8c09ab.js";import"./VVirtualScroll-3adad00e.js";import"./VDialog-0a8de8a6.js";const E=d("br",null,null,-1),T=d("br",null,null,-1),rt=w({__name:"ArtistDetails",props:{itemId:{},provider:{}},setup(f){const r=f,t=u(),l=u(!1),n=async function(){l.value=!0,t.value=await i.getArtist(r.itemId,r.provider),l.value=!1};_(()=>{if(r.provider=="library"){const e=i.subscribe(k.MEDIA_ITEM_UPDATED,n,`library://artist/${r.itemId}`);I(e)}}),g(()=>r.itemId,e=>{e&&n()},{immediate:!0});const y=async function(e){return await i.getArtistAlbums(r.itemId,r.provider,e.libraryOnly)},v=async function(e){return await i.getArtistTracks(r.itemId,r.provider,e.libraryOnly)};return(e,M)=>(a(),A("section",null,[D(b,{item:t.value},null,8,["item"]),l.value?(a(),o(B,{key:0,indeterminate:""})):s("",!0),t.value?(a(),o(m,{key:1,itemtype:"artistalbums","parent-item":t.value,"show-provider":!0,"show-favorites-only-filter":!0,"show-library-only-filter":t.value.provider=="library"&&p(c)(t.value).length>0,"show-refresh-button":!1,"load-items":y,"sort-keys":["name","sort_name","year"],title:e.$t("albums"),"allow-collapse":!0},null,8,["parent-item","show-library-only-filter","title"])):s("",!0),E,t.value?(a(),o(m,{key:2,itemtype:"artisttracks","parent-item":t.value,"show-provider":!0,"show-favorites-only-filter":!0,"show-library-only-filter":t.value.provider=="library"&&p(c)(t.value).length>0,"show-refresh-button":!1,"show-track-number":!1,"load-items":v,"sort-keys":["name","sort_name","album"],title:e.$t("tracks"),"allow-collapse":!0},null,8,["parent-item","show-library-only-filter","title"])):s("",!0),T,t.value?(a(),o(h,{key:3,"item-details":t.value},null,8,["item-details"])):s("",!0)]))}});export{rt as default};
