import{I as g}from"./InfoHeader-uBOILYEb.js";import{I as v}from"./ItemsListing-tv0MCfCt.js";import{M as _}from"./MediaItemImages-uqlqFUdO.js";import{_ as k}from"./ProviderDetails.vue_vue_type_style_index_0_lang-CZPyJoKH.js";import{a as l,E as h,h as A}from"./index-DFsvNGMK.js";import{d as D,w as M,o as E,r as f,a3 as V,c as B,J as T,G as n,K as u,e as m,u as p,b as s}from"./lucide-QuZxnyEP.js";import"./Toolbar-DvJMwEJ8.js";import"./vuetify-B_F86YZH.js";import"./marquee_text_sync-C4anEqYx.js";import"./vue-router-CxwhF-Fu.js";import"./MarqueeText-DvsjDPzt.js";import"./MediaItemThumb-B0DrXGrj.js";import"./ProviderIcon.vue_vue_type_style_index_0_lang-CobywSL7.js";import"./vue-i18n-B4TVUx2E.js";import"./Container-EEqhEgFq.js";import"./index-kQIztB-E.js";import"./userPreferences-BbXQ6vrI.js";import"./Button-CEvukW2c.js";import"./ListItem-CQfcc1NO.js";import"./NowPlayingBadge.vue_vue_type_style_index_0_lang-CMGcB0b3.js";import"./PanelviewItemCompact-D6GUmvKm.js";import"./qrcode-DeEMoxKC.js";import"./marked-D9eDbhZJ.js";import"./color-CqFg8eif.js";import"./vueuse-B39J0AFQ.js";/* empty css            */import"./swiper-G_BHPAhK.js";const ie=D({__name:"ArtistDetails",props:{itemId:{},provider:{}},setup(y){const a=y,e=f(),i=f(!1),c=async function(){i.value=!0,e.value=await l.getArtist(a.itemId,a.provider),i.value=!1};M(()=>a.itemId,t=>{t&&c()},{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 b=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":b,"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};
