import{I as d}from"./ItemsListing-6g08lefW.js";import{I as k,_ as g}from"./ProviderDetails.vue_vue_type_script_setup_true_lang-CjP5Q_wN.js";import{x as A,r as h,w as D,o as B,I as i,af as V,b as E,y as s,D as M,n as T,z as m,G as v,K as n,B as u}from"./index-CiFFF7gT.js";import{M as U}from"./MediaItemImages-BT9Sb0Ci.js";import"./ItemContextMenu.vue_vue_type_style_index_0_scoped_4409cede_lang-Z-tWQ5Xz.js";import"./ProviderIcon.vue_vue_type_script_setup_true_lang-DHkbc-Ta.js";import"./VListItem-De5QDDiQ.js";import"./VChip-BY-Tj5X5.js";import"./VList-ox5PnObc.js";import"./VCardText-DAFrt-9i.js";import"./VCard-OVRwQRVf.js";import"./VMenu-pCNX3_Sk.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./eventbus-CGRXT3Tn.js";import"./ListItem-DLjAZgMM.js";import"./VCheckbox-CjvWyEya.js";import"./VCheckboxBtn-BFRXrpB8.js";import"./VTooltip-DXDcYn3_.js";import"./VSpacer-ouclmOAP.js";/* empty css              */import"./PanelviewItemCompact-BLpiE-97.js";import"./Container-cMCd9Qd7.js";import"./VContainer-CuT7UpRw.js";import"./Toolbar-D7ssdDI_.js";import"./VToolbar-Cw0dLkzx.js";import"./VTextField-BPDkDfKc.js";import"./VInfiniteScroll-fVwyx_Ti.js";import"./layout-CZzu_XZd.js";import"./VRow-DJbzO2VZ.js";import"./VVirtualScroll-BganvpON.js";import"./VAlert-DvGaZwBF.js";import"./marquee_text_sync-BmlnKYdI.js";import"./VDialog-dHvRVqSU.js";const ut=A({__name:"ArtistDetails",props:{itemId:{},provider:{}},setup(f){const a=f,t=h(),y=async function(){t.value=await i.getArtist(a.itemId,a.provider)};D(()=>a.itemId,r=>{r&&y()},{immediate:!0}),B(()=>{const r=i.subscribe(V.MEDIA_ITEM_UPDATED,e=>{var l;const o=e.data;((l=t.value)==null?void 0:l.uri)==o.uri&&(t.value=o)});E(r)});const b=async function(r){return await i.getArtistAlbums(a.itemId,a.provider,r.libraryOnly)},w=async function(r){return await i.getArtistTracks(a.itemId,a.provider,r.libraryOnly)},c=async function(){t.value&&(t.value=await i.sendCommand("music/artists/update",{item_id:t.value.item_id,update:t.value,overwrite:!0}))};return(r,e)=>{var o,l,p;return s(),M("section",null,[T(k,{item:t.value},null,8,["item"]),t.value?(s(),m(d,{key:0,itemtype:"artistalbums","parent-item":t.value,"show-provider":!0,"show-favorites-only-filter":!0,"show-library-only-filter":t.value.provider=="library"&&v(i).hasStreamingProviders.value,"show-album-type-filter":!0,"show-refresh-button":!1,"load-items":b,"sort-keys":["name","sort_name","year"],title:r.$t("albums"),"allow-collapse":!0},null,8,["parent-item","show-library-only-filter","title"])):n("",!0),e[1]||(e[1]=u("br",null,null,-1)),t.value?(s(),m(d,{key:1,itemtype:"artisttracks","parent-item":t.value,"show-provider":!0,"show-favorites-only-filter":!0,"show-library-only-filter":t.value.provider=="library"&&v(i).hasStreamingProviders.value,"show-refresh-button":!1,"show-track-number":!1,"load-items":w,"sort-keys":["name","sort_name","album"],title:r.$t("tracks"),"allow-collapse":!0},null,8,["parent-item","show-library-only-filter","title"])):n("",!0),e[2]||(e[2]=u("br",null,null,-1)),((o=t.value)==null?void 0:o.provider)=="library"&&((p=(l=t.value)==null?void 0:l.metadata)!=null&&p.images)?(s(),m(U,{key:2,modelValue:t.value.metadata.images,"onUpdate:modelValue":[e[0]||(e[0]=I=>t.value.metadata.images=I),c]},null,8,["modelValue"])):n("",!0),e[3]||(e[3]=u("br",null,null,-1)),t.value?(s(),m(g,{key:3,"item-details":t.value},null,8,["item-details"])):n("",!0),e[4]||(e[4]=u("br",null,null,-1))])}}});export{ut as default};
