import{I as f}from"./ItemsListing-h_wzDhTj.js";import{Q as _,x as n,a2 as d,o as v,a4 as e,aY as b,b as w,Z as h,B as m,a0 as s,a5 as u,G as g,S as A}from"./index-Cnj5GSC_.js";import{_ as R}from"./AddManualLink.vue_vue_type_script_setup_true_lang-DRWco8lF.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";import"./VDialog-Dv-LdC8c.js";const q=_({name:"Radios",__name:"LibraryRadios",setup(D){const i=n(!1),r=n(d.libraryRadiosCount),l=n(!1),p=["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=>{var o;(o=a.object_id)!=null&&o.startsWith("library://radio")&&(i.value=!0)});w(t)});const c=async function(t){return i.value=!1,y(t),await e.getLibraryRadios(t.favoritesOnly||void 0,t.search,t.limit,t.offset,t.sortBy)},y=async function(t){if(!t.favoritesOnly){r.value=d.libraryRadiosCount;return}r.value=await e.getLibraryRadiosCount(t.favoritesOnly||!1)};return(t,a)=>(A(),h(g,null,[m(f,{itemtype:"radios",path:"libraryradios","show-duration":!1,"show-provider":!1,"show-favorites-only-filter":!0,"load-paged-data":c,"sort-keys":p,"update-available":i.value,title:t.$t("radios"),"show-search-button":!0,"allow-key-hooks":!0,"extra-menu-items":[{label:"sync_now",icon:"mdi-sync",action:()=>{s(e).startSync([s(u).RADIO])},overflowAllowed:!0,disabled:s(e).syncTasks.value.length>0},{label:"add_url_item",labelArgs:[],action:()=>{l.value=!0},icon:"mdi-playlist-plus"}],icon:"mdi-access-point","restore-state":!0,total:r.value},null,8,["update-available","title","extra-menu-items","total"]),m(R,{modelValue:l.value,"onUpdate:modelValue":a[0]||(a[0]=o=>l.value=o),type:s(u).RADIO},null,8,["modelValue","type"])],64))}});export{q as default};
