import{I as g}from"./InfoHeader-CoNYNcZm.js";import{I as v}from"./ItemsListing-DdSUpMhP.js";import{M as _}from"./MediaItemImages-RPHMZyGG.js";import{_ as k}from"./ProviderDetails.vue_vue_type_style_index_0_lang-CXtwfgiQ.js";import{a as l,E as h,h as A}from"./index-CKxLfxpS.js";import{d as D,w as M,o as E,r as f,a3 as V,b as B,J as T,G as n,K as u,f as m,u as p,e as s}from"./lucide-UY9XeFdQ.js";import"./Toolbar-Da01lZeW.js";import"./vuetify-C0IIhwYL.js";import"./marquee_text_sync-C4anEqYx.js";import"./vue-router-DNlH4vva.js";import"./MarqueeText-DvK0-Oq1.js";import"./MediaItemThumb-DiY2t3Gt.js";import"./ProviderIcon.vue_vue_type_style_index_0_lang-DYXAnx83.js";import"./vue-i18n-DwYfJ_fn.js";import"./Container-B1UOd5ED.js";import"./index-kQIztB-E.js";import"./userPreferences-BgjK7xB_.js";import"./Button-DdCpYaoc.js";import"./ListItem-BP0lui-9.js";import"./NowPlayingBadge.vue_vue_type_style_index_0_lang-CnaMVQug.js";import"./PanelviewItemCompact-BhrDAsYI.js";import"./color-CcshWhNz.js";import"./qrcode-CJNXjF_3.js";import"./marked-D9eDbhZJ.js";import"./vueuse-Dj-fx4H6.js";/* empty css            */import"./swiper-DNx4mJDO.js";const ie=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(_,{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(k,{key:3,"item-details":e.value},null,8,["item-details"])):u("",!0),r[4]||(r[4]=m("br",null,null,-1))]))}});export{ie as default};
