import{I as _,_ as k}from"./ProviderDetails.vue_vue_type_style_index_0_lang-IDW8d92N.js";import{I as p}from"./ItemsListing-Dd2XfzXe.js";import{M as g}from"./MediaItemImages-D9CnITgu.js";import{c as o,E as A}from"./index-HFEfURXv.js";import{d as h,r as v,w as D,o as B,a1 as E,b as M,e as s,H as V,D as n,I as m,f as u,B as f}from"./lucide-sS6c3snl.js";import"./Toolbar-BVGuuXVD.js";import"./vuetify-ffr1lJCG.js";import"./marquee_text_sync-BgCfvceK.js";import"./vue-router-CDtPtBGv.js";import"./MediaItemThumb-D4l-2_B4.js";import"./Container-LvH0QRIT.js";import"./index-kQIztB-E.js";import"./ListItem-C-8fkaRP.js";import"./Button-Dcdmvtuy.js";import"./vue-i18n-h4EBIvPF.js";import"./NowPlayingBadge.vue_vue_type_style_index_0_lang-Bgx2hOXi.js";import"./PanelviewItemCompact-PrcYkefq.js";import"./userPreferences-CRnDt302.js";import"./qrcode-Dq-byqKu.js";import"./marked-C0Rlrcoy.js";import"./color-BTziYnFN.js";import"./vueuse-B-HgI0gk.js";/* empty css            */import"./swiper-BtP4dEja.js";const ee=h({__name:"ArtistDetails",props:{itemId:{},provider:{}},setup(y){const a=y,e=v(),i=v(!1),c=async function(){i.value=!0,e.value=await o.getArtist(a.itemId,a.provider),i.value=!1};D(()=>a.itemId,r=>{r&&c()},{immediate:!0}),B(()=>{const r=o.subscribe(A.MEDIA_ITEM_UPDATED,t=>{const l=t.data;if(e.value?.uri==l.uri)i.value=!0,e.value=l,i.value=!1;else if("provider_mappings"in l){for(const d of l.provider_mappings)if(d.item_id==a.itemId&&[d.provider_instance,d.provider_domain].includes(a.provider)){i.value=!0,e.value=l,i.value=!1;break}}});E(r)});const b=async function(r){return await o.getArtistAlbums(a.itemId,a.provider,r.libraryOnly)},w=async function(r){return await o.getArtistTracks(a.itemId,a.provider,r.libraryOnly)},I=async function(){e.value&&(e.value=await o.sendCommand("music/artists/update",{item_id:e.value.item_id,update:e.value,overwrite:!0}))};return(r,t)=>(s(),M("section",null,[V(_,{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(o).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"])):m("",!0),t[1]||(t[1]=u("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(o).hasStreamingProviders.value,"show-refresh-button":!1,"show-track-number":!1,"load-items":w,"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"])):m("",!0),t[2]||(t[2]=u("br",null,null,-1)),e.value?.provider=="library"&&e.value?.metadata?.images?(s(),n(g,{key:2,modelValue:e.value.metadata.images,"onUpdate:modelValue":[t[0]||(t[0]=l=>e.value.metadata.images=l),I]},null,8,["modelValue"])):m("",!0),t[3]||(t[3]=u("br",null,null,-1)),e.value?(s(),n(k,{key:3,"item-details":e.value},null,8,["item-details"])):m("",!0),t[4]||(t[4]=u("br",null,null,-1))]))}});export{ee as default};
