import{I as c}from"./ItemsListing-7bf0c0b0.js";import{d,r as m,s as _,o as y,b as e,a7 as o,a as f,c as b,e as v,M as n}from"./index-103db515.js";import{s as r}from"./VCheckbox-ddd5d7c4.js";import"./eventbus-6e1536e2.js";import"./VListItem-ab7a82e2.js";import"./ListItem-91f42136.js";import"./Button-412f73ce.js";import"./_plugin-vue_export-helper-c27b6911.js";import"./VMenu-482e7fbc.js";import"./VCard-d4f085fd.js";import"./VCardText-1a59cac1.js";import"./VSpacer-adcb10ea.js";/* empty css              */import"./PanelviewItemCompact-5ede3757.js";import"./VAlert-4165d2e6.js";import"./Container-d98651c4.js";import"./Toolbar-908bc969.js";import"./VList-cac73f62.js";import"./VToolbar-dcf67568.js";import"./VTextField-73438668.js";import"./VCheckboxBtn-19bafbc9.js";import"./VInfiniteScroll-c2610a44.js";import"./layout-e7ad5131.js";import"./VVirtualScroll-b23fb9a8.js";const G=d({name:"Albums",__name:"LibraryAlbums",setup(A){const s=m(!1),i=m(_.libraryAlbumsCount),u=["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"];y(()=>{const t=e.subscribe_multi([o.MEDIA_ITEM_ADDED,o.MEDIA_ITEM_UPDATED,o.MEDIA_ITEM_DELETED],a=>{var l;(l=a.object_id)!=null&&l.startsWith("library://artist")&&(s.value=!0)});f(t)});const p=async function(t){if(t.refresh){for(e.startSync([n.ALBUM]),await r(250);e.syncTasks.value.length>0&&e.syncTasks.value.filter(a=>a.media_types.includes(n.ALBUM)).length!=0;)await r(500);await r(500)}return s.value=!1,i.value=await e.getLibraryAlbumsCount(t.favoritesOnly||!1),await e.getLibraryAlbums(t.favoritesOnly||void 0,t.search,t.limit,t.offset,t.sortBy)};return(t,a)=>(b(),v(c,{itemtype:"albums","show-provider":!1,"show-favorites-only-filter":!0,"load-paged-data":p,"sort-keys":u,"update-available":s.value,title:t.$t("albums"),"allow-key-hooks":!0,"show-search-button":!0,icon:"mdi-album","restore-state":!0,total:i.value},null,8,["update-available","title","total"]))}});export{G as default};
