import{I as _}from"./ItemsListing-DtfmXfFy.js";import{d as f,r as l,s as n,o as y,b as e,a9 as r,a as b,c as v,e as A,M as u,ad as m}from"./index-B3YJYWuL.js";import"./VCheckbox-D78puUFe.js";import"./eventbus-DvpacjVb.js";import"./VListItem-cb3L497C.js";import"./VCheckboxBtn-BhpuHI0t.js";import"./VList-BLfQAYp3.js";import"./VCardText-DRLEFzMp.js";import"./VCard-RO2j5jca.js";import"./VMenu-Drg4ytVq.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./ListItem-Dphq6JqC.js";import"./Button-BHspLwId.js";import"./VSpacer-5KTSJ8al.js";/* empty css              */import"./PanelviewItemCompact-CcNCJwVO.js";import"./VAlert-zURyjIT6.js";import"./Container-Bdq9NOs-.js";import"./Toolbar-CHKFZ92z.js";import"./VToolbar-DXSH_jsU.js";import"./VTextField-D-qeMwbB.js";import"./VInfiniteScroll-u7iLmbut.js";import"./layout-DE_eHv51.js";import"./VVirtualScroll-Dq9UVklv.js";const G=f({name:"Artists",__name:"LibraryArtists",setup(T){const s=l(!1),i=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(a=>a.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){i.value=n.libraryArtistsCount;return}i.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],a=>{var o;(o=a.object_id)!=null&&o.startsWith("library://artist")&&(s.value=!0)});b(t)}),(t,a)=>(v(),A(_,{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:i.value},null,8,["update-available","title","total"]))}});export{G as default};
