import{I as f}from"./ItemsListing-XUXN-Um6.js";import{d as _,r as l,s as n,m as v,v as e,a$ as b,q as w,c as h,b as d,u as o,M as m,F as g,o as A}from"./index-Bn2Tzsay.js";import{_ as R}from"./AddManualLink.vue_vue_type_script_setup_true_lang-B3x2e0uA.js";import"./Container-CEbFgC5b.js";import"./index-CBho6rsP.js";import"./VContainer-CRIwFZfO.js";/* empty css              */import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./Toolbar-Ba4dAxS1.js";import"./VToolbar-Z0nE2qFc.js";import"./VBtn-BQk37KYJ.js";import"./Button-r9Wpw3CQ.js";import"./ListItem-BNbxxrdg.js";import"./NowPlayingBadge.vue_vue_type_style_index_0_lang-DCLVCnPO.js";import"./VInput-C_1AW61Q.js";import"./MediaItemThumb-B7hfZSf2.js";import"./PanelviewItemCompact-By5cXXTW.js";import"./VSpacer-ygjaGObn.js";import"./VTextField-fPA0WAHx.js";import"./VInfiniteScroll-DvbiA0kw.js";import"./layout-kFqKNtL6.js";import"./VRow-CNVApy9v.js";import"./VVirtualScroll-B56qZ1Y0.js";import"./VAlert-Bj5fXNhB.js";import"./VDialog-DRfRMr5_.js";const Q=_({name:"Radios",__name:"LibraryRadios",setup(D){const s=l(!1),i=l(n.libraryRadiosCount),r=l(!1),u=["name","name_desc","sort_name","sort_name_desc","timestamp_added","timestamp_added_desc","last_played","last_played_desc","play_count","play_count_desc"];v(()=>{const t=e.subscribe(b.MEDIA_ITEM_ADDED,a=>{a.object_id?.startsWith("library://radio")&&(s.value=!0)});w(t)});const p=async function(t){return s.value=!1,c(t),await e.getLibraryRadios(t.favoritesOnly||void 0,t.search,t.limit,t.offset,t.sortBy)},c=async function(t){if(!t.favoritesOnly){i.value=n.libraryRadiosCount;return}i.value=await e.getLibraryRadiosCount(t.favoritesOnly||!1)};return(t,a)=>(A(),h(g,null,[d(f,{itemtype:"radios",path:"libraryradios","show-duration":!1,"show-provider":!1,"show-favorites-only-filter":!0,"load-paged-data":p,"sort-keys":u,"update-available":s.value,title:t.$t("radios"),"show-search-button":!0,"allow-key-hooks":!0,"extra-menu-items":[{label:"sync_now",icon:"mdi-sync",action:()=>{o(e).startSync([o(m).RADIO])},overflowAllowed:!0,disabled:o(e).syncTasks.value.length>0},{label:"add_url_item",labelArgs:[],action:()=>{r.value=!0},icon:"mdi-playlist-plus"}],icon:"mdi-access-point","restore-state":!0,total:i.value},null,8,["update-available","title","extra-menu-items","total"]),d(R,{modelValue:r.value,"onUpdate:modelValue":a[0]||(a[0]=y=>r.value=y),type:o(m).RADIO},null,8,["modelValue","type"])],64))}});export{Q as default};
