import{I as f}from"./ItemsListing-BNF8UGX2.js";import{x as _,r as n,H as m,o as v,I as e,ah as b,b as k,D as h,l as u,G as r,M as c,F as w,z as T}from"./index-DKhfhZyI.js";import{_ as g}from"./AddManualLink.vue_vue_type_script_setup_true_lang-tfyOwcsg.js";import"./ItemContextMenu.vue_vue_type_style_index_0_scoped_cee6bfa4_lang-BEm2OpTr.js";import"./ProviderIcon.vue_vue_type_style_index_0_lang-C_Zsg23g.js";import"./VListItem-DG7fZYqG.js";import"./VMenu-BTA9m0lg.js";import"./VCard-AQsAsy9j.js";import"./VCardText-PK-MK26S.js";import"./VList-BsIdJYb-.js";import"./VChip-Bt-2eXUN.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./eventbus-CGRXT3Tn.js";import"./ListItem-hgXNSQeh.js";import"./VCheckbox-w4Dp7feX.js";import"./VCheckboxBtn-SjULh2vZ.js";import"./PanelviewItemCompact-BXu7orP5.js";import"./VSpacer-lTIuHyc5.js";/* empty css              */import"./Container-DdZvDMit.js";import"./VContainer-bkYdVay1.js";import"./Toolbar-DfTAf723.js";import"./VToolbar-Be3D-k7i.js";import"./VTextField-C_1U2QFr.js";import"./VInfiniteScroll-s1qKdTFY.js";import"./layout-MVvGEKAO.js";import"./VRow-C3_3R0pl.js";import"./VVirtualScroll-DrLqMq8M.js";import"./VAlert-EFQTLSCo.js";import"./VDialog-zzdXdu7l.js";const et=_({name:"Tracks",__name:"LibraryTracks",setup(A){const s=n(!1),i=n(m.libraryTracksCount),l=n(!1),p=["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 d=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=m.libraryTracksCount;return}i.value=await e.getLibraryTracksCount(t.favoritesOnly||!1)};return(t,a)=>(T(),h(w,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":p,"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"]),u(g,{modelValue:l.value,"onUpdate:modelValue":a[0]||(a[0]=o=>l.value=o),type:r(c).RADIO},null,8,["modelValue","type"])],64))}});export{et as default};
