import{_ as p}from"./AddManualLink.vue_vue_type_script_setup_true_lang-BSD43rWS.js";import{I as f}from"./ItemsListing-CHZs9N6z.js";import{a7 as y,F as r,a6 as i,L as _,ap as l,aN as v,N as b,a8 as k,a9 as h,o as n,ac as T,aq as w,a0 as g}from"./index-CFcIX8RO.js";import"./Toolbar-DambSy-S.js";import"./VToolbar-B_3_MVxk.js";import"./VDialog-C2cPU7vi.js";import"./Container-iGBsqgnx.js";import"./index-kQIztB-E.js";import"./Button-IxLZkOI0.js";import"./ListItem-CWPLlf7K.js";import"./NowPlayingBadge.vue_vue_type_style_index_0_lang-CGTv89Z9.js";import"./VCheckboxBtn-Dy9mjR59.js";import"./MediaItemThumb-oOnMmU-2.js";import"./PanelviewItemCompact-YHP34gKS.js";import"./VInfiniteScroll-DY-7nfIB.js";import"./VVirtualScroll-BRrQ8Y7O.js";import"./VAlert-DZurr_D6.js";const R=y({name:"Tracks",__name:"LibraryTracks",setup(A){const a=r(!1),o=r(i.libraryTracksCount),s=r(!1),u=["name","name_desc","sort_name","sort_name_desc","duration","duration_desc","timestamp_added","timestamp_added_desc","last_played","last_played_desc","play_count","play_count_desc"];_(()=>{const t=l.subscribe(v.MEDIA_ITEM_ADDED,e=>{e.object_id?.startsWith("library://track")&&(a.value=!0)});b(t)});const m=async function(t){return t.favoritesOnly=t.favoritesOnly||void 0,a.value=!1,c(t),await l.getLibraryTracks(t.favoritesOnly,t.search,t.limit,t.offset,t.sortBy)},c=async function(t){if(!t.favoritesOnly){o.value=i.libraryTracksCount;return}o.value=await l.getLibraryTracksCount(t.favoritesOnly||!1)};return(t,e)=>(h(),k(g,null,[n(f,{itemtype:"tracks",path:"librarytracks","show-provider":!1,"show-favorites-only-filter":!0,"show-track-number":!1,"load-paged-data":m,"sort-keys":u,"show-album":!0,"update-available":a.value,title:t.$t("tracks"),"show-search-button":!0,"allow-key-hooks":!0,"extra-menu-items":[{label:"add_url_item",labelArgs:[],action:()=>{s.value=!0},icon:"mdi-playlist-plus"}],icon:"mdi-music-note","restore-state":!0,total:o.value},null,8,["update-available","title","extra-menu-items","total"]),n(p,{modelValue:s.value,"onUpdate:modelValue":e[0]||(e[0]=d=>s.value=d),type:T(w).RADIO},null,8,["modelValue","type"])],64))}});export{R as default};
