import{I as f}from"./ItemsListing-6VW59A0B.js";import{av as _,H as l,au as n,a3 as v,aL as a,b6 as b,a4 as w,aw as h,x as d,az as o,aM as u,ag as g,ax as A}from"./index-C-Ivu3jU.js";import{_ as R}from"./AddManualLink.vue_vue_type_script_setup_true_lang-ChdXOxn5.js";import"./Container-DVyc_Yt_.js";import"./index-kQIztB-E.js";import"./VContainer-CNNJtZg6.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./Toolbar-CLPRlZ-4.js";import"./VToolbar-DTucOBiF.js";import"./Button-FtStaD9_.js";import"./ListItem-BLmrgznL.js";import"./NowPlayingBadge.vue_vue_type_style_index_0_lang-B5IzKSW4.js";import"./VCheckboxBtn-BmKOjEU4.js";import"./VInput-CnrZS6Kh.js";import"./MediaItemThumb-BsXB7IV6.js";import"./PanelviewItemCompact-5_ppRL3T.js";import"./VTextField-Bkx949P5.js";import"./VSnackbar-C_PtJN1U.js";import"./layout-D2NB7OTD.js";import"./VRow-DOG0WeJD.js";import"./VVirtualScroll-C_Lzj3jv.js";import"./VAlert-B3qbTkCR.js";import"./VDialog-BZuFHdVP.js";const J=_({name:"Radios",__name:"LibraryRadios",setup(D){const s=l(!1),i=l(n.libraryRadiosCount),r=l(!1),m=["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=a.subscribe(b.MEDIA_ITEM_ADDED,e=>{e.object_id?.startsWith("library://radio")&&(s.value=!0)});w(t)});const p=async function(t){return s.value=!1,c(t),await a.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 a.getLibraryRadiosCount(t.favoritesOnly||!1)};return(t,e)=>(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":m,"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(a).startSync([o(u).RADIO])},overflowAllowed:!0,disabled:o(a).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":e[0]||(e[0]=y=>r.value=y),type:o(u).RADIO},null,8,["modelValue","type"])],64))}});export{J as default};
