import{I as m}from"./ItemsListing-t4zttHcu.js";import{U as p,x as r,a4 as n,o as c,a6 as t,aY as b,b as y,W as _,X as f,a2 as i,a7 as v}from"./index-B-lUZalq.js";import"./Container-Br6JH6Pm.js";import"./Button-kSJGA_Pw.js";import"./VBtn-BPJ1JKW-.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./VContainer-DB65WVbe.js";/* empty css              */import"./Toolbar-BvxWbi_E.js";import"./VToolbar-RljK0PC9.js";import"./ListItem-LV_WU--g.js";import"./NowPlayingBadge.vue_vue_type_style_index_0_lang-DnroVGI-.js";import"./VInput-BWBQqjuk.js";import"./MediaItemThumb-DapaMoP4.js";import"./PanelviewItemCompact-CIDxIfoQ.js";import"./VSpacer-DDLrofv-.js";import"./VTextField-B-d5Pe9I.js";import"./VInfiniteScroll-CKZj-VKd.js";import"./layout-BuzUTwrQ.js";import"./VRow-BQOTE9C_.js";import"./VVirtualScroll-CceW16X7.js";import"./VAlert-QHTIcuEJ.js";const q=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)=>(f(),_(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(v).AUDIOBOOK])},overflowAllowed:!0,disabled:i(t).syncTasks.value.length>0}]},null,8,["update-available","title","total","extra-menu-items"]))}});export{q as default};
