import{_ as f}from"./AddManualLink.vue_vue_type_script_setup_true_lang-DlAmWTWI.js";import{I as v}from"./ItemsListing-Cnfrbqt8.js";import{az as y,J as i,b7 as l,a3 as _,bc as s,bB as b,a4 as k,aP as h,aG as w,o as n,aE as u,bd as T,ah as g}from"./index-D2rF_80D.js";import{M as E}from"./music-2-DQ83ewHN.js";import"./Toolbar-C66D0zTJ.js";import"./VToolbar-Db4qfa2C.js";import"./Container-C7yRkeCv.js";import"./index-kQIztB-E.js";import"./Button-CrfR8Gdt.js";import"./ListItem-CU9QYmiw.js";import"./NowPlayingBadge.vue_vue_type_style_index_0_lang-cf4_7ViH.js";import"./MediaItemThumb-A-03axGx.js";import"./VCheckbox-DccbdgFZ.js";import"./VCheckboxBtn-Dik76WyM.js";import"./VSelectionControl-BHjDOTFl.js";import"./PanelviewItemCompact-BWonx8dk.js";import"./userPreferences-DWdlmlmR.js";import"./VInfiniteScroll-CfzetGUD.js";import"./VVirtualScroll-CG155sfU.js";import"./createLucideIcon-Bb8oGlVw.js";const W=y({name:"Tracks",__name:"LibraryTracks",setup(A){const a=i(!1),e=i(l.libraryTracksCount),r=i(!1),d=["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=s.subscribe(b.MEDIA_ITEM_ADDED,o=>{o.object_id?.startsWith("library://track")&&(a.value=!0)});k(t)});const c=async function(t){return t.favoritesOnly=t.favoritesOnly||void 0,a.value=!1,m(t),await s.getLibraryTracks(t.favoritesOnly,t.search,t.limit,t.offset,t.sortBy,t.provider&&t.provider.length>0?t.provider:void 0)},m=async function(t){if(!t.favoritesOnly&&!t.provider){e.value=l.libraryTracksCount;return}if(t.provider&&t.provider.length>0){e.value=void 0;return}e.value=await s.getLibraryTracksCount(t.favoritesOnly||!1)};return(t,o)=>(w(),h(g,null,[n(v,{itemtype:"tracks",path:"librarytracks","show-provider":!1,"show-favorites-only-filter":!0,"show-track-number":!1,"load-paged-data":c,"sort-keys":d,"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:()=>{r.value=!0},icon:"mdi-playlist-plus"}],icon:u(E),"restore-state":!0,total:e.value,"show-provider-filter":!0},null,8,["update-available","title","extra-menu-items","icon","total"]),n(f,{modelValue:r.value,"onUpdate:modelValue":o[0]||(o[0]=p=>r.value=p),type:u(T).RADIO},null,8,["modelValue","type"])],64))}});export{W as default};
