import{I as u}from"./ItemsListing-D_KqSTZS.js";import{ay as p,J as a,ax as s,a3 as c,aP as i,bb as m,a4 as b,aI as f,aA as v}from"./index-BRUnowC8.js";import"./Container-ZHtGcXZO.js";import"./index-kQIztB-E.js";import"./Toolbar-BEJzY0mB.js";import"./VToolbar-DS4mUdOC.js";import"./Button-BKv4xLAv.js";import"./ListItem-jfbxOrad.js";import"./userPreferences-DBWZCHKf.js";import"./VCheckboxBtn-D390s4L9.js";import"./VSelectionControl-Co1cRcmS.js";import"./MediaItemThumb-CIE9_Elw.js";import"./PanelviewItemCompact-CsJmi5IT.js";import"./VInfiniteScroll-BORsRMGl.js";import"./VVirtualScroll-htzu2YXu.js";import"./VAlert-DQxypmdN.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)=>(v(),f(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};
