import{I as f}from"./ItemsListing-DK1RMxgz.js";import{Q as _,x as n,a2 as d,o as v,a4 as e,aV 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-C8Wvo59W.js";import{_ as R}from"./AddManualLink.vue_vue_type_script_setup_true_lang-CjKQYfBS.js";import"./MediaItemThumb-DDMb_9k9.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./ListItem-BDnoqXe8.js";import"./Button-C6-W0Jei.js";import"./VBtn-DmOE8ObX.js";import"./VCheckbox-aZKtlmJa.js";import"./VCheckboxBtn-DZffJlMk.js";import"./PanelviewItemCompact-sXEe4fxv.js";import"./VSpacer-CRNj-rDk.js";/* empty css              */import"./Container-D43lS1qQ.js";import"./VContainer-BR45fXaf.js";import"./Toolbar-Bk_KlFQ2.js";import"./VToolbar-COHqcQ5L.js";import"./VTextField-h2jTOaQT.js";import"./VInfiniteScroll-DzhHULOU.js";import"./layout-D5VA38eE.js";import"./VRow-DV7BqAoZ.js";import"./VVirtualScroll-ZleTOGra.js";import"./VAlert-DjHMaeFy.js";import"./VDialog-BKEcjOuu.js";const H=_({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{H as default};
