import{I as c}from"./ItemsListing-BNF8UGX2.js";import{x as d,r as l,H as n,o as y,I as e,ah as b,b as _,y as f,G as r,M as v,z as h}from"./index-DKhfhZyI.js";import"./ItemContextMenu.vue_vue_type_style_index_0_scoped_cee6bfa4_lang-BEm2OpTr.js";import"./ProviderIcon.vue_vue_type_style_index_0_lang-C_Zsg23g.js";import"./VListItem-DG7fZYqG.js";import"./VMenu-BTA9m0lg.js";import"./VCard-AQsAsy9j.js";import"./VCardText-PK-MK26S.js";import"./VList-BsIdJYb-.js";import"./VChip-Bt-2eXUN.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./eventbus-CGRXT3Tn.js";import"./ListItem-hgXNSQeh.js";import"./VCheckbox-w4Dp7feX.js";import"./VCheckboxBtn-SjULh2vZ.js";import"./PanelviewItemCompact-BXu7orP5.js";import"./VSpacer-lTIuHyc5.js";/* empty css              */import"./Container-DdZvDMit.js";import"./VContainer-bkYdVay1.js";import"./Toolbar-DfTAf723.js";import"./VToolbar-Be3D-k7i.js";import"./VTextField-C_1U2QFr.js";import"./VInfiniteScroll-s1qKdTFY.js";import"./layout-MVvGEKAO.js";import"./VRow-C3_3R0pl.js";import"./VVirtualScroll-DrLqMq8M.js";import"./VAlert-EFQTLSCo.js";const R=d({name:"Albums",__name:"LibraryAlbums",setup(A){const o=l(!1),a=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,s=>{var i;(i=s.object_id)!=null&&i.startsWith("library://artist")&&(o.value=!0)});_(t)});const u=async function(t){return o.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){a.value=n.libraryAlbumsCount;return}a.value=await e.getLibraryAlbumsCount(t.favoritesOnly||void 0,t.albumType||void 0)};return(t,s)=>(h(),f(c,{itemtype:"albums",path:"libraryalbums","show-provider":!1,"show-favorites-only-filter":!0,"load-paged-data":u,"sort-keys":m,"update-available":o.value,title:t.$t("albums"),"allow-key-hooks":!0,"show-search-button":!0,icon:"mdi-album","restore-state":!0,total:a.value,"show-album-type-filter":!0,"extra-menu-items":[{label:"sync_now",icon:"mdi-sync",action:()=>{r(e).startSync([r(v).ALBUM])},overflowAllowed:!0,disabled:r(e).syncTasks.value.length>0}]},null,8,["update-available","title","total","extra-menu-items"]))}});export{R as default};
