import{I as f}from"./ItemsListing-BPCoDFMa.js";import{Q as _,x as n,a2 as u,o as v,a4 as e,aS as b,b as k,Z as w,B as m,a0 as r,a5 as c,G as T,S as h}from"./index-orrnp8a1.js";import{_ as g}from"./AddManualLink.vue_vue_type_script_setup_true_lang-BB_Bg3Rd.js";import"./MediaItemThumb-BFLLxiOJ.js";import"./ProviderIcon.vue_vue_type_style_index_0_lang-DgYavPcK.js";import"./VChip-DzIcRFdM.js";import"./VBtn-BJolvyKt.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./ListItem-BOpEb2vA.js";import"./VCheckbox-BaanYS4J.js";import"./VCheckboxBtn-CICj8ZxL.js";import"./PanelviewItemCompact-Bf1Qb2IB.js";import"./VSpacer-FMK5QbR9.js";/* empty css              */import"./Container-C-MxRHLg.js";import"./VContainer-DvR1uhzJ.js";import"./Toolbar-CE2HDv9i.js";import"./VToolbar-BlKUHnwt.js";import"./VTextField-DaF8PfrV.js";import"./VInfiniteScroll-CDme3Tib.js";import"./layout-BTr25AHs.js";import"./VRow-C4MwkXJh.js";import"./VVirtualScroll-Q9Rc10mA.js";import"./VAlert-BhQ3L7Kc.js";import"./VDialog-oxeMlk6d.js";const J=_({name:"Tracks",__name:"LibraryTracks",setup(A){const s=n(!1),i=n(u.libraryTracksCount),l=n(!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"];v(()=>{const t=e.subscribe(b.MEDIA_ITEM_ADDED,a=>{var o;(o=a.object_id)!=null&&o.startsWith("library://track")&&(s.value=!0)});k(t)});const p=async function(t){return t.favoritesOnly=t.favoritesOnly||void 0,s.value=!1,y(t),await e.getLibraryTracks(t.favoritesOnly,t.search,t.limit,t.offset,t.sortBy)},y=async function(t){if(!t.favoritesOnly){i.value=u.libraryTracksCount;return}i.value=await e.getLibraryTracksCount(t.favoritesOnly||!1)};return(t,a)=>(h(),w(T,null,[m(f,{itemtype:"tracks",path:"librarytracks","show-provider":!1,"show-favorites-only-filter":!0,"show-track-number":!1,"load-paged-data":p,"sort-keys":d,"show-album":!0,"update-available":s.value,title:t.$t("tracks"),"show-search-button":!0,"allow-key-hooks":!0,"extra-menu-items":[{label:"sync_now",icon:"mdi-sync",action:()=>{r(e).startSync([r(c).TRACK])},overflowAllowed:!0,disabled:r(e).syncTasks.value.length>0},{label:"add_url_item",labelArgs:[],action:()=>{l.value=!0},icon:"mdi-playlist-plus"}],icon:"mdi-music-note","restore-state":!0,total:i.value},null,8,["update-available","title","extra-menu-items","total"]),m(g,{modelValue:l.value,"onUpdate:modelValue":a[0]||(a[0]=o=>l.value=o),type:r(c).RADIO},null,8,["modelValue","type"])],64))}});export{J as default};
