import{I as m}from"./ItemsListing-9290f7b8.js";import{I as b,_ as h}from"./ProviderDetails.vue_vue_type_script_setup_true_lang-c984c297.js";import{d as w,r as u,o as _,b as i,ac 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-dc4d9f26.js";import{x as B}from"./VListItem-65135f8c.js";import"./VCheckbox-f1104d05.js";import"./eventbus-a8c2de56.js";import"./VCheckboxBtn-3cfb51c2.js";import"./VList-4daf9b39.js";import"./VCardText-fea590bb.js";import"./VCard-299e9447.js";import"./VMenu-44fbbe6a.js";import"./_plugin-vue_export-helper-c27b6911.js";import"./ListItem-6e7890fa.js";import"./Button-d230f8d5.js";import"./VSpacer-cde6537e.js";/* empty css              */import"./PanelviewItemCompact-105c1437.js";import"./VAlert-562d62e3.js";import"./Container-43bdd9c6.js";import"./Toolbar-8f128710.js";import"./VToolbar-131f9d53.js";import"./VTextField-e3de4b3e.js";import"./VVirtualScroll-73f2affe.js";import"./VInfiniteScroll-da869181.js";import"./layout-64805198.js";import"./VDialog-f3c4aa9b.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};
