import{I as m}from"./ItemsListing-2655a521.js";import{I as y,_ as v}from"./ProviderDetails.vue_vue_type_script_setup_true_lang-91ac6b4e.js";import{d as b,r as h,o as w,b as i,ag as _,a as I,I as k,c as o,g,f as A,e as a,u as n,j as s,i as u,ai as p}from"./index-1fa25223.js";import"./ListviewItem-fa4b6d44.js";import"./helpers-f9fbf435.js";import"./Container-55c3ff81.js";import"./VListItem-53d44b85.js";import"./_plugin-vue_export-helper-c27b6911.js";/* empty css              */import"./VLabel-148b546a.js";import"./VList-f519ecda.js";import"./VCard-99bbc2f5.js";import"./VCardText-bbb7eb1a.js";import"./VMenu-85495654.js";import"./ListItem-9f85535e.js";import"./Button-0d671d73.js";import"./VTooltip-c87f5f44.js";import"./VCheckboxBtn-4c4cfeff.js";import"./PanelviewItem-f1eef939.js";import"./Alert-501a5edb.js";import"./VAlert-034cbd55.js";import"./Toolbar-77a90b60.js";import"./VBadge-3b97e665.js";import"./VToolbar-a7b4dbd4.js";import"./ItemContextMenu.vue_vue_type_style_index_0_scoped_be40882c_lang-79825e42.js";import"./eventbus-d154090d.js";import"./VTextField-46c02b72.js";import"./VVirtualScroll-f6a01209.js";import"./layout-6738e727.js";import"./VSelect-58338ce7.js";import"./VDialog-0a55bc34.js";const D=u("br",null,null,-1),B=u("br",null,null,-1),at=b({__name:"ArtistDetails",props:{itemId:{},provider:{}},setup(c){const r=c,t=h(),l=async function(){t.value=await i.getArtist(r.itemId,r.provider)};w(()=>{if(r.provider=="library"){const e=i.subscribe(_.MEDIA_ITEM_UPDATED,l,`library://artist/${r.itemId}`);I(e)}}),k(()=>r.itemId,e=>{e&&l()},{immediate:!0});const d=async function(e){return await i.getArtistAlbums(r.itemId,r.provider,e.libraryOnly)},f=async function(e){return await i.getArtistTracks(r.itemId,r.provider,e.libraryOnly)};return(e,E)=>(o(),g("section",null,[A(y,{item:t.value},null,8,["item"]),t.value?(o(),a(m,{key:0,itemtype:"artisttracks","parent-item":t.value,"show-provider":!0,"show-favorites-only-filter":!0,"show-library-only-filter":t.value.provider=="library"&&n(p)(t.value).length>0,"show-refresh-button":!1,"show-track-number":!1,"load-items":f,"sort-keys":["name","sort_name","album"],title:e.$t("tracks"),"allow-collapse":!0},null,8,["parent-item","show-library-only-filter","title"])):s("",!0),D,t.value?(o(),a(m,{key:1,itemtype:"artistalbums","parent-item":t.value,"show-provider":!0,"show-favorites-only-filter":!0,"show-library-only-filter":t.value.provider=="library"&&n(p)(t.value).length>0,"show-refresh-button":!1,"load-items":d,"sort-keys":["name","sort_name","year"],title:e.$t("albums"),"allow-collapse":!0},null,8,["parent-item","show-library-only-filter","title"])):s("",!0),B,t.value?(o(),a(v,{key:2,"item-details":t.value},null,8,["item-details"])):s("",!0)]))}});export{at as default};
