import{_ as p}from"./AddManualLink.vue_vue_type_script_setup_true_lang-CrKoNUWG.js";import{I as f}from"./ItemsListing-BGSSzUZI.js";import{ay as v,J as i,ax as l,a3 as y,aP as s,bb as _,a4 as b,az as k,aA as h,o as n,aD as w,aQ as T,ah as g}from"./index-DQ0AtwBO.js";import"./Toolbar-DzEOyy2X.js";import"./VToolbar-C46SA8LU.js";import"./VDialog-DPUbCG_Q.js";import"./Container-B_XuBbhG.js";import"./index-kQIztB-E.js";import"./Button-BN1AB9wp.js";import"./ListItem-1CvnM0XT.js";import"./NowPlayingBadge.vue_vue_type_style_index_0_lang-DZkK7xbC.js";import"./MediaItemThumb-CrlE-QNi.js";import"./VCheckbox-BR0Jkn6d.js";import"./VCheckboxBtn-CmKDOTuO.js";import"./VSelectionControl-CwC4p8T5.js";import"./PanelviewItemCompact-DtgmaW7-.js";import"./userPreferences-D6aKtNNy.js";import"./VInfiniteScroll-C0GSG3iw.js";import"./VVirtualScroll-DJ5JNDOI.js";import"./VAlert-DHftkkb2.js";const R=v({name:"Tracks",__name:"LibraryTracks",setup(A){const o=i(!1),e=i(l.libraryTracksCount),r=i(!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"];y(()=>{const t=s.subscribe(_.MEDIA_ITEM_ADDED,a=>{a.object_id?.startsWith("library://track")&&(o.value=!0)});b(t)});const d=async function(t){return t.favoritesOnly=t.favoritesOnly||void 0,o.value=!1,c(t),await s.getLibraryTracks(t.favoritesOnly,t.search,t.limit,t.offset,t.sortBy,t.provider&&t.provider.length>0?t.provider:void 0)},c=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,a)=>(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":d,"sort-keys":u,"show-album":!0,"update-available":o.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:"mdi-music-note","restore-state":!0,total:e.value,"show-provider-filter":!0},null,8,["update-available","title","extra-menu-items","total"]),n(p,{modelValue:r.value,"onUpdate:modelValue":a[0]||(a[0]=m=>r.value=m),type:w(T).RADIO},null,8,["modelValue","type"])],64))}});export{R as default};
