import{I as n}from"./ItemsListing-2655a521.js";import{d,r as u,o as _,b as e,ag as o,a as c,c as y,e as b,M as l,ah as r}from"./index-1fa25223.js";import"./ListviewItem-fa4b6d44.js";import"./helpers-f9fbf435.js";import"./Container-55c3ff81.js";import"./VListItem-53d44b85.js";import"./_plugin-vue_export-helper-c27b6911.js";/* empty css              */import"./VLabel-148b546a.js";import"./VList-f519ecda.js";import"./VCard-99bbc2f5.js";import"./VCardText-bbb7eb1a.js";import"./VMenu-85495654.js";import"./ListItem-9f85535e.js";import"./Button-0d671d73.js";import"./VTooltip-c87f5f44.js";import"./VCheckboxBtn-4c4cfeff.js";import"./PanelviewItem-f1eef939.js";import"./Alert-501a5edb.js";import"./VAlert-034cbd55.js";import"./Toolbar-77a90b60.js";import"./VBadge-3b97e665.js";import"./VToolbar-a7b4dbd4.js";import"./ItemContextMenu.vue_vue_type_style_index_0_scoped_be40882c_lang-79825e42.js";import"./eventbus-d154090d.js";import"./VTextField-46c02b72.js";import"./VVirtualScroll-f6a01209.js";import"./layout-6738e727.js";const J=d({name:"Albums",__name:"LibraryAlbums",setup(f){const s=u(!1),i={name:"name",name_desc:"name DESC",sort_name:"sort_name",sort_name_desc:"sort_name DESC",artist:"artists.name, albums.name",year:"year",year_desc:"year DESC",timestamp_added:"timestamp_added",timestamp_added_desc:"timestamp_added DESC",last_played:"last_played",last_played_desc:"last_played DESC",play_count:"play_count",play_count_desc:"play_count DESC"};_(()=>{const t=e.subscribe_multi([o.MEDIA_ITEM_ADDED,o.MEDIA_ITEM_UPDATED,o.MEDIA_ITEM_DELETED],a=>{var m;(m=a.object_id)!=null&&m.startsWith("library://artist")&&(s.value=!0)});c(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,i[t.sortBy])};return(t,a)=>(y(),b(n,{itemtype:"albums","show-provider":!1,"show-favorites-only-filter":!0,"load-paged-data":p,"sort-keys":Object.keys(i),"update-available":s.value,title:t.$t("albums"),"allow-key-hooks":!0,"show-search-button":!0,icon:"mdi-album"},null,8,["sort-keys","update-available","title"]))}});export{J as default};
