import{I as c}from"./ItemsListing-BNF8UGX2.js";import{x as d,r as l,H as n,o as y,I as e,ah as f,b as _,y as b,G as o,M as v,z as A}from"./index-DKhfhZyI.js";import"./ItemContextMenu.vue_vue_type_style_index_0_scoped_cee6bfa4_lang-BEm2OpTr.js";import"./ProviderIcon.vue_vue_type_style_index_0_lang-C_Zsg23g.js";import"./VListItem-DG7fZYqG.js";import"./VMenu-BTA9m0lg.js";import"./VCard-AQsAsy9j.js";import"./VCardText-PK-MK26S.js";import"./VList-BsIdJYb-.js";import"./VChip-Bt-2eXUN.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./eventbus-CGRXT3Tn.js";import"./ListItem-hgXNSQeh.js";import"./VCheckbox-w4Dp7feX.js";import"./VCheckboxBtn-SjULh2vZ.js";import"./PanelviewItemCompact-BXu7orP5.js";import"./VSpacer-lTIuHyc5.js";/* empty css              */import"./Container-DdZvDMit.js";import"./VContainer-bkYdVay1.js";import"./Toolbar-DfTAf723.js";import"./VToolbar-Be3D-k7i.js";import"./VTextField-C_1U2QFr.js";import"./VInfiniteScroll-s1qKdTFY.js";import"./layout-MVvGEKAO.js";import"./VRow-C3_3R0pl.js";import"./VVirtualScroll-DrLqMq8M.js";import"./VAlert-EFQTLSCo.js";const Q=d({name:"Artists",__name:"LibraryArtists",setup(h){const r=l(!1),s=l(n.libraryArtistsCount),m=["name","name_desc","sort_name","sort_name_desc","timestamp_added","timestamp_added_desc","last_played","last_played_desc","play_count","play_count_desc"],u=async function(t){return r.value=!1,p(t),await e.getLibraryArtists(t.favoritesOnly||void 0,t.search,t.limit,t.offset,t.sortBy,t.albumArtistsFilter)},p=async function(t){if(!t.favoritesOnly&&!t.albumArtistsFilter){s.value=n.libraryArtistsCount;return}s.value=await e.getLibraryArtistsCount(t.favoritesOnly||!1,t.albumArtistsFilter||!1)};return y(()=>{const t=e.subscribe(f.MEDIA_ITEM_ADDED,i=>{var a;(a=i.object_id)!=null&&a.startsWith("library://artist")&&(r.value=!0)});_(t)}),(t,i)=>(A(),b(c,{itemtype:"artists",path:"libraryartists","show-provider":!1,"show-favorites-only-filter":!0,"load-paged-data":u,"show-album-artists-only-filter":!0,"update-available":r.value,title:t.$t("artists"),"allow-key-hooks":!0,"show-search-button":!0,"sort-keys":m,icon:"mdi-account-outline","restore-state":!0,total:s.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{Q as default};
