import{I as c}from"./ItemsListing-4e050c6c.js";import{d,r as l,s as _,o as f,b as e,a8 as i,a as y,c as b,e as v,M as n,a9 as m}from"./index-5eb5c9ac.js";import"./VCheckbox-2a28a1cd.js";import"./eventbus-4894d390.js";import"./VListItem-b9a4cfb8.js";import"./VCheckboxBtn-cb68b622.js";import"./VList-13fa461d.js";import"./VCardText-1810bf8a.js";import"./VCard-cb863c33.js";import"./VMenu-4088b2e7.js";import"./_plugin-vue_export-helper-c27b6911.js";import"./ListItem-7b05ebf9.js";import"./Button-64160646.js";import"./VSpacer-81b0afbb.js";/* empty css              */import"./PanelviewItemCompact-4dc20236.js";import"./VAlert-12c553a2.js";import"./Container-1fa5169e.js";import"./Toolbar-6cac4d7d.js";import"./VToolbar-77830c55.js";import"./VTextField-574f2a77.js";import"./VInfiniteScroll-61b7ed02.js";import"./layout-2c007cef.js";import"./VVirtualScroll-5ee5768d.js";const z=d({name:"Artists",__name:"LibraryArtists",setup(A){const s=l(!1),r=l(_.libraryArtistsCount),u=["name","name_desc","sort_name","sort_name_desc","timestamp_added","timestamp_added_desc","last_played","last_played_desc","play_count","play_count_desc"],p=async function(t){if(t.refresh&&!s.value)for(e.startSync([n.ARTIST]),await m(250);e.syncTasks.value.length>0&&e.syncTasks.value.filter(a=>a.media_types.includes(n.ARTIST)).length!=0;)await m(500);return s.value=!1,r.value=await e.getLibraryArtistsCount(t.favoritesOnly||!1,t.albumArtistsFilter||!1),await e.getLibraryArtists(t.favoritesOnly||void 0,t.search,t.limit,t.offset,t.sortBy,t.albumArtistsFilter)};return f(()=>{const t=e.subscribe_multi([i.MEDIA_ITEM_ADDED,i.MEDIA_ITEM_UPDATED,i.MEDIA_ITEM_DELETED],a=>{var o;(o=a.object_id)!=null&&o.startsWith("library://artist")&&(s.value=!0)});y(t)}),(t,a)=>(b(),v(c,{itemtype:"artists","show-provider":!1,"show-favorites-only-filter":!0,"load-paged-data":p,"show-album-artists-only-filter":!0,"update-available":s.value,title:t.$t("artists"),"allow-key-hooks":!0,"show-search-button":!0,"sort-keys":u,icon:"mdi-account-outline","restore-state":!0,total:r.value},null,8,["update-available","title","total"]))}});export{z as default};
