import{I as y}from"./ItemsListing-DD0YQzqP.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-CENm72M8.js";import"./ItemContextMenu.vue_vue_type_style_index_0_scoped_3a9a25e3_lang-DHiiayJ-.js";import"./ProviderIcon.vue_vue_type_script_setup_true_lang-BU5cq-w_.js";import"./VListItem-DxGV844T.js";import"./VChip-Cj8S4-uh.js";import"./VList-D_s2On-E.js";import"./VCardText-DZgSKYwj.js";import"./VCard-BKOPmF8F.js";import"./VMenu-CEEm_N0n.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./eventbus-CGRXT3Tn.js";import"./ListItem-Dli5DX_B.js";import"./VCheckbox-BkojC2td.js";import"./VCheckboxBtn-HMfKhzLE.js";import"./VTooltip-Cl46N3Te.js";import"./VSpacer-D9jJhlPb.js";/* empty css              */import"./PanelviewItemCompact-CvKHowIr.js";import"./Container-XgLzQRX2.js";import"./VContainer-BtbbAXeN.js";import"./Toolbar-B5avseYK.js";import"./VToolbar-CiZGbbCV.js";import"./VTextField-Bi_IoqdO.js";import"./VInfiniteScroll-xrzgbUmm.js";import"./layout-dXKdvoWL.js";import"./VRow-y-7npo4D.js";import"./VVirtualScroll-0_IQhuoN.js";import"./VAlert-DvTmx5J-.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};
