import{_ as u}from"./ItemsListing.vue_vue_type_style_index_0_lang-6fa46e09.js";import{l as p,r as c,o as _,J as e,ai as r,b as f,v as y,x as d,q as b,M as n,aj as o,I as v}from"./index-e5db0b73.js";import"./ListviewItem-7c178b7a.js";import"./VBadge-efd00f67.js";import"./ListItem-ac3869d3.js";import"./VImg-7a057c50.js";import"./VMenu-d9833a31.js";import"./VCheckboxBtn-46446b67.js";import"./VCard-c9b9f4e9.js";import"./VTooltip-71530943.js";import"./PanelviewItem.vue_vue_type_style_index_0_lang-221d4edc.js";import"./contextmenu-8eac6b44.js";import"./Alert-1172b8fb.js";import"./Container-238e2d02.js";import"./VToolbar-4e8dded4.js";import"./VTextField-46667b30.js";import"./VVirtualScroll-01555b84.js";const $=p({__name:"LibraryAlbums",setup(E){const s=c(!1),i={name:"sort_name",recent:"timestamp_added DESC",artist:"sort_artist, sort_name",year:"year",year_desc:"year DESC"};_(()=>{const t=e.subscribe_multi([r.MEDIA_ITEM_ADDED,r.MEDIA_ITEM_UPDATED,r.MEDIA_ITEM_DELETED],a=>{var l;(l=a.object_id)!=null&&l.startsWith("library://artist")&&(s.value=!0)});f(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 s.value=!1,await e.getLibraryAlbums(t.favoritesOnly||void 0,t.search,t.limit,t.offset,i[t.sortBy])};return(t,a)=>(y(),d(u,{itemtype:"albums","show-provider":!1,"show-favorites-only-filter":!0,"load-paged-data":m,"sort-keys":Object.keys(i),"update-available":s.value,title:b(v)("bp4")?t.$t("albums"):"","allow-key-hooks":!0,"show-search-button":!0},null,8,["sort-keys","update-available","title"]))}});export{$ as default};
