import{I as f}from"./ItemsListing-BHlkb6-j.js";import{d as _,i as l,s as n,j as v,m as e,a_ as b,l as k,c as w,o as T,b as u,u as o,M as m,F as h}from"./index-LFx1jIjH.js";import{_ as g}from"./AddManualLink.vue_vue_type_script_setup_true_lang-B63HFhhb.js";import"./Container-CuH2YNr5.js";import"./Button-SUce42c3.js";import"./VBtn-BYKkZzw0.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./VContainer-or1Uze2V.js";/* empty css              */import"./Toolbar-iQxHKI_C.js";import"./VToolbar-Dc2WDt1C.js";import"./ListItem-DhvO1M3C.js";import"./NowPlayingBadge.vue_vue_type_style_index_0_lang-B4veTxLS.js";import"./VInput-B3Z2GK8Z.js";import"./MediaItemThumb-cYqdWFcl.js";import"./PanelviewItemCompact-Bf82DAtE.js";import"./VSpacer-Cg-cZSyv.js";import"./VTextField-DyzwZgKh.js";import"./VInfiniteScroll-DH2IK80_.js";import"./layout-C6GuZOkj.js";import"./VRow-cyJLSUM5.js";import"./VVirtualScroll-DYZmdOFl.js";import"./VAlert-Cyb25ra3.js";import"./VDialog-zNF2U_x9.js";const P=_({name:"Tracks",__name:"LibraryTracks",setup(A){const r=l(!1),s=l(n.libraryTracksCount),i=l(!1),c=["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=>{a.object_id?.startsWith("library://track")&&(r.value=!0)});k(t)});const d=async function(t){return t.favoritesOnly=t.favoritesOnly||void 0,r.value=!1,p(t),await e.getLibraryTracks(t.favoritesOnly,t.search,t.limit,t.offset,t.sortBy)},p=async function(t){if(!t.favoritesOnly){s.value=n.libraryTracksCount;return}s.value=await e.getLibraryTracksCount(t.favoritesOnly||!1)};return(t,a)=>(T(),w(h,null,[u(f,{itemtype:"tracks",path:"librarytracks","show-provider":!1,"show-favorites-only-filter":!0,"show-track-number":!1,"load-paged-data":d,"sort-keys":c,"show-album":!0,"update-available":r.value,title:t.$t("tracks"),"show-search-button":!0,"allow-key-hooks":!0,"extra-menu-items":[{label:"sync_now",icon:"mdi-sync",action:()=>{o(e).startSync([o(m).TRACK])},overflowAllowed:!0,disabled:o(e).syncTasks.value.length>0},{label:"add_url_item",labelArgs:[],action:()=>{i.value=!0},icon:"mdi-playlist-plus"}],icon:"mdi-music-note","restore-state":!0,total:s.value},null,8,["update-available","title","extra-menu-items","total"]),u(g,{modelValue:i.value,"onUpdate:modelValue":a[0]||(a[0]=y=>i.value=y),type:o(m).RADIO},null,8,["modelValue","type"])],64))}});export{P as default};
