import{I as _,_ as g}from"./ProviderDetails.vue_vue_type_style_index_0_lang-EVW9t5c9.js";import{I as p}from"./ItemsListing-BZJJLqmd.js";import{M as k}from"./MediaItemImages-BS-mhHyL.js";import{c as l,E as h}from"./index-CD1lB0z0.js";import{d as A,r as v,w as D,o as E,a0 as M,b as V,e as s,H as B,D as n,I as u,f as m,u as f}from"./lucide-C2DU1LFb.js";import"./Toolbar-DAA91o26.js";import"./vuetify-RelkxOq-.js";import"./marquee_text_sync-C9LEoA8O.js";import"./vue-router-BgJK_hRC.js";import"./MediaItemThumb-izlR8vQb.js";import"./ProviderIcon.vue_vue_type_style_index_0_lang-DbzV_pTg.js";import"./Container-DHxo0BWd.js";import"./index-kQIztB-E.js";import"./ListItem-CsjqjtQ6.js";import"./Button-BdogkRK0.js";import"./vue-i18n-DySrp6mW.js";import"./utils-CDN07tui.js";import"./userPreferences-CmJn85i4.js";import"./NowPlayingBadge.vue_vue_type_style_index_0_lang-D7lqdhVg.js";import"./PanelviewItemCompact-DzzjHTDr.js";import"./qrcode-DSFhiIp2.js";import"./marked-C0Rlrcoy.js";import"./color-BTziYnFN.js";import"./vueuse-DIaEWNCo.js";/* empty css            */import"./swiper-Jy9GbtzK.js";const re=A({__name:"ArtistDetails",props:{itemId:{},provider:{}},setup(y){const a=y,e=v(),i=v(!1),c=async function(){i.value=!0,e.value=await l.getArtist(a.itemId,a.provider),i.value=!1};D(()=>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}}});M(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(),V("section",null,[B(_,{item:e.value},null,8,["item"]),e.value&&!i.value?(s(),n(p,{key:0,itemtype:"artistalbums","parent-item":e.value,"show-provider":!0,"show-favorites-only-filter":!0,"show-library-only-filter":e.value.provider=="library"&&f(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(p,{key:1,itemtype:"artisttracks","parent-item":e.value,"show-provider":!0,"show-favorites-only-filter":!0,"show-library-only-filter":e.value.provider=="library"&&f(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?(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(g,{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};
