import{_ as p}from"./ItemsListing.vue_vue_type_style_index_0_lang-5f9be450.js";import{v as u,r as c,o as y,L as e,al as s,b as _,y as f,z as d,x as b,M as n,am as o,K as v}from"./index-4abadf84.js";import"./ListviewItem-233411ae.js";import"./VBadge-148f67ae.js";import"./Container-cc02c26a.js";import"./forwardRefs-7da7908a.js";import"./VMenu-5b409939.js";/* empty css              */import"./VCheckboxBtn-c7727adb.js";import"./VSlideGroup-fc835928.js";import"./VCard-63dfea61.js";import"./VCardText-a4be1fd3.js";import"./VTooltip-2600ff41.js";import"./PanelviewItem.vue_vue_type_style_index_0_lang-3d5ca720.js";import"./contextmenu-c1d86d74.js";import"./Alert-3abd6204.js";import"./VToolbar-42c79991.js";import"./VTextField-ce4a0dcf.js";import"./VVirtualScroll-26a90d88.js";const z=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{z as default};
