import{I as c}from"./ItemsListing-CdfNc-Lx.js";import{Q as d,x as l,a2 as n,o as y,a4 as e,aS as b,b as _,R as f,a0 as s,a5 as v,S as h}from"./index-OVJFSuO1.js";import"./MediaItemThumb-BLYBgn8B.js";import"./ProviderIcon.vue_vue_type_style_index_0_lang-D-4kgxN_.js";import"./VChip-BLxgh-kC.js";import"./VBtn-BHI_gFkG.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./ListItem-WUYGjpIG.js";import"./VCheckbox-15dKieJn.js";import"./VCheckboxBtn-4SSjCBwD.js";import"./PanelviewItemCompact-BmHmF_Ad.js";import"./VSpacer-RhrXGRx8.js";/* empty css              */import"./Container-DrUgBwRd.js";import"./VContainer-BshuJqQR.js";import"./Toolbar-DavOcuNq.js";import"./VToolbar-LfcovWTQ.js";import"./VTextField-8x9Z_kY_.js";import"./VInfiniteScroll-BwSEmJTY.js";import"./layout-DIUY8qom.js";import"./VRow-B7GLjig6.js";import"./VVirtualScroll-Drag7IKh.js";import"./VAlert-DfyW_lDT.js";const F=d({name:"Albums",__name:"LibraryAlbums",setup(A){const a=l(!1),o=l(n.libraryAlbumsCount),m=["name","name_desc","sort_name","sort_name_desc","year","year_desc","timestamp_added","timestamp_added_desc","last_played","last_played_desc","play_count","play_count_desc","artist_name","artist_name_desc"];y(()=>{const t=e.subscribe(b.MEDIA_ITEM_ADDED,r=>{var i;(i=r.object_id)!=null&&i.startsWith("library://artist")&&(a.value=!0)});_(t)});const u=async function(t){return a.value=!1,p(t),await e.getLibraryAlbums(t.favoritesOnly||void 0,t.search,t.limit,t.offset,t.sortBy,t.albumType)},p=async function(t){if(!t.favoritesOnly&&!t.albumType){o.value=n.libraryAlbumsCount;return}o.value=await e.getLibraryAlbumsCount(t.favoritesOnly||void 0,t.albumType||void 0)};return(t,r)=>(h(),f(c,{itemtype:"albums",path:"libraryalbums","show-provider":!1,"show-favorites-only-filter":!0,"load-paged-data":u,"sort-keys":m,"update-available":a.value,title:t.$t("albums"),"allow-key-hooks":!0,"show-search-button":!0,icon:"mdi-album","restore-state":!0,total:o.value,"show-album-type-filter":!0,"extra-menu-items":[{label:"sync_now",icon:"mdi-sync",action:()=>{s(e).startSync([s(v).ALBUM])},overflowAllowed:!0,disabled:s(e).syncTasks.value.length>0}]},null,8,["update-available","title","total","extra-menu-items"]))}});export{F as default};
