import{I as d}from"./ItemsListing-nJ4gZwpG.js";import{x as _,r as m,H as n,o as b,I as e,ag as r,b as f,y as v,z as h,M as u,aj as s}from"./index-B55Az6uZ.js";import"./ItemContextMenu.vue_vue_type_style_index_0_scoped_3a9a25e3_lang-bhWnvEZi.js";import"./ProviderIcon.vue_vue_type_script_setup_true_lang-DmwHlomN.js";import"./VListItem-CTt5-rrr.js";import"./VChip-USL2zd6t.js";import"./VList-BbG08zRJ.js";import"./VCardText-6y4Yo2hg.js";import"./VCard-Ba6kturx.js";import"./VMenu-BJOay2FN.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./eventbus-CGRXT3Tn.js";import"./ListItem-BIOYzg71.js";import"./VCheckbox-BXkbvEGB.js";import"./VCheckboxBtn-gndQvl0N.js";import"./VTooltip-B2xVdDYJ.js";import"./VSpacer-Bt_rBx5Q.js";/* empty css              */import"./PanelviewItemCompact-BTMAfeVs.js";import"./Container-DwLI_eNo.js";import"./VContainer-Bwbf98oq.js";import"./Toolbar-CnjrHAL9.js";import"./VToolbar-Cw0gv67a.js";import"./VTextField-DVCLCsz9.js";import"./VInfiniteScroll-08LzEGPu.js";import"./layout-CXuYJmUE.js";import"./VRow-DsoK3S8F.js";import"./VVirtualScroll-Ds3B_Lds.js";import"./VAlert-DmQ6rEG3.js";const V=_({name:"Albums",__name:"LibraryAlbums",setup(A){const o=m(!1),i=m(n.libraryAlbumsCount),p=["name","name_desc","sort_name","sort_name_desc","year","year_desc","timestamp_added","timestamp_added_desc","last_played","last_played_desc","play_count","play_count_desc","artist_name","artist_name_desc"];b(()=>{const t=e.subscribe_multi([r.MEDIA_ITEM_ADDED,r.MEDIA_ITEM_UPDATED,r.MEDIA_ITEM_DELETED],a=>{var l;(l=a.object_id)!=null&&l.startsWith("library://artist")&&(o.value=!0)});f(t)});const c=async function(t){if(t.refresh){for(e.startSync([u.ALBUM]),await s(250);e.syncTasks.value.length>0&&e.syncTasks.value.filter(a=>a.media_types.includes(u.ALBUM)).length!=0;)await s(500);await s(500)}return o.value=!1,y(t),await e.getLibraryAlbums(t.favoritesOnly||void 0,t.search,t.limit,t.offset,t.sortBy,t.albumType)},y=async function(t){if(!t.favoritesOnly&&!t.albumType){i.value=n.libraryAlbumsCount;return}i.value=await e.getLibraryAlbumsCount(t.favoritesOnly||void 0,t.albumType||void 0)};return(t,a)=>(v(),h(d,{itemtype:"albums",path:"libraryalbums","show-provider":!1,"show-favorites-only-filter":!0,"load-paged-data":c,"sort-keys":p,"update-available":o.value,title:t.$t("albums"),"allow-key-hooks":!0,"show-search-button":!0,icon:"mdi-album","restore-state":!0,total:i.value,"show-album-type-filter":!0},null,8,["update-available","title","total"]))}});export{V as default};
