import{I as p}from"./ItemsListing-9290f7b8.js";import{d as u,r as c,o as d,b as e,ac as o,a as _,c as y,e as f,M as l,aq as r}from"./index-dc4d9f26.js";import"./VCheckbox-f1104d05.js";import"./eventbus-a8c2de56.js";import"./VListItem-65135f8c.js";import"./VCheckboxBtn-3cfb51c2.js";import"./VList-4daf9b39.js";import"./VCardText-fea590bb.js";import"./VCard-299e9447.js";import"./VMenu-44fbbe6a.js";import"./_plugin-vue_export-helper-c27b6911.js";import"./ListItem-6e7890fa.js";import"./Button-d230f8d5.js";import"./VSpacer-cde6537e.js";/* empty css              */import"./PanelviewItemCompact-105c1437.js";import"./VAlert-562d62e3.js";import"./Container-43bdd9c6.js";import"./Toolbar-8f128710.js";import"./VToolbar-131f9d53.js";import"./VTextField-e3de4b3e.js";import"./VVirtualScroll-73f2affe.js";import"./VInfiniteScroll-da869181.js";import"./layout-64805198.js";const z=u({name:"Albums",__name:"LibraryAlbums",setup(b){const s=c(!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"];d(()=>{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 n=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(p,{itemtype:"albums","show-provider":!1,"show-favorites-only-filter":!0,"load-paged-data":n,"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{z as default};
