import{I as n}from"./ItemsListing-ffc2935e.js";import{I as y,_ as b}from"./ProviderDetails.vue_vue_type_script_setup_true_lang-f8349cea.js";import{d as v,r as h,o as w,b as i,ab as _,a as k,L as I,c as a,g,f as A,e as o,u as m,j as s,i as u,aq as p}from"./index-8e7daee8.js";import"./ItemContextMenu.vue_vue_type_style_index_0_scoped_d4387993_lang-755a1a8b.js";import"./eventbus-d39a7847.js";import"./VListItem-09460541.js";import"./VLabel-46f0710d.js";import"./VList-ca6176f0.js";import"./VCard-990eebd4.js";import"./VCardText-a5e6d4d4.js";import"./VMenu-64e96597.js";import"./_plugin-vue_export-helper-c27b6911.js";import"./ListItem-b626b3fa.js";import"./Button-caab2d1b.js";import"./PanelviewItemCompact-2d9663c1.js";import"./VCheckboxBtn-1b20bfe7.js";import"./VSpacer-28a82c5a.js";/* empty css              */import"./VAlert-fd6ed822.js";import"./Container-0d470ed8.js";import"./Toolbar-e48261c7.js";import"./VToolbar-645a3ba3.js";import"./VTextField-12379bad.js";import"./VVirtualScroll-01e39aac.js";import"./VInfiniteScroll-40f31e12.js";import"./layout-a17f5af6.js";import"./VDialog-1c9bf8d5.js";const D=u("br",null,null,-1),B=u("br",null,null,-1),et=v({__name:"ArtistDetails",props:{itemId:{},provider:{}},setup(c){const r=c,t=h(),l=async function(){t.value=await i.getArtist(r.itemId,r.provider)};w(()=>{if(r.provider=="library"){const e=i.subscribe(_.MEDIA_ITEM_UPDATED,l,`library://artist/${r.itemId}`);k(e)}}),I(()=>r.itemId,e=>{e&&l()},{immediate:!0});const d=async function(e){return await i.getArtistAlbums(r.itemId,r.provider,e.libraryOnly)},f=async function(e){return await i.getArtistTracks(r.itemId,r.provider,e.libraryOnly)};return(e,E)=>(a(),g("section",null,[A(y,{item:t.value},null,8,["item"]),t.value?(a(),o(n,{key:0,itemtype:"artisttracks","parent-item":t.value,"show-provider":!0,"show-favorites-only-filter":!0,"show-library-only-filter":t.value.provider=="library"&&m(p)(t.value).length>0,"show-refresh-button":!1,"show-track-number":!1,"load-items":f,"sort-keys":["name","sort_name","album"],title:e.$t("tracks"),"allow-collapse":!0},null,8,["parent-item","show-library-only-filter","title"])):s("",!0),D,t.value?(a(),o(n,{key:1,itemtype:"artistalbums","parent-item":t.value,"show-provider":!0,"show-favorites-only-filter":!0,"show-library-only-filter":t.value.provider=="library"&&m(p)(t.value).length>0,"show-refresh-button":!1,"load-items":d,"sort-keys":["name","sort_name","year"],title:e.$t("albums"),"allow-collapse":!0},null,8,["parent-item","show-library-only-filter","title"])):s("",!0),B,t.value?(a(),o(b,{key:2,"item-details":t.value},null,8,["item-details"])):s("",!0)]))}});export{et as default};
