import{I as d}from"./ItemsListing-BxIggw9V.js";import{I as k,_ as g}from"./ProviderDetails.vue_vue_type_script_setup_true_lang-g1x4dXOC.js";import{x as _,r as A,w as h,o as D,I as i,ah as B,b as V,y as s,D as E,n as M,z as m,G as v,K as n,B as u}from"./index-Dvn4b3kE.js";import{M as T}from"./MediaItemImages-Oh2zOTx0.js";import"./ItemContextMenu.vue_vue_type_style_index_0_scoped_3a9a25e3_lang-C3noc3qK.js";import"./ProviderIcon.vue_vue_type_style_index_0_lang-CxRRSRNY.js";import"./VListItem-XlHdRn90.js";import"./VChip-BKGA7XXZ.js";import"./VList-BFxH2oe3.js";import"./VMenu-BxZEtUbH.js";import"./VCard-DDEjK8sh.js";import"./VCardText-CXkKR7ML.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./eventbus-CGRXT3Tn.js";import"./ListItem-CqruFv9t.js";import"./VCheckbox-DXoKCkvo.js";import"./VCheckboxBtn-B2R62I44.js";import"./VSpacer-BpjLI35r.js";/* empty css              */import"./PanelviewItemCompact-CceVDOrI.js";import"./Container-DWavih6c.js";import"./VContainer-C3X0IHcx.js";import"./Toolbar-XsObLWPI.js";import"./VToolbar-Bi9Fkevh.js";import"./VTextField-CNfw_aKz.js";import"./VInfiniteScroll-DgELJAW0.js";import"./layout-BesXh2w9.js";import"./VRow-PHUs5bQJ.js";import"./VVirtualScroll-DezxvIhI.js";import"./VAlert-BKHMgC3s.js";import"./marquee_text_sync-BDoUCDrB.js";import"./VDialog-CHkPjb9d.js";const nt=_({__name:"ArtistDetails",props:{itemId:{},provider:{}},setup(y){const a=y,t=A(),f=async function(){t.value=await i.getArtist(a.itemId,a.provider)};h(()=>a.itemId,r=>{r&&f()},{immediate:!0}),D(()=>{const r=i.subscribe(B.MEDIA_ITEM_UPDATED,e=>{var l;const o=e.data;((l=t.value)==null?void 0:l.uri)==o.uri&&(t.value=o)});V(r)});const b=async function(r){return await i.getArtistAlbums(a.itemId,a.provider,r.libraryOnly)},c=async function(r){return await i.getArtistTracks(a.itemId,a.provider,r.libraryOnly)},w=async function(){t.value&&(t.value=await i.sendCommand("music/artists/update",{item_id:t.value.item_id,update:t.value,overwrite:!0}))};return(r,e)=>{var o,l,p;return s(),E("section",null,[M(k,{item:t.value},null,8,["item"]),t.value?(s(),m(d,{key:0,itemtype:"artistalbums","parent-item":t.value,"show-provider":!0,"show-favorites-only-filter":!0,"show-library-only-filter":t.value.provider=="library"&&v(i).hasStreamingProviders.value,"show-album-type-filter":!0,"show-refresh-button":!1,"load-items":b,"sort-keys":["name","sort_name","year","name_desc","sort_name_desc","year_desc"],title:r.$t("albums"),"allow-collapse":!0},null,8,["parent-item","show-library-only-filter","title"])):n("",!0),e[1]||(e[1]=u("br",null,null,-1)),t.value?(s(),m(d,{key:1,itemtype:"artisttracks","parent-item":t.value,"show-provider":!0,"show-favorites-only-filter":!0,"show-library-only-filter":t.value.provider=="library"&&v(i).hasStreamingProviders.value,"show-refresh-button":!1,"show-track-number":!1,"load-items":c,"sort-keys":["name","sort_name","album","duration","name_desc","sort_name_desc","duration_desc","original"],title:r.$t("tracks"),"allow-collapse":!0},null,8,["parent-item","show-library-only-filter","title"])):n("",!0),e[2]||(e[2]=u("br",null,null,-1)),((o=t.value)==null?void 0:o.provider)=="library"&&((p=(l=t.value)==null?void 0:l.metadata)!=null&&p.images)?(s(),m(T,{key:2,modelValue:t.value.metadata.images,"onUpdate:modelValue":[e[0]||(e[0]=I=>t.value.metadata.images=I),w]},null,8,["modelValue"])):n("",!0),e[3]||(e[3]=u("br",null,null,-1)),t.value?(s(),m(g,{key:3,"item-details":t.value},null,8,["item-details"])):n("",!0),e[4]||(e[4]=u("br",null,null,-1))])}}});export{nt as default};
