import{I as c}from"./ItemsListing-COLlw5bq.js";import{aw as u,J as r,av as i,a3 as p,aN as a,b9 as m,a4 as v,aG as f,ay as _}from"./index-DhxwW1_d.js";import"./Container-D2fLqW0L.js";import"./index-kQIztB-E.js";import"./Toolbar-BfQbzcpc.js";import"./VToolbar-69Rn7taX.js";import"./Button-Dq6btUmD.js";import"./ListItem-DYjdeEgj.js";import"./userPreferences-Dy9_V1Qk.js";import"./VCheckboxBtn-DVNTnMLw.js";import"./MediaItemThumb-CBiFFPUA.js";import"./PanelviewItemCompact-KbS5CIFi.js";import"./VInfiniteScroll-Ce2Gi50Y.js";import"./VVirtualScroll-DTRxXskS.js";import"./VAlert-D-KKGAlc.js";const T=u({name:"Podcasts",__name:"LibraryPodcasts",setup(y){const o=r(!1),e=r(i.libraryPodcastsCount),d=["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"],l=async function(t){return o.value=!1,n(t),await a.getLibraryPodcasts(t.favoritesOnly||void 0,t.search,t.limit,t.offset,t.sortBy,t.provider&&t.provider.length>0?t.provider:void 0)},n=async function(t){if(!t.favoritesOnly&&!t.provider){e.value=i.libraryPodcastsCount;return}if(t.provider&&t.provider.length>0){e.value=void 0;return}e.value=await a.getLibraryPodcastsCount(t.favoritesOnly||!1)};return p(()=>{const t=a.subscribe(m.MEDIA_ITEM_ADDED,s=>{s.object_id?.startsWith("library://podcast")&&(o.value=!0)});v(t)}),(t,s)=>(_(),f(c,{itemtype:"podcasts",path:"librarypodcasts","show-duration":!1,"show-provider":!0,"show-favorites-only-filter":!0,"load-paged-data":l,"show-library":!0,"sort-keys":d,"update-available":o.value,title:t.$t("podcasts"),"allow-key-hooks":!0,"show-search-button":!0,icon:"mdi-podcast","restore-state":!0,total:e.value,"show-provider-filter":!0},null,8,["update-available","title","total"]))}});export{T as default};
