import{I as p}from"./ItemsListing-BPCoDFMa.js";import{Q as c,x as n,a2 as l,o as b,a4 as t,aS as y,b as _,R as f,a0 as i,a5 as v,S as k}from"./index-orrnp8a1.js";import"./MediaItemThumb-BFLLxiOJ.js";import"./ProviderIcon.vue_vue_type_style_index_0_lang-DgYavPcK.js";import"./VChip-DzIcRFdM.js";import"./VBtn-BJolvyKt.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./ListItem-BOpEb2vA.js";import"./VCheckbox-BaanYS4J.js";import"./VCheckboxBtn-CICj8ZxL.js";import"./PanelviewItemCompact-Bf1Qb2IB.js";import"./VSpacer-FMK5QbR9.js";/* empty css              */import"./Container-C-MxRHLg.js";import"./VContainer-DvR1uhzJ.js";import"./Toolbar-CE2HDv9i.js";import"./VToolbar-BlKUHnwt.js";import"./VTextField-DaF8PfrV.js";import"./VInfiniteScroll-CDme3Tib.js";import"./layout-BTr25AHs.js";import"./VRow-C4MwkXJh.js";import"./VVirtualScroll-Q9Rc10mA.js";import"./VAlert-BhQ3L7Kc.js";const F=c({name:"Audiobooks",__name:"LibraryAudiobooks",setup(h){const e=n(!1),a=n(l.libraryAudiobooksCount),u=["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"],d=async function(o){return e.value=!1,m(o),await t.getLibraryAudiobooks(o.favoritesOnly||void 0,o.search,o.limit,o.offset,o.sortBy)},m=async function(o){if(!o.favoritesOnly){a.value=l.libraryAudiobooksCount;return}a.value=await t.getLibraryAudiobooksCount(o.favoritesOnly||!1)};return b(()=>{const o=t.subscribe(y.MEDIA_ITEM_ADDED,s=>{var r;(r=s.object_id)!=null&&r.startsWith("library://audiobook")&&(e.value=!0)});_(o)}),(o,s)=>(k(),f(p,{itemtype:"audiobooks",path:"libraryaudiobooks","show-duration":!1,"show-provider":!0,"show-favorites-only-filter":!0,"load-paged-data":d,"show-library":!0,"sort-keys":u,"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:a.value,"extra-menu-items":[{label:"sync_now",icon:"mdi-sync",action:()=>{i(t).startSync([i(v).AUDIOBOOK])},overflowAllowed:!0,disabled:i(t).syncTasks.value.length>0}]},null,8,["update-available","title","total","extra-menu-items"]))}});export{F as default};
