import{I as m}from"./ItemsListing-1e4c97cc.js";import{I as b,_ as h}from"./ProviderDetails.vue_vue_type_script_setup_true_lang-1e678135.js";import{d as w,r as u,o as _,b as a,ab as k,a as I,L as g,c as i,g as A,f as D,e as o,j as s,u as p,i as d,ar as c}from"./index-13cec455.js";import{x as B}from"./VListItem-3995941d.js";import"./ItemContextMenu.vue_vue_type_style_index_0_scoped_d4387993_lang-070a5f76.js";import"./eventbus-1a74ea4a.js";import"./VLabel-dc3f418b.js";import"./VList-a053873b.js";import"./VCardText-3285fd42.js";import"./VCard-7c0bc2b7.js";import"./VMenu-693c2219.js";import"./_plugin-vue_export-helper-c27b6911.js";import"./ListItem-359f4456.js";import"./Button-a9c1eb8e.js";import"./PanelviewItemCompact-ca3ca463.js";import"./VCheckboxBtn-deee0e68.js";import"./VSpacer-46ab8aa1.js";/* empty css              */import"./VAlert-3e4ba415.js";import"./Container-34b102f9.js";import"./Toolbar-c1a5714a.js";import"./VToolbar-be936393.js";import"./VTextField-59596a04.js";import"./VVirtualScroll-c6e56d95.js";import"./VInfiniteScroll-cb91c423.js";import"./layout-5b19be1f.js";import"./VDialog-d88e5297.js";const E=d("br",null,null,-1),T=d("br",null,null,-1),it=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 a.getArtist(r.itemId,r.provider),l.value=!1};_(()=>{if(r.provider=="library"){const e=a.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 a.getArtistAlbums(r.itemId,r.provider,e.libraryOnly)},v=async function(e){return await a.getArtistTracks(r.itemId,r.provider,e.libraryOnly)};return(e,M)=>(i(),A("section",null,[D(b,{item:t.value},null,8,["item"]),l.value?(i(),o(B,{key:0,indeterminate:""})):s("",!0),t.value?(i(),o(m,{key:1,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),E,t.value?(i(),o(m,{key:2,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),T,t.value?(i(),o(h,{key:3,"item-details":t.value},null,8,["item-details"])):s("",!0)]))}});export{it as default};
