import{I as y}from"./ItemsListing-nJ4gZwpG.js";import{x as f,r as i,H as m,o as v,I as e,ag as r,b,y as h,z as I,M as p,aj as l}from"./index-B55Az6uZ.js";import"./ItemContextMenu.vue_vue_type_style_index_0_scoped_3a9a25e3_lang-bhWnvEZi.js";import"./ProviderIcon.vue_vue_type_script_setup_true_lang-DmwHlomN.js";import"./VListItem-CTt5-rrr.js";import"./VChip-USL2zd6t.js";import"./VList-BbG08zRJ.js";import"./VCardText-6y4Yo2hg.js";import"./VCard-Ba6kturx.js";import"./VMenu-BJOay2FN.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./eventbus-CGRXT3Tn.js";import"./ListItem-BIOYzg71.js";import"./VCheckbox-BXkbvEGB.js";import"./VCheckboxBtn-gndQvl0N.js";import"./VTooltip-B2xVdDYJ.js";import"./VSpacer-Bt_rBx5Q.js";/* empty css              */import"./PanelviewItemCompact-BTMAfeVs.js";import"./Container-DwLI_eNo.js";import"./VContainer-Bwbf98oq.js";import"./Toolbar-CnjrHAL9.js";import"./VToolbar-Cw0gv67a.js";import"./VTextField-DVCLCsz9.js";import"./VInfiniteScroll-08LzEGPu.js";import"./layout-CXuYJmUE.js";import"./VRow-DsoK3S8F.js";import"./VVirtualScroll-Ds3B_Lds.js";import"./VAlert-DmQ6rEG3.js";const V=f({name:"Podcasts",__name:"LibraryPodcasts",setup(w){const a=i(!1),s=i(m.libraryPodcastsCount),d=i([]),c=["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){if(t.refresh&&!a.value){for(e.startSync([p.PLAYLIST]),await l(250);e.syncTasks.value.length>0&&e.syncTasks.value.filter(o=>o.media_types.includes(p.PLAYLIST)).length!=0;)await l(500);await l(500)}return a.value=!1,_(t),await e.getLibraryPodcasts(t.favoritesOnly||void 0,t.search,t.limit,t.offset,t.sortBy)},_=async function(t){if(!t.favoritesOnly){s.value=m.libraryPodcastsCount;return}s.value=await e.getLibraryPodcastsCount(t.favoritesOnly||!1)};return v(()=>{const t=e.subscribe_multi([r.MEDIA_ITEM_ADDED,r.MEDIA_ITEM_UPDATED,r.MEDIA_ITEM_DELETED],o=>{var n;(n=o.object_id)!=null&&n.startsWith("library://podcast")&&(a.value=!0)});b(t)}),(t,o)=>(h(),I(y,{itemtype:"podcasts",path:"librarypodcasts","show-duration":!1,"show-provider":!0,"show-favorites-only-filter":!0,"load-paged-data":u,"show-library":!0,"sort-keys":c,"update-available":a.value,title:t.$t("podcasts"),"allow-key-hooks":!0,"show-search-button":!0,"extra-menu-items":d.value,icon:"mdi-podcast","restore-state":!0,total:s.value},null,8,["update-available","title","extra-menu-items","total"]))}});export{V as default};
