import{_ as p}from"./ItemsListing.vue_vue_type_style_index_0_lang-02893598.js";import{d as _,r as d,o as u,b as e,ah as o,a as c,c as y,e as f,M as m,ai as r}from"./index-0ae84607.js";import"./ListviewItem-156d947d.js";import"./VBadge-bfb26993.js";import"./Container-eb92362b.js";import"./forwardRefs-d0d7c5bd.js";import"./Button-a1dfd3f5.js";import"./VMenu-f26d3a19.js";/* empty css              */import"./VInput-00e20677.js";import"./VSlideGroup-18f8a11f.js";import"./VCard-e96ab32b.js";import"./VCardText-b1a0de89.js";import"./VTooltip-054ea37d.js";import"./PanelviewItem.vue_vue_type_style_index_0_lang-a0b4c306.js";import"./contextmenu-5ae46870.js";import"./Alert-ee4ff93d.js";import"./VAlert-212471f5.js";import"./VToolbar-b7dd8339.js";import"./VTextField-4bf39c0d.js";import"./VVirtualScroll-06bbaaf5.js";import"./layout-f3684635.js";const W=_({name:"Albums",__name:"LibraryAlbums",setup(b){const s=d(!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"};u(()=>{const t=e.subscribe_multi([o.MEDIA_ITEM_ADDED,o.MEDIA_ITEM_UPDATED,o.MEDIA_ITEM_DELETED],a=>{var l;(l=a.object_id)!=null&&l.startsWith("library://artist")&&(s.value=!0)});c(t)});const n=async function(t){if(t.refresh){for(e.startSync([m.ALBUM]),await r(250);e.syncTasks.value.length>0&&e.syncTasks.value.filter(a=>a.media_types.includes(m.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(),f(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},null,8,["sort-keys","update-available","title"]))}});export{W as default};
