import{I as m}from"./ItemsListing-6VW59A0B.js";import{av as p,H as r,au as n,a3 as c,aL as o,b6 as b,a4 as y,aD as _,az as i,aM as f,ax as v}from"./index-C-Ivu3jU.js";import"./Container-DVyc_Yt_.js";import"./index-kQIztB-E.js";import"./VContainer-CNNJtZg6.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./Toolbar-CLPRlZ-4.js";import"./VToolbar-DTucOBiF.js";import"./Button-FtStaD9_.js";import"./ListItem-BLmrgznL.js";import"./NowPlayingBadge.vue_vue_type_style_index_0_lang-B5IzKSW4.js";import"./VCheckboxBtn-BmKOjEU4.js";import"./VInput-CnrZS6Kh.js";import"./MediaItemThumb-BsXB7IV6.js";import"./PanelviewItemCompact-5_ppRL3T.js";import"./VTextField-Bkx949P5.js";import"./VSnackbar-C_PtJN1U.js";import"./layout-D2NB7OTD.js";import"./VRow-DOG0WeJD.js";import"./VVirtualScroll-C_Lzj3jv.js";import"./VAlert-B3qbTkCR.js";const $=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(t){return e.value=!1,d(t),await o.getLibraryAudiobooks(t.favoritesOnly||void 0,t.search,t.limit,t.offset,t.sortBy)},d=async function(t){if(!t.favoritesOnly){a.value=n.libraryAudiobooksCount;return}a.value=await o.getLibraryAudiobooksCount(t.favoritesOnly||!1)};return c(()=>{const t=o.subscribe(b.MEDIA_ITEM_ADDED,s=>{s.object_id?.startsWith("library://audiobook")&&(e.value=!0)});y(t)}),(t,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:t.$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(o).startSync([i(f).AUDIOBOOK])},overflowAllowed:!0,disabled:i(o).syncTasks.value.length>0}]},null,8,["update-available","title","total","extra-menu-items"]))}});export{$ as default};
