import{I as d}from"./ItemsListing-52fc3de5.js";import{I,_ as g}from"./ProviderDetails.vue_vue_type_script_setup_true_lang-a2e0c1f9.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-af8b7753.js";import{M as N}from"./MediaItemImages-722fe6c3.js";import{m as v}from"./VCheckbox-e055872e.js";import"./eventbus-3080c6de.js";import"./VListItem-0186c915.js";import"./ListItem-6ec3b906.js";import"./Button-b1542585.js";import"./_plugin-vue_export-helper-c27b6911.js";import"./VMenu-cf6ae0bc.js";import"./VCard-4405819f.js";import"./VCardText-b2843211.js";import"./VSpacer-a83ddbc5.js";/* empty css              */import"./PanelviewItemCompact-70a213fe.js";import"./VAlert-e27964fd.js";import"./Container-736465bf.js";import"./Toolbar-cce034aa.js";import"./VList-92308f1a.js";import"./VToolbar-99429184.js";import"./VTextField-be93763f.js";import"./VCheckboxBtn-77b0c8cb.js";import"./VInfiniteScroll-c6eeb0a7.js";import"./layout-db5fa092.js";import"./VVirtualScroll-4c0c507a.js";import"./VDialog-0dc5f298.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};
