import{_ as c}from"./ItemsListing.vue_vue_type_style_index_0_lang-13c0a7ea.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-0b85ac09.js";import{s as o}from"./utils-6da9b08b.js";import"./ListviewItem-8ca5221f.js";import"./ListItem-13203a50.js";import"./VImg-0b02a672.js";import"./VMenu-17c39295.js";import"./VTooltip-98b8e750.js";import"./VCheckboxBtn-f7c239ad.js";import"./PanelviewItem.vue_vue_type_style_index_0_lang-849cf90d.js";import"./VCard-49371ce3.js";import"./contextmenu-224584f8.js";import"./eventbus-d154090d.js";import"./Alert-0cea1739.js";import"./Container-f51d504d.js";/* empty css              */import"./VToolbar-7dc49a97.js";import"./VTextField-5fb2df8c.js";import"./VBadge-0d62eaa1.js";import"./VRow-b57e52b9.js";import"./VVirtualScroll-3bbd56c5.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};
