import{_ as u}from"./ItemsListing.vue_vue_type_style_index_0_lang-8e142c2f.js";import{l as c,r as l,o as f,H as e,ao as o,b as _,v as d,x as b,M as m,ap as r}from"./index-8ef8125d.js";import"./ListviewItem-ade956db.js";import"./MediaItemThumb.vue_vue_type_style_index_0_lang-3622812c.js";import"./ListItem-bba986fb.js";import"./VBtn-49774b84.js";import"./VMenu-a805d6b6.js";import"./index-a4f9d82d.js";import"./VListItem-b049d12d.js";import"./VCheckboxBtn-4c08e900.js";import"./VCard-e81591ba.js";/* empty css                             */import"./PanelviewItem.vue_vue_type_style_index_0_lang-a068cbe2.js";import"./contextmenu-7e32a8e5.js";import"./eventbus-d154090d.js";import"./Alert-bdc4de4a.js";import"./Container-32d4da6e.js";/* empty css              */import"./VToolbar-b4c95f12.js";import"./VTextField-be284f64.js";import"./VBadge-8b6f3afa.js";import"./VRow-08fca7f1.js";const W=c({__name:"LibraryAlbums",setup(y){const n=l([]),i=l(!1);f(()=>{const t=e.subscribe_multi([o.MEDIA_ITEM_ADDED,o.MEDIA_ITEM_UPDATED,o.MEDIA_ITEM_DELETED],a=>{var s;(s=a.object_id)!=null&&s.startsWith("library://artist")&&(i.value=!0)});_(t)});const p=async function(t){if(t.refresh){for(e.startSync([m.ALBUM]),await r(250);e.syncTasks.value.length>0&&e.syncTasks.value.filter(a=>a.media_types.includes(m.ALBUM)).length!=0;)await r(500);await r(500)}return i.value=!1,await e.getLibraryAlbums(t.favoritesOnly||void 0,t.search,t.limit,t.offset,t.sortBy)};return(t,a)=>(d(),b(u,{itemtype:"albums",items:n.value,"show-provider":!1,"show-favorites-only-filter":!0,"load-data":p,"sort-keys":["sort_name","timestamp_added DESC","sort_artist","year"],"update-available":i.value,title:t.$t("albums"),"allow-key-hooks":!0,"show-search-button":!0},null,8,["items","update-available","title"]))}});export{W as default};
