import{_ as c}from"./AddManualLink.vue_vue_type_script_setup_true_lang-C_yPpN3a.js";import{I as f}from"./ItemsListing-D_KqSTZS.js";import{ay as v,J as r,ax as l,a3 as y,aP as s,bb as _,a4 as b,az as h,aA as g,o as n,aD as w,aQ as A,ah as D}from"./index-BRUnowC8.js";import"./Toolbar-BEJzY0mB.js";import"./VToolbar-DS4mUdOC.js";import"./VDialog-Bh3mGVOy.js";import"./Container-ZHtGcXZO.js";import"./index-kQIztB-E.js";import"./Button-BKv4xLAv.js";import"./ListItem-jfbxOrad.js";import"./userPreferences-DBWZCHKf.js";import"./VCheckboxBtn-D390s4L9.js";import"./VSelectionControl-Co1cRcmS.js";import"./MediaItemThumb-CIE9_Elw.js";import"./PanelviewItemCompact-CsJmi5IT.js";import"./VInfiniteScroll-BORsRMGl.js";import"./VVirtualScroll-htzu2YXu.js";import"./VAlert-DQxypmdN.js";const N=v({name:"Radios",__name:"LibraryRadios",setup(R){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(D,null,[n(f,{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(A).RADIO},null,8,["modelValue","type"])],64))}});export{N as default};
