import{I as g,_}from"./ProviderDetails.vue_vue_type_style_index_0_lang-HqgSfLq6.js";import{I as v}from"./ItemsListing-eSLlPoYA.js";import{M as k}from"./MediaItemImages-C_XCU1fp.js";import{f as l,E as h,b as A}from"./index-Bd8s4WQO.js";import{d as D,w as M,o as E,r as f,a0 as V,b as B,H as T,D as n,I as u,f as m,u as p,e as s}from"./lucide-CoF0tLOi.js";import"./Toolbar-Csr2CvSB.js";import"./vuetify-DvOJDL5n.js";import"./marquee_text_sync-QFLmjwSA.js";import"./vue-router-BnXzVtNF.js";import"./MediaItemThumb-g0UR8j3I.js";import"./ProviderIcon.vue_vue_type_style_index_0_lang-CShmTH81.js";import"./Container-DJxyjctr.js";import"./index-kQIztB-E.js";import"./ListItem-DttNdje3.js";import"./Button-_r-XHGLU.js";import"./vue-i18n-Byo65gUq.js";import"./userPreferences-Bdne_Wm-.js";import"./NowPlayingBadge.vue_vue_type_style_index_0_lang-ZhN3thdv.js";import"./PanelviewItemCompact-CJHiqs4T.js";import"./qrcode-BbZu2DL4.js";import"./marked-D2lEcfQr.js";import"./color-BTziYnFN.js";import"./vueuse-uADb4LNz.js";/* empty css            */import"./swiper-CgqcFf1y.js";const re=D({__name:"ArtistDetails",props:{itemId:{},provider:{}},setup(y){const a=y,e=f(),i=f(!1),b=async function(){i.value=!0,e.value=await l.getArtist(a.itemId,a.provider),i.value=!1};M(()=>a.itemId,t=>{t&&b()},{immediate:!0}),E(()=>{const t=l.subscribe(h.MEDIA_ITEM_UPDATED,r=>{const o=r.data;if(e.value?.uri==o.uri)i.value=!0,e.value=o,i.value=!1;else if("provider_mappings"in o){for(const d of o.provider_mappings)if(d.item_id==a.itemId&&[d.provider_instance,d.provider_domain].includes(a.provider)){i.value=!0,e.value=o,i.value=!1;break}}});V(t)});const c=async function(t){return await l.getArtistAlbums(a.itemId,a.provider,t.libraryOnly)},w=async function(t){return await l.getArtistTracks(a.itemId,a.provider,t.libraryOnly,t.provider&&t.provider.length>0?t.provider:void 0)},I=async function(){e.value&&(e.value=await l.sendCommand("music/artists/update",{item_id:e.value.item_id,update:e.value,overwrite:!0}))};return(t,r)=>(s(),B("section",null,[T(g,{item:e.value},null,8,["item"]),e.value&&!i.value?(s(),n(v,{key:0,itemtype:"artistalbums","parent-item":e.value,"show-provider":!0,"show-favorites-only-filter":!0,"show-library-only-filter":e.value.provider=="library"&&p(l).hasStreamingProviders.value,"show-album-type-filter":!0,"show-refresh-button":!1,"load-items":c,"sort-keys":["name","sort_name","year","name_desc","sort_name_desc","year_desc"],title:t.$t("albums"),"allow-collapse":!0},null,8,["parent-item","show-library-only-filter","title"])):u("",!0),r[1]||(r[1]=m("br",null,null,-1)),e.value&&!i.value?(s(),n(v,{key:1,itemtype:"artisttracks","parent-item":e.value,"show-provider":!0,"show-favorites-only-filter":!0,"show-library-only-filter":e.value.provider=="library"&&p(l).hasStreamingProviders.value,"show-provider-filter":e.value.provider=="library","show-refresh-button":!1,"show-track-number":!1,"load-items":w,"sort-keys":["original","name","sort_name","album","duration","name_desc","sort_name_desc","duration_desc"],title:t.$t("tracks"),"allow-collapse":!0},null,8,["parent-item","show-library-only-filter","show-provider-filter","title"])):u("",!0),r[2]||(r[2]=m("br",null,null,-1)),e.value?.provider=="library"&&e.value?.metadata?.images&&p(A).isAdmin()?(s(),n(k,{key:2,modelValue:e.value.metadata.images,"onUpdate:modelValue":[r[0]||(r[0]=o=>e.value.metadata.images=o),I]},null,8,["modelValue"])):u("",!0),r[3]||(r[3]=m("br",null,null,-1)),e.value?(s(),n(_,{key:3,"item-details":e.value},null,8,["item-details"])):u("",!0),r[4]||(r[4]=m("br",null,null,-1))]))}});export{re as default};
