import{I as d}from"./ItemsListing-d367002d.js";import{I as _,_ as I}from"./ProviderDetails.vue_vue_type_script_setup_true_lang-7a08d984.js";import{d as k,r as g,N as A,o as D,b as a,a7 as V,a as B,c as l,g as E,f as M,e as m,u as c,j as n,i as u}from"./index-5e5d70f8.js";import{M as T}from"./MediaItemImages-2805d4e0.js";import"./VCheckbox-e50bb5e3.js";import"./eventbus-5e9bd59e.js";import"./VListItem-a276ed14.js";import"./VCheckboxBtn-d41d6adf.js";import"./VList-1bffb8df.js";import"./VCardText-bdfad4e5.js";import"./VCard-35632c3b.js";import"./VMenu-4ca080f5.js";import"./_plugin-vue_export-helper-c27b6911.js";import"./ListItem-f9f543a5.js";import"./Button-558e640e.js";import"./VSpacer-3df5a092.js";/* empty css              */import"./PanelviewItemCompact-5dcada9d.js";import"./VAlert-8c135db5.js";import"./Container-39ff39e9.js";import"./Toolbar-9ec9e26d.js";import"./VToolbar-c09ee689.js";import"./VTextField-fa7e9a48.js";import"./VInfiniteScroll-01a7fa67.js";import"./layout-41b62dfb.js";import"./VVirtualScroll-a35573be.js";import"./VDialog-8fad6ca7.js";const N=u("br",null,null,-1),U=u("br",null,null,-1),C=u("br",null,null,-1),P=u("br",null,null,-1),me=k({__name:"ArtistDetails",props:{itemId:{},provider:{}},setup(v){const r=v,e=g(),f=async function(){e.value=await a.getArtist(r.itemId,r.provider)};A(()=>r.itemId,t=>{t&&f()},{immediate:!0}),D(()=>{const t=a.subscribe(V.MEDIA_ITEM_UPDATED,s=>{var o;const i=s.data;((o=e.value)==null?void 0:o.uri)==i.uri&&(e.value=i)});B(t)});const y=async function(t){return await a.getArtistAlbums(r.itemId,r.provider,t.libraryOnly)},b=async function(t){return await a.getArtistTracks(r.itemId,r.provider,t.libraryOnly)},h=async function(){e.value&&(e.value=await a.sendCommand("music/artists/update",{item_id:e.value.item_id,update:e.value,overwrite:!0}))};return(t,s)=>{var i,o,p;return l(),E("section",null,[M(_,{item:e.value},null,8,["item"]),e.value?(l(),m(d,{key:0,itemtype:"artistalbums","parent-item":e.value,"show-provider":!0,"show-favorites-only-filter":!0,"show-library-only-filter":e.value.provider=="library"&&c(a).hasStreamingProviders.value,"show-album-type-filter":!0,"show-refresh-button":!1,"load-items":y,"sort-keys":["name","sort_name","year"],title:t.$t("albums"),"allow-collapse":!0},null,8,["parent-item","show-library-only-filter","title"])):n("",!0),N,e.value?(l(),m(d,{key:1,itemtype:"artisttracks","parent-item":e.value,"show-provider":!0,"show-favorites-only-filter":!0,"show-library-only-filter":e.value.provider=="library"&&c(a).hasStreamingProviders.value,"show-refresh-button":!1,"show-track-number":!1,"load-items":b,"sort-keys":["name","sort_name","album"],title:t.$t("tracks"),"allow-collapse":!0},null,8,["parent-item","show-library-only-filter","title"])):n("",!0),U,((i=e.value)==null?void 0:i.provider)=="library"&&((p=(o=e.value)==null?void 0:o.metadata)!=null&&p.images)?(l(),m(T,{key:2,modelValue:e.value.metadata.images,"onUpdate:modelValue":[s[0]||(s[0]=w=>e.value.metadata.images=w),h]},null,8,["modelValue"])):n("",!0),C,e.value?(l(),m(I,{key:3,"item-details":e.value},null,8,["item-details"])):n("",!0),P])}}});export{me as default};
