import{I as c}from"./ItemsListing-9a3a53ae.js";import{d,r as m,s as _,o as y,b as e,a8 as o,a as b,c as f,e as v,M as n,a9 as r}from"./index-9299e1c1.js";import"./VCheckbox-75b4c12a.js";import"./eventbus-fb52ce0b.js";import"./VListItem-748fc7af.js";import"./VCheckboxBtn-ad9d405a.js";import"./VList-6d58de6a.js";import"./VCardText-7bb4efb6.js";import"./VCard-6d87d169.js";import"./VMenu-02b91385.js";import"./_plugin-vue_export-helper-c27b6911.js";import"./ListItem-50af6ebb.js";import"./Button-784539f4.js";import"./VSpacer-caa12be4.js";/* empty css              */import"./PanelviewItemCompact-c5d1faef.js";import"./VAlert-708f5408.js";import"./Container-ff473259.js";import"./Toolbar-eb89f7db.js";import"./VToolbar-2949cae0.js";import"./VTextField-9151d790.js";import"./VInfiniteScroll-dfad6ac1.js";import"./layout-0bba43de.js";import"./VVirtualScroll-1c00b40c.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)});b(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)=>(f(),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};
