import{_ as p}from"./ItemsListing.vue_vue_type_style_index_0_lang-8114fc79.js";import{v as u,r as c,o as y,L as e,ak as s,b as _,y as f,z as d,x as b,M as n,al as o,K as v}from"./index-20675090.js";import"./ListviewItem-ea07a19b.js";import"./VBadge-778cac01.js";import"./ListItem-e092a77b.js";import"./forwardRefs-67412654.js";import"./VMenu-ae4158ef.js";import"./VCheckboxBtn-bbfa74a1.js";import"./VSlideGroup-14bb6bf6.js";import"./VCard-30020028.js";import"./VCardText-5e149cd1.js";import"./VTooltip-cf009865.js";import"./PanelviewItem.vue_vue_type_style_index_0_lang-4e768a3d.js";import"./contextmenu-ec90c658.js";import"./Alert-daf9024b.js";import"./Container-e8fef44d.js";/* empty css              */import"./VToolbar-7174c765.js";import"./VTextField-8bb22937.js";import"./VVirtualScroll-b47ffb64.js";const P=u({__name:"LibraryAlbums",setup(E){const r=c(!1),i={name:"sort_name",recent:"timestamp_added DESC",artist:"sort_artist, sort_name",year:"year",year_desc:"year DESC"};y(()=>{const t=e.subscribe_multi([s.MEDIA_ITEM_ADDED,s.MEDIA_ITEM_UPDATED,s.MEDIA_ITEM_DELETED],a=>{var l;(l=a.object_id)!=null&&l.startsWith("library://artist")&&(r.value=!0)});_(t)});const m=async function(t){if(t.refresh){for(e.startSync([n.ALBUM]),await o(250);e.syncTasks.value.length>0&&e.syncTasks.value.filter(a=>a.media_types.includes(n.ALBUM)).length!=0;)await o(500);await o(500)}return r.value=!1,await e.getLibraryAlbums(t.favoritesOnly||void 0,t.search,t.limit,t.offset,i[t.sortBy])};return(t,a)=>(f(),d(p,{itemtype:"albums","show-provider":!1,"show-favorites-only-filter":!0,"load-paged-data":m,"sort-keys":Object.keys(i),"update-available":r.value,title:b(v)("bp4")?t.$t("albums"):"","allow-key-hooks":!0,"show-search-button":!0},null,8,["sort-keys","update-available","title"]))}});export{P as default};
