import{I as f}from"./ItemsListing-08846369.js";import{d as _,r as l,s as n,o as y,b as e,a7 as r,a as b,c as v,e as A,M as u}from"./index-a1b8d248.js";import{s as m}from"./VCheckbox-5797eb11.js";import"./eventbus-142801ce.js";import"./VListItem-99589506.js";import"./ListItem-8ce3726a.js";import"./Button-36db0a16.js";import"./_plugin-vue_export-helper-c27b6911.js";import"./VMenu-a4b04473.js";import"./VCard-62364c90.js";import"./VCardText-426e9876.js";import"./VSpacer-c665d1ef.js";/* empty css              */import"./PanelviewItemCompact-412c96c5.js";import"./VAlert-11c8d9d0.js";import"./Container-6ba8cd4d.js";import"./Toolbar-e7daca02.js";import"./VList-db9ad95c.js";import"./VToolbar-69b0039c.js";import"./VTextField-11675678.js";import"./VCheckboxBtn-b34ea085.js";import"./VInfiniteScroll-b88bd748.js";import"./layout-2c6f8b0d.js";import"./VVirtualScroll-abd3c2c6.js";const G=_({name:"Artists",__name:"LibraryArtists",setup(T){const s=l(!1),a=l(n.libraryArtistsCount),p=["name","name_desc","sort_name","sort_name_desc","timestamp_added","timestamp_added_desc","last_played","last_played_desc","play_count","play_count_desc"],c=async function(t){if(t.refresh&&!s.value)for(e.startSync([u.ARTIST]),await m(250);e.syncTasks.value.length>0&&e.syncTasks.value.filter(i=>i.media_types.includes(u.ARTIST)).length!=0;)await m(500);return s.value=!1,d(t),await e.getLibraryArtists(t.favoritesOnly||void 0,t.search,t.limit,t.offset,t.sortBy,t.albumArtistsFilter)},d=async function(t){if(!t.favoritesOnly&&!t.albumArtistsFilter){a.value=n.libraryArtistsCount;return}a.value=await e.getLibraryArtistsCount(t.favoritesOnly||!1,t.albumArtistsFilter||!1)};return y(()=>{const t=e.subscribe_multi([r.MEDIA_ITEM_ADDED,r.MEDIA_ITEM_UPDATED,r.MEDIA_ITEM_DELETED],i=>{var o;(o=i.object_id)!=null&&o.startsWith("library://artist")&&(s.value=!0)});b(t)}),(t,i)=>(v(),A(f,{itemtype:"artists","show-provider":!1,"show-favorites-only-filter":!0,"load-paged-data":c,"show-album-artists-only-filter":!0,"update-available":s.value,title:t.$t("artists"),"allow-key-hooks":!0,"show-search-button":!0,"sort-keys":p,icon:"mdi-account-outline","restore-state":!0,total:a.value},null,8,["update-available","title","total"]))}});export{G as default};
