import{_ as p}from"./ItemsListing.vue_vue_type_style_index_0_lang-e3f0c114.js";import{y as u,r as c,o as y,N as e,ap as s,b as _,A as f,B as d,z as b,O as n,aq as o,M as E}from"./index-9b822783.js";import"./ListviewItem-030e11e6.js";import"./VBadge-c9fb58c5.js";import"./Container-05be0da0.js";import"./forwardRefs-af0663a3.js";import"./VMenu-8029677e.js";/* empty css              */import"./VInput-c159036c.js";import"./VSlideGroup-d3ac8eca.js";import"./VCard-0d72f9dd.js";import"./VCardText-bc96863a.js";import"./VTooltip-5955b4ca.js";import"./PanelviewItem.vue_vue_type_style_index_0_lang-846c4785.js";import"./contextmenu-b55bad56.js";import"./Alert-112324b3.js";import"./VAlert-fddf489c.js";import"./VToolbar-79c684b4.js";import"./VTextField-7d804c49.js";import"./VVirtualScroll-a3d1c1c9.js";import"./layout-71937d76.js";const N=u({__name:"LibraryAlbums",setup(v){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(E)("bp4")?t.$t("albums"):"","allow-key-hooks":!0,"show-search-button":!0},null,8,["sort-keys","update-available","title"]))}});export{N as default};
