import{I as p}from"./ItemsListing-BPCoDFMa.js";import{Q as d,x as l,a2 as n,o as y,a4 as e,aS as f,b as _,R as b,a0 as o,a5 as v,S as A}from"./index-orrnp8a1.js";import"./MediaItemThumb-BFLLxiOJ.js";import"./ProviderIcon.vue_vue_type_style_index_0_lang-DgYavPcK.js";import"./VChip-DzIcRFdM.js";import"./VBtn-BJolvyKt.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./ListItem-BOpEb2vA.js";import"./VCheckbox-BaanYS4J.js";import"./VCheckboxBtn-CICj8ZxL.js";import"./PanelviewItemCompact-Bf1Qb2IB.js";import"./VSpacer-FMK5QbR9.js";/* empty css              */import"./Container-C-MxRHLg.js";import"./VContainer-DvR1uhzJ.js";import"./Toolbar-CE2HDv9i.js";import"./VToolbar-BlKUHnwt.js";import"./VTextField-DaF8PfrV.js";import"./VInfiniteScroll-CDme3Tib.js";import"./layout-BTr25AHs.js";import"./VRow-C4MwkXJh.js";import"./VVirtualScroll-Q9Rc10mA.js";import"./VAlert-BhQ3L7Kc.js";const z=d({name:"Artists",__name:"LibraryArtists",setup(h){const s=l(!1),a=l(n.libraryArtistsCount),u=["name","name_desc","sort_name","sort_name_desc","timestamp_added","timestamp_added_desc","last_played","last_played_desc","play_count","play_count_desc"],m=async function(t){return s.value=!1,c(t),await e.getLibraryArtists(t.favoritesOnly||void 0,t.search,t.limit,t.offset,t.sortBy,t.albumArtistsFilter)},c=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(f.MEDIA_ITEM_ADDED,r=>{var i;(i=r.object_id)!=null&&i.startsWith("library://artist")&&(s.value=!0)});_(t)}),(t,r)=>(A(),b(p,{itemtype:"artists",path:"libraryartists","show-provider":!1,"show-favorites-only-filter":!0,"load-paged-data":m,"show-album-artists-only-filter":!0,"update-available":s.value,title:t.$t("artists"),"allow-key-hooks":!0,"show-search-button":!0,"sort-keys":u,icon:"mdi-account-outline","restore-state":!0,total:a.value,"extra-menu-items":[{label:"sync_now",icon:"mdi-sync",action:()=>{o(e).startSync([o(v).ARTIST])},overflowAllowed:!0,disabled:o(e).syncTasks.value.length>0}]},null,8,["update-available","title","total","extra-menu-items"]))}});export{z as default};
