import{I as c}from"./ItemsListing-Be0Rl7jr.js";import{Q as d,x as l,a2 as n,o as y,a4 as e,aU as b,b as _,R as f,a0 as s,a5 as v,S as h}from"./index-Bduq4vJM.js";import"./MediaItemThumb-CN4TRL8T.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./ListItem-B-hzVPBy.js";import"./Button-DDaesvMx.js";import"./VBtn-DWiYTBpb.js";import"./VCheckbox-BiGeI08h.js";import"./VCheckboxBtn-DLibXb0-.js";import"./PanelviewItemCompact-C9loINH4.js";import"./VSpacer-BnmXZ56R.js";/* empty css              */import"./Container-Ps6BlEWu.js";import"./VContainer-BVUS8uFb.js";import"./Toolbar-MtNZFNYL.js";import"./VToolbar-CG7bivmQ.js";import"./VTextField-lpT7m_Xn.js";import"./VInfiniteScroll-Ar7Xm9mt.js";import"./layout-B2wBEHPQ.js";import"./VRow-Cj9YdJtG.js";import"./VVirtualScroll-VdTkqEkN.js";import"./VAlert-BjDi0iTj.js";const z=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{z as default};
