import{I as f}from"./ItemsListing-t4zttHcu.js";import{U as _,x as l,a4 as n,o as v,a6 as e,aY as b,b as w,a0 as h,X as g,F as d,a2 as o,a7 as m,I as A}from"./index-B-lUZalq.js";import{_ as I}from"./AddManualLink.vue_vue_type_script_setup_true_lang-C5lewnND.js";import"./Container-Br6JH6Pm.js";import"./Button-kSJGA_Pw.js";import"./VBtn-BPJ1JKW-.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./VContainer-DB65WVbe.js";/* empty css              */import"./Toolbar-BvxWbi_E.js";import"./VToolbar-RljK0PC9.js";import"./ListItem-LV_WU--g.js";import"./NowPlayingBadge.vue_vue_type_style_index_0_lang-DnroVGI-.js";import"./VInput-BWBQqjuk.js";import"./MediaItemThumb-DapaMoP4.js";import"./PanelviewItemCompact-CIDxIfoQ.js";import"./VSpacer-DDLrofv-.js";import"./VTextField-B-d5Pe9I.js";import"./VInfiniteScroll-CKZj-VKd.js";import"./layout-BuzUTwrQ.js";import"./VRow-BQOTE9C_.js";import"./VVirtualScroll-CceW16X7.js";import"./VAlert-QHTIcuEJ.js";import"./VDialog-CAgq0L03.js";const H=_({name:"Radios",__name:"LibraryRadios",setup(R){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)=>(g(),h(A,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(I,{modelValue:r.value,"onUpdate:modelValue":a[0]||(a[0]=y=>r.value=y),type:o(m).RADIO},null,8,["modelValue","type"])],64))}});export{H as default};
