import{I as y}from"./ItemsListing-BNJg2MyK.js";import{x as _,r as l,H as n,o as f,I as e,ag as a,b,y as v,z as A,M as u,aj as m}from"./index-DJHitrKX.js";import"./ItemContextMenu.vue_vue_type_style_index_0_scoped_9ca321c3_lang-_lsFI5rQ.js";import"./ProviderIcon.vue_vue_type_script_setup_true_lang-CNlAq-jT.js";import"./VListItem-12Wt-HBF.js";import"./VChip-ClDFnVJT.js";import"./VList-BX74mk0S.js";import"./VCardText-8kU2RnWJ.js";import"./VCard-CTh4pnjm.js";import"./VMenu-iVz4cckD.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./eventbus-CGRXT3Tn.js";import"./ListItem-DOz6X9XT.js";import"./VCheckbox-3aIL0vaW.js";import"./VCheckboxBtn-dAENQuo8.js";import"./VTooltip-CC0Yfw6u.js";import"./VSpacer-C1vP4eYJ.js";/* empty css              */import"./PanelviewItemCompact-UEfnScEJ.js";import"./Container-DzCq22Wj.js";import"./VContainer-BVnHxF_6.js";import"./Toolbar-DsD0yISu.js";import"./VToolbar-5UlLOvbM.js";import"./VTextField-B3QP6rDq.js";import"./VInfiniteScroll-CN_ha1Dt.js";import"./layout-DuzBpUJc.js";import"./VRow-B5X4VCpx.js";import"./VVirtualScroll-2KPgq6zI.js";import"./VAlert-DIuxfh9u.js";const V=_({name:"Artists",__name:"LibraryArtists",setup(h){const s=l(!1),r=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){r.value=n.libraryArtistsCount;return}r.value=await e.getLibraryArtistsCount(t.favoritesOnly||!1,t.albumArtistsFilter||!1)};return f(()=>{const t=e.subscribe_multi([a.MEDIA_ITEM_ADDED,a.MEDIA_ITEM_UPDATED,a.MEDIA_ITEM_DELETED],i=>{var o;(o=i.object_id)!=null&&o.startsWith("library://artist")&&(s.value=!0)});b(t)}),(t,i)=>(v(),A(y,{itemtype:"artists",path:"libraryartists","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:r.value},null,8,["update-available","title","total"]))}});export{V as default};
