import{I as u}from"./ItemsListing-COLlw5bq.js";import{aw as p,J as a,av as s,a3 as c,aN as i,b9 as m,a4 as b,aG as v,ay as f}from"./index-DhxwW1_d.js";import"./Container-D2fLqW0L.js";import"./index-kQIztB-E.js";import"./Toolbar-BfQbzcpc.js";import"./VToolbar-69Rn7taX.js";import"./Button-Dq6btUmD.js";import"./ListItem-DYjdeEgj.js";import"./userPreferences-Dy9_V1Qk.js";import"./VCheckboxBtn-DVNTnMLw.js";import"./MediaItemThumb-CBiFFPUA.js";import"./PanelviewItemCompact-KbS5CIFi.js";import"./VInfiniteScroll-Ce2Gi50Y.js";import"./VVirtualScroll-DTRxXskS.js";import"./VAlert-D-KKGAlc.js";const j=p({name:"Audiobooks",__name:"LibraryAudiobooks",setup(y){const e=a(!1),t=a(s.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 e.value=!1,d(o),await i.getLibraryAudiobooks(o.favoritesOnly||void 0,o.search,o.limit,o.offset,o.sortBy,o.provider&&o.provider.length>0?o.provider:void 0)},d=async function(o){if(!o.favoritesOnly&&!o.provider){t.value=s.libraryAudiobooksCount;return}if(o.provider&&o.provider.length>0){t.value=void 0;return}t.value=await i.getLibraryAudiobooksCount(o.favoritesOnly||!1)};return c(()=>{const o=i.subscribe(m.MEDIA_ITEM_ADDED,r=>{r.object_id?.startsWith("library://audiobook")&&(e.value=!0)});b(o)}),(o,r)=>(f(),v(u,{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":e.value,title:o.$t("audiobooks"),"allow-key-hooks":!0,"show-search-button":!0,icon:"mdi-book-play-outline","restore-state":!0,total:t.value,"show-provider-filter":!0},null,8,["update-available","title","total"]))}});export{j as default};
