import{_ as c}from"./ItemsListing.vue_vue_type_style_index_0_lang-cfe67ae4.js";import{v as f,r as n,o as y,L as e,an as i,b as _,y as d,z as b,x as v,M as m,ao as r,K as h}from"./index-5804982a.js";import"./ListviewItem-8b7ae6a6.js";import"./VBadge-3d00ada8.js";import"./Container-d5ee1f41.js";import"./forwardRefs-03519353.js";import"./VMenu-18f2572a.js";/* empty css              */import"./VInput-fe7a35fc.js";import"./VSlideGroup-711de993.js";import"./VCard-cc8044ef.js";import"./VCardText-963b2439.js";import"./VTooltip-5622a67d.js";import"./PanelviewItem.vue_vue_type_style_index_0_lang-04756f0a.js";import"./contextmenu-95007cdc.js";import"./Alert-38a1b933.js";import"./VAlert-8600f5db.js";import"./VToolbar-ce6590ba.js";import"./VTextField-b58cde95.js";import"./VVirtualScroll-72995e2a.js";const F=f({__name:"LibraryArtists",setup(E){const p=n([]),s=n(!1),o={name:"sort_name",recent:"timestamp_added DESC"},u=async function(t){if(t.refresh&&!s.value){for(e.startSync([m.ARTIST]),await r(250);e.syncTasks.value.length>0&&e.syncTasks.value.filter(a=>a.media_types.includes(m.ARTIST)).length!=0;)await r(500);await r(500)}return s.value=!1,await e.getLibraryArtists(t.favoritesOnly||void 0,t.search,t.limit,t.offset,o[t.sortBy],t.albumArtistsFilter)};return y(()=>{const t=e.subscribe_multi([i.MEDIA_ITEM_ADDED,i.MEDIA_ITEM_UPDATED,i.MEDIA_ITEM_DELETED],a=>{var l;(l=a.object_id)!=null&&l.startsWith("library://artist")&&(s.value=!0)});_(t)}),(t,a)=>(d(),b(c,{itemtype:"artists",items:p.value,"show-provider":!1,"show-favorites-only-filter":!0,"load-paged-data":u,"show-album-artists-only-filter":!0,"update-available":s.value,title:v(h)("bp4")?t.$t("artists"):"","allow-key-hooks":!0,"show-search-button":!0,"sort-keys":Object.keys(o)},null,8,["items","update-available","title","sort-keys"]))}});export{F as default};
