import{I as f}from"./ItemsListing-e7c9377b.js";import{d as _,r as l,s as n,o as y,b as e,a7 as r,a as b,c as v,e as A,M as u}from"./index-e34071c2.js";import{s as m}from"./VCheckbox-081529bb.js";import"./eventbus-edb4a70e.js";import"./VListItem-6fb16d04.js";import"./ListItem-f09faddc.js";import"./Button-d52131a6.js";import"./_plugin-vue_export-helper-c27b6911.js";import"./VMenu-8ea0aa0a.js";import"./VCard-0f63f60c.js";import"./VCardText-2a290ffe.js";import"./VSpacer-b7ae4876.js";/* empty css              */import"./PanelviewItemCompact-8de8744a.js";import"./VAlert-cd8a958f.js";import"./Container-1af89f37.js";import"./Toolbar-bbf3d11a.js";import"./VList-5a526902.js";import"./VToolbar-790d92bd.js";import"./VTextField-df721147.js";import"./VCheckboxBtn-43c6a5b9.js";import"./VInfiniteScroll-311fcdfe.js";import"./layout-4fa46c33.js";import"./VVirtualScroll-8b839030.js";const G=_({name:"Artists",__name:"LibraryArtists",setup(T){const s=l(!1),a=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){a.value=n.libraryArtistsCount;return}a.value=await e.getLibraryArtistsCount(t.favoritesOnly||!1,t.albumArtistsFilter||!1)};return y(()=>{const t=e.subscribe_multi([r.MEDIA_ITEM_ADDED,r.MEDIA_ITEM_UPDATED,r.MEDIA_ITEM_DELETED],i=>{var o;(o=i.object_id)!=null&&o.startsWith("library://artist")&&(s.value=!0)});b(t)}),(t,i)=>(v(),A(f,{itemtype:"artists","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:a.value},null,8,["update-available","title","total"]))}});export{G as default};
