import{I as m}from"./ItemsListing-496384e5.js";import{I as b,_ as h}from"./ProviderDetails.vue_vue_type_script_setup_true_lang-54af6448.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,aq as c}from"./index-bf0eaf20.js";import{x as B}from"./VListItem-223b492d.js";import"./ItemContextMenu.vue_vue_type_style_index_0_scoped_d4387993_lang-b7e5044b.js";import"./eventbus-b340f869.js";import"./VLabel-e07a3413.js";import"./VList-21e2a257.js";import"./VCardText-8a9fa9c7.js";import"./VCard-97256dbd.js";import"./VMenu-71b97cab.js";import"./_plugin-vue_export-helper-c27b6911.js";import"./ListItem-b1725b5d.js";import"./Button-574f04d4.js";import"./PanelviewItemCompact-cb3303f4.js";import"./VCheckboxBtn-f3296201.js";import"./VSpacer-36b6f8a9.js";/* empty css              */import"./VAlert-e2b3a5a6.js";import"./Container-88f21350.js";import"./Toolbar-1985c49b.js";import"./VToolbar-219721ba.js";import"./VTextField-ad1ef579.js";import"./VVirtualScroll-837eb7b9.js";import"./VInfiniteScroll-71aa3856.js";import"./layout-8db27034.js";import"./VDialog-18e61467.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};
