import{I as p}from"./ItemsListing-6dc88bbd.js";import{d,r as u,o as _,b as e,ac as o,a as c,c as y,e as b,M as l,aq as r}from"./index-abd7b0d3.js";import"./ItemContextMenu.vue_vue_type_style_index_0_scoped_7aadaa8c_lang-8ee75bda.js";import"./eventbus-3394fed7.js";import"./VListItem-623fa258.js";import"./VChip-13179554.js";import"./VList-856decd1.js";import"./VCard-61a799ef.js";import"./VCardText-199b0fb3.js";import"./VMenu-1534bcb0.js";import"./_plugin-vue_export-helper-c27b6911.js";import"./ListItem-09177683.js";import"./Button-e561c42b.js";import"./VTextField-8263a3db.js";import"./VVirtualScroll-d9ad5563.js";import"./VSpacer-a55bbc93.js";/* empty css              */import"./Alert-3496524c.js";import"./VAlert-6f0f39d0.js";import"./Container-62927d7c.js";import"./Toolbar-6ade126e.js";import"./VToolbar-9761d31e.js";import"./VInfiniteScroll-6a5d71a2.js";import"./layout-8d36d037.js";const z=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 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,i[t.sortBy])};return(t,a)=>(y(),b(p,{itemtype:"albums","show-provider":!1,"show-favorites-only-filter":!0,"load-paged-data":n,"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{z as default};
