import{I as m}from"./ItemsListing-4e050c6c.js";import{I as b,_ as h}from"./ProviderDetails.vue_vue_type_script_setup_true_lang-89045d01.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,ar as c}from"./index-5eb5c9ac.js";import{z as B}from"./VListItem-b9a4cfb8.js";import"./VCheckbox-2a28a1cd.js";import"./eventbus-4894d390.js";import"./VCheckboxBtn-cb68b622.js";import"./VList-13fa461d.js";import"./VCardText-1810bf8a.js";import"./VCard-cb863c33.js";import"./VMenu-4088b2e7.js";import"./_plugin-vue_export-helper-c27b6911.js";import"./ListItem-7b05ebf9.js";import"./Button-64160646.js";import"./VSpacer-81b0afbb.js";/* empty css              */import"./PanelviewItemCompact-4dc20236.js";import"./VAlert-12c553a2.js";import"./Container-1fa5169e.js";import"./Toolbar-6cac4d7d.js";import"./VToolbar-77830c55.js";import"./VTextField-574f2a77.js";import"./VInfiniteScroll-61b7ed02.js";import"./layout-2c007cef.js";import"./VVirtualScroll-5ee5768d.js";import"./VDialog-480c2f48.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};
