import{I as d}from"./ItemsListing-BPCoDFMa.js";import{I as k,_ as g}from"./ProviderDetails.vue_vue_type_script_setup_true_lang-C7zJx_G7.js";import{Q as _,x as A,w as h,o as D,a4 as i,aS as B,b as V,Z as E,B as M,R as m,a9 as n,W as u,a0 as v,S as s}from"./index-orrnp8a1.js";import{M as T}from"./MediaItemImages-BXS-t6M3.js";import"./MediaItemThumb-BFLLxiOJ.js";import"./ProviderIcon.vue_vue_type_style_index_0_lang-DgYavPcK.js";import"./VChip-DzIcRFdM.js";import"./VBtn-BJolvyKt.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./ListItem-BOpEb2vA.js";import"./VCheckbox-BaanYS4J.js";import"./VCheckboxBtn-CICj8ZxL.js";import"./PanelviewItemCompact-Bf1Qb2IB.js";import"./VSpacer-FMK5QbR9.js";/* empty css              */import"./Container-C-MxRHLg.js";import"./VContainer-DvR1uhzJ.js";import"./Toolbar-CE2HDv9i.js";import"./VToolbar-BlKUHnwt.js";import"./VTextField-DaF8PfrV.js";import"./VInfiniteScroll-CDme3Tib.js";import"./layout-BTr25AHs.js";import"./VRow-C4MwkXJh.js";import"./VVirtualScroll-Q9Rc10mA.js";import"./VAlert-BhQ3L7Kc.js";import"./marquee_text_sync-BWkPRIK0.js";import"./VDialog-oxeMlk6d.js";const ie=_({__name:"ArtistDetails",props:{itemId:{},provider:{}},setup(f){const a=f,e=A(),y=async function(){e.value=await i.getArtist(a.itemId,a.provider)};h(()=>a.itemId,r=>{r&&y()},{immediate:!0}),D(()=>{const r=i.subscribe(B.MEDIA_ITEM_UPDATED,t=>{var l;const o=t.data;((l=e.value)==null?void 0:l.uri)==o.uri&&(e.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(){e.value&&(e.value=await i.sendCommand("music/artists/update",{item_id:e.value.item_id,update:e.value,overwrite:!0}))};return(r,t)=>{var o,l,p;return s(),E("section",null,[M(k,{item:e.value},null,8,["item"]),e.value?(s(),m(d,{key:0,itemtype:"artistalbums","parent-item":e.value,"show-provider":!0,"show-favorites-only-filter":!0,"show-library-only-filter":e.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),t[1]||(t[1]=u("br",null,null,-1)),e.value?(s(),m(d,{key:1,itemtype:"artisttracks","parent-item":e.value,"show-provider":!0,"show-favorites-only-filter":!0,"show-library-only-filter":e.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),t[2]||(t[2]=u("br",null,null,-1)),((o=e.value)==null?void 0:o.provider)=="library"&&((p=(l=e.value)==null?void 0:l.metadata)!=null&&p.images)?(s(),m(T,{key:2,modelValue:e.value.metadata.images,"onUpdate:modelValue":[t[0]||(t[0]=I=>e.value.metadata.images=I),w]},null,8,["modelValue"])):n("",!0),t[3]||(t[3]=u("br",null,null,-1)),e.value?(s(),m(g,{key:3,"item-details":e.value},null,8,["item-details"])):n("",!0),t[4]||(t[4]=u("br",null,null,-1))])}}});export{ie as default};
