import{I as d}from"./ItemsListing-e7c9377b.js";import{I,_ as g}from"./ProviderDetails.vue_vue_type_script_setup_true_lang-612520ab.js";import{d as k,r as A,N as D,o as M,b as o,a7 as V,a as B,c as l,g as E,f as T,e as m,u as c,j as n,i as u}from"./index-e34071c2.js";import{M as N}from"./MediaItemImages-fce46884.js";import{m as v}from"./VCheckbox-081529bb.js";import"./eventbus-edb4a70e.js";import"./VListItem-6fb16d04.js";import"./ListItem-f09faddc.js";import"./Button-d52131a6.js";import"./_plugin-vue_export-helper-c27b6911.js";import"./VMenu-8ea0aa0a.js";import"./VCard-0f63f60c.js";import"./VCardText-2a290ffe.js";import"./VSpacer-b7ae4876.js";/* empty css              */import"./PanelviewItemCompact-8de8744a.js";import"./VAlert-cd8a958f.js";import"./Container-1af89f37.js";import"./Toolbar-bbf3d11a.js";import"./VList-5a526902.js";import"./VToolbar-790d92bd.js";import"./VTextField-df721147.js";import"./VCheckboxBtn-43c6a5b9.js";import"./VInfiniteScroll-311fcdfe.js";import"./layout-4fa46c33.js";import"./VVirtualScroll-8b839030.js";import"./VDialog-57dacf99.js";const U=u("br",null,null,-1),C=u("br",null,null,-1),$=u("br",null,null,-1),O=u("br",null,null,-1),ne=k({__name:"ArtistDetails",props:{itemId:{},provider:{}},setup(f){const r=f,e=A(),y=async function(){e.value=await o.getArtist(r.itemId,r.provider)};D(()=>r.itemId,t=>{t&&y()},{immediate:!0}),M(()=>{const t=o.subscribe(V.MEDIA_ITEM_UPDATED,s=>{var i;const a=s.data;((i=e.value)==null?void 0:i.uri)==a.uri&&(e.value=a)});B(t)});const b=async function(t){return await o.getArtistAlbums(r.itemId,r.provider,t.libraryOnly)},h=async function(t){return await o.getArtistTracks(r.itemId,r.provider,t.libraryOnly)},w=async function(){e.value&&(e.value=await o.sendCommand("music/artists/update",{item_id:e.value.item_id,update:e.value,overwrite:!0}))};return(t,s)=>{var a,i,p;return l(),E("section",null,[T(I,{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(v)(e.value).length>0,"show-album-type-filter":!0,"show-refresh-button":!1,"load-items":b,"sort-keys":["name","sort_name","year"],title:t.$t("albums"),"allow-collapse":!0},null,8,["parent-item","show-library-only-filter","title"])):n("",!0),U,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(v)(e.value).length>0,"show-refresh-button":!1,"show-track-number":!1,"load-items":h,"sort-keys":["name","sort_name","album"],title:t.$t("tracks"),"allow-collapse":!0},null,8,["parent-item","show-library-only-filter","title"])):n("",!0),C,((a=e.value)==null?void 0:a.provider)=="library"&&((p=(i=e.value)==null?void 0:i.metadata)!=null&&p.images)?(l(),m(N,{key:2,modelValue:e.value.metadata.images,"onUpdate:modelValue":[s[0]||(s[0]=_=>e.value.metadata.images=_),w]},null,8,["modelValue"])):n("",!0),$,e.value?(l(),m(g,{key:3,"item-details":e.value},null,8,["item-details"])):n("",!0),O])}}});export{ne as default};
