import{_ as c}from"./AddManualLink.vue_vue_type_script_setup_true_lang-SVJzyiWq.js";import{I as v}from"./ItemsListing-COLlw5bq.js";import{aw as f,J as r,av as l,a3 as y,aN as s,b9 as _,a4 as b,ax as h,ay as g,o as n,aB as w,aO as R,ag as A}from"./index-DhxwW1_d.js";import"./Toolbar-BfQbzcpc.js";import"./VToolbar-69Rn7taX.js";import"./VDialog-CSHdlt_o.js";import"./Container-D2fLqW0L.js";import"./index-kQIztB-E.js";import"./Button-Dq6btUmD.js";import"./ListItem-DYjdeEgj.js";import"./userPreferences-Dy9_V1Qk.js";import"./VCheckboxBtn-DVNTnMLw.js";import"./MediaItemThumb-CBiFFPUA.js";import"./PanelviewItemCompact-KbS5CIFi.js";import"./VInfiniteScroll-Ce2Gi50Y.js";import"./VVirtualScroll-DTRxXskS.js";import"./VAlert-D-KKGAlc.js";const K=f({name:"Radios",__name:"LibraryRadios",setup(D){const a=r(!1),t=r(l.libraryRadiosCount),i=r(!1),d=["name","name_desc","sort_name","sort_name_desc","timestamp_added","timestamp_added_desc","last_played","last_played_desc","play_count","play_count_desc"];y(()=>{const e=s.subscribe(_.MEDIA_ITEM_ADDED,o=>{o.object_id?.startsWith("library://radio")&&(a.value=!0)});b(e)});const u=async function(e){return a.value=!1,p(e),await s.getLibraryRadios(e.favoritesOnly||void 0,e.search,e.limit,e.offset,e.sortBy,e.provider&&e.provider.length>0?e.provider:void 0)},p=async function(e){if(!e.favoritesOnly&&!e.provider){t.value=l.libraryRadiosCount;return}if(e.provider&&e.provider.length>0){t.value=void 0;return}t.value=await s.getLibraryRadiosCount(e.favoritesOnly||!1)};return(e,o)=>(g(),h(A,null,[n(v,{itemtype:"radios",path:"libraryradios","show-duration":!1,"show-provider":!1,"show-favorites-only-filter":!0,"load-paged-data":u,"sort-keys":d,"update-available":a.value,title:e.$t("radios"),"show-search-button":!0,"allow-key-hooks":!0,"extra-menu-items":[{label:"add_url_item",labelArgs:[],action:()=>{i.value=!0},icon:"mdi-playlist-plus"}],icon:"mdi-access-point","restore-state":!0,total:t.value,"show-provider-filter":!0},null,8,["update-available","title","extra-menu-items","total"]),n(c,{modelValue:i.value,"onUpdate:modelValue":o[0]||(o[0]=m=>i.value=m),type:w(R).RADIO},null,8,["modelValue","type"])],64))}});export{K as default};
