import{I as d}from"./ItemsListing-CHZs9N6z.js";import{a7 as m,F as s,a6 as r,L as p,ap as a,aN as c,N as b,ai as _,a9 as y}from"./index-CFcIX8RO.js";import"./Container-iGBsqgnx.js";import"./index-kQIztB-E.js";import"./Toolbar-DambSy-S.js";import"./VToolbar-B_3_MVxk.js";import"./Button-IxLZkOI0.js";import"./ListItem-CWPLlf7K.js";import"./NowPlayingBadge.vue_vue_type_style_index_0_lang-CGTv89Z9.js";import"./VCheckboxBtn-Dy9mjR59.js";import"./MediaItemThumb-oOnMmU-2.js";import"./PanelviewItemCompact-YHP34gKS.js";import"./VInfiniteScroll-DY-7nfIB.js";import"./VVirtualScroll-BRrQ8Y7O.js";import"./VAlert-DZurr_D6.js";const N=m({name:"Audiobooks",__name:"LibraryAudiobooks",setup(f){const t=s(!1),e=s(r.libraryAudiobooksCount),l=["name","name_desc","sort_name","sort_name_desc","timestamp_added","timestamp_added_desc","timestamp_modified","timestamp_modified_desc","last_played","last_played_desc","play_count","play_count_desc"],n=async function(o){return t.value=!1,u(o),await a.getLibraryAudiobooks(o.favoritesOnly||void 0,o.search,o.limit,o.offset,o.sortBy)},u=async function(o){if(!o.favoritesOnly){e.value=r.libraryAudiobooksCount;return}e.value=await a.getLibraryAudiobooksCount(o.favoritesOnly||!1)};return p(()=>{const o=a.subscribe(c.MEDIA_ITEM_ADDED,i=>{i.object_id?.startsWith("library://audiobook")&&(t.value=!0)});b(o)}),(o,i)=>(y(),_(d,{itemtype:"audiobooks",path:"libraryaudiobooks","show-duration":!1,"show-provider":!0,"show-favorites-only-filter":!0,"load-paged-data":n,"show-library":!0,"sort-keys":l,"update-available":t.value,title:o.$t("audiobooks"),"allow-key-hooks":!0,"show-search-button":!0,icon:"mdi-book-play-outline","restore-state":!0,total:e.value},null,8,["update-available","title","total"]))}});export{N as default};
