import{I as n}from"./ItemsListing-ffc2935e.js";import{d as u,r as d,o as c,b as e,ab as o,a as _,c as y,e as f,M as l,ap as r}from"./index-8e7daee8.js";import"./ItemContextMenu.vue_vue_type_style_index_0_scoped_d4387993_lang-755a1a8b.js";import"./eventbus-d39a7847.js";import"./VListItem-09460541.js";import"./VLabel-46f0710d.js";import"./VList-ca6176f0.js";import"./VCard-990eebd4.js";import"./VCardText-a5e6d4d4.js";import"./VMenu-64e96597.js";import"./_plugin-vue_export-helper-c27b6911.js";import"./ListItem-b626b3fa.js";import"./Button-caab2d1b.js";import"./PanelviewItemCompact-2d9663c1.js";import"./VCheckboxBtn-1b20bfe7.js";import"./VSpacer-28a82c5a.js";/* empty css              */import"./VAlert-fd6ed822.js";import"./Container-0d470ed8.js";import"./Toolbar-e48261c7.js";import"./VToolbar-645a3ba3.js";import"./VTextField-12379bad.js";import"./VVirtualScroll-01e39aac.js";import"./VInfiniteScroll-40f31e12.js";import"./layout-a17f5af6.js";const F=u({name:"Albums",__name:"LibraryAlbums",setup(b){const s=d(!1),m=["name","name_desc","sort_name","sort_name_desc","artist","year","year_desc","timestamp_added","timestamp_added_desc","last_played","last_played_desc","play_count","play_count_desc"];c(()=>{const t=e.subscribe_multi([o.MEDIA_ITEM_ADDED,o.MEDIA_ITEM_UPDATED,o.MEDIA_ITEM_DELETED],a=>{var i;(i=a.object_id)!=null&&i.startsWith("library://artist")&&(s.value=!0)});_(t)});const p=async function(t){if(t.refresh){for(e.startSync([l.ALBUM]),await r(250);e.syncTasks.value.length>0&&e.syncTasks.value.filter(a=>a.media_types.includes(l.ALBUM)).length!=0;)await r(500);await r(500)}return s.value=!1,await e.getLibraryAlbums(t.favoritesOnly||void 0,t.search,t.limit,t.offset,t.sortBy)};return(t,a)=>(y(),f(n,{itemtype:"albums","show-provider":!1,"show-favorites-only-filter":!0,"load-paged-data":p,"sort-keys":m,"update-available":s.value,title:t.$t("albums"),"allow-key-hooks":!0,"show-search-button":!0,icon:"mdi-album","restore-state":!0},null,8,["update-available","title"]))}});export{F as default};
