import{I as _}from"./ItemsListing-B7YbZVJx.js";import{d as f,r as l,s as n,o as y,b as e,a9 as r,a as b,c as v,e as A,M as u,ad as m}from"./index-CbqyiSMI.js";import"./VCheckbox-Csgo84SF.js";import"./eventbus-obT-FP9Y.js";import"./VListItem-BYxrnyeM.js";import"./VCheckboxBtn-DxTJLbWV.js";import"./VList-2BQBE8QJ.js";import"./VCardText-_gwoREqT.js";import"./VCard-B6sm4saY.js";import"./VMenu-1DOA9SEI.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./ListItem-B7bHYA4R.js";import"./Button-CLDMkOkF.js";import"./VSpacer-CmYIZFzH.js";/* empty css              */import"./PanelviewItemCompact-Dd6pj0K-.js";import"./VAlert-DwqXkxqj.js";import"./Container-w-OCNvyc.js";import"./Toolbar-acHr9fKA.js";import"./VToolbar-BG8y1FYY.js";import"./VTextField-BgfrdRes.js";import"./VInfiniteScroll-DYhI3uXA.js";import"./layout-CR-LchnQ.js";import"./VVirtualScroll-ChC1ngc2.js";const G=f({name:"Artists",__name:"LibraryArtists",setup(T){const s=l(!1),i=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(a=>a.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){i.value=n.libraryArtistsCount;return}i.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],a=>{var o;(o=a.object_id)!=null&&o.startsWith("library://artist")&&(s.value=!0)});b(t)}),(t,a)=>(v(),A(_,{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:i.value},null,8,["update-available","title","total"]))}});export{G as default};
