import{I as y}from"./ItemsListing-Cd5IBPUO.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-DuDRe8hE.js";import"./ItemContextMenu.vue_vue_type_style_index_0_scoped_ea20d839_lang-Cfo9s-Sj.js";import"./ProviderIcon.vue_vue_type_script_setup_true_lang-CHFYJo9W.js";import"./VListItem-CuoSvcqW.js";import"./VChip-BRQkwjNJ.js";import"./VList-BlpguAX2.js";import"./VCardText-Dn8Yf3BC.js";import"./VCard-Cf5RelEw.js";import"./VMenu-B49kEbTj.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./eventbus-CGRXT3Tn.js";import"./ListItem-xrpNnThP.js";import"./VCheckbox-DBOdVsut.js";import"./VCheckboxBtn-CMIUd74V.js";import"./VTooltip-aHjUkPs6.js";import"./VSpacer-CYzCqmAo.js";/* empty css              */import"./PanelviewItemCompact-BQvk3oJ_.js";import"./Container-CQhyPPl2.js";import"./VContainer-CCoTeKDA.js";import"./Toolbar-CibNv11m.js";import"./VToolbar-Dhcm-C4i.js";import"./VTextField-D5EFKWzi.js";import"./VInfiniteScroll-BaRPR-8K.js";import"./layout-qserhqCM.js";import"./VRow-C-co90yO.js";import"./VVirtualScroll-CdwGYB7u.js";import"./VAlert-sqJ4UeFM.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};
