import{I as c}from"./ItemsListing-BOmO3Do4.js";import{Q as d,x as l,a2 as n,o as y,a4 as e,aY as b,b as _,R as f,a0 as s,a5 as v,S as h}from"./index-DxANhO1k.js";import"./MediaItemThumb-CFMeVmOC.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./ListItem-DOvPB9zZ.js";import"./VBtn-BKDLm-Pz.js";import"./VCheckbox-DjCmGFGI.js";import"./VCheckboxBtn-CJJKU0Jh.js";import"./PanelviewItemCompact-CK0jmgCV.js";import"./VSpacer-DFaVs3iZ.js";/* empty css              */import"./Container-BWpo4_AD.js";import"./VContainer-Dt14Bz2c.js";import"./Toolbar-C8FmMECG.js";import"./VToolbar-CF24PT7R.js";import"./VTextField-Dsv55ZTU.js";import"./VInfiniteScroll-BUbVsPar.js";import"./layout-DxBddAEz.js";import"./VRow-DUKgywhZ.js";import"./VVirtualScroll-HpbJdiAg.js";import"./VAlert-C_Jv1M-3.js";const $=d({name:"Albums",__name:"LibraryAlbums",setup(A){const a=l(!1),o=l(n.libraryAlbumsCount),u=["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 m=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":m,"sort-keys":u,"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{$ as default};
