import{I as m}from"./ItemsListing-Bt7nSL64.js";import{d as p,r,s as n,m as c,v as t,b2 as b,q as y,h as _,u as i,M as f,o as v}from"./index-BFxAF8P3.js";import"./Container-DiM3aZEa.js";import"./index-kQIztB-E.js";import"./VContainer-t8f0pxyy.js";/* empty css              */import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./Toolbar-IABQ_cGm.js";import"./VToolbar-4Hyomzsc.js";import"./VBtn-CWo0kh8N.js";import"./Button-DpLLjLX9.js";import"./ListItem-DLPNteOT.js";import"./NowPlayingBadge.vue_vue_type_style_index_0_lang-C9phX4G4.js";import"./VInput-CzWaDhLk.js";import"./MediaItemThumb-qBrtbw2Q.js";import"./PanelviewItemCompact-Dn5F-Rok.js";import"./VSpacer-Cg98NNsv.js";import"./VTextField-CudJeW4H.js";import"./VInfiniteScroll-C0KSwa81.js";import"./layout-Bgw3llWv.js";import"./VRow-B06TmOJY.js";import"./VVirtualScroll-ktNB5s8w.js";import"./VAlert-Dikxe4B7.js";const G=p({name:"Audiobooks",__name:"LibraryAudiobooks",setup(k){const e=r(!1),a=r(n.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"],u=async function(o){return e.value=!1,d(o),await t.getLibraryAudiobooks(o.favoritesOnly||void 0,o.search,o.limit,o.offset,o.sortBy)},d=async function(o){if(!o.favoritesOnly){a.value=n.libraryAudiobooksCount;return}a.value=await t.getLibraryAudiobooksCount(o.favoritesOnly||!1)};return c(()=>{const o=t.subscribe(b.MEDIA_ITEM_ADDED,s=>{s.object_id?.startsWith("library://audiobook")&&(e.value=!0)});y(o)}),(o,s)=>(v(),_(m,{itemtype:"audiobooks",path:"libraryaudiobooks","show-duration":!1,"show-provider":!0,"show-favorites-only-filter":!0,"load-paged-data":u,"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:a.value,"extra-menu-items":[{label:"sync_now",icon:"mdi-sync",action:()=>{i(t).startSync([i(f).AUDIOBOOK])},overflowAllowed:!0,disabled:i(t).syncTasks.value.length>0}]},null,8,["update-available","title","total","extra-menu-items"]))}});export{G as default};
