import{I as p}from"./ItemsListing-h_wzDhTj.js";import{Q as c,x as n,a2 as l,o as b,a4 as t,aY as y,b as _,R as f,a0 as i,a5 as v,S as k}from"./index-Cnj5GSC_.js";import"./MediaItemThumb-nl-JfHWK.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./ListItem-DX1YePCJ.js";import"./VBtn-BSF6Iwig.js";import"./VCheckbox-fyxRs1hM.js";import"./VCheckboxBtn-DBChwn76.js";import"./PanelviewItemCompact-B9DJU3rz.js";import"./VSpacer-DOrvwmKC.js";/* empty css              */import"./Container-CqBJ32Ya.js";import"./VContainer-B3bIWEaT.js";import"./Toolbar-DxStkeCe.js";import"./VToolbar-CdqhLlRP.js";import"./VTextField-Cx6b3lol.js";import"./VInfiniteScroll-D66OEY1T.js";import"./layout-BKwEErqq.js";import"./VRow-CehpvRw1.js";import"./VVirtualScroll-LMBSx8GT.js";import"./VAlert-CG-We4CK.js";const $=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{$ as default};
