import{_ as c}from"./ItemsListing.vue_vue_type_style_index_0_lang-3c57f819.js";import{l as f,r as n,o as y,L as e,a9 as r,b as _,y as b,z as d,x as v,M as m,K as E}from"./index-d8f9df52.js";import{s as o}from"./utils-9f654e0f.js";import"./ListviewItem-c40e4501.js";import"./ListItem-7f13d5f5.js";import"./VImg-4a7a1cb8.js";import"./VMenu-7da753a3.js";import"./VTooltip-c8363108.js";import"./VCheckboxBtn-a71f5d8b.js";import"./PanelviewItem.vue_vue_type_style_index_0_lang-7cb7ae2f.js";import"./VCard-45095a4d.js";import"./contextmenu-4e7016bd.js";import"./eventbus-d154090d.js";import"./Alert-6364676b.js";import"./Container-e16d8739.js";/* empty css              */import"./VToolbar-2e81aa20.js";import"./VTextField-98808566.js";import"./VBadge-e81619d5.js";import"./VRow-d7ad6808.js";import"./VVirtualScroll-fd913adb.js";const W=f({__name:"LibraryAlbums",setup(h){const p=n([]),s=n(!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([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)});_(t)});const u=async function(t){if(t.refresh){for(e.startSync([m.ALBUM]),await o(250);e.syncTasks.value.length>0&&e.syncTasks.value.filter(a=>a.media_types.includes(m.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)=>(b(),d(c,{itemtype:"albums",items:p.value,"show-provider":!1,"show-favorites-only-filter":!0,"load-data":u,"sort-keys":Object.keys(i),"update-available":s.value,title:v(E)("bp4")?t.$t("albums"):"","allow-key-hooks":!0,"show-search-button":!0},null,8,["items","sort-keys","update-available","title"]))}});export{W as default};
