import{I as f}from"./ItemsListing-C_NjfGm_.js";import{d as _,r as l,s as n,m as v,v as e,a$ as b,q as k,c as w,b as u,u as o,M as m,F as T,o as h}from"./index-BhOyEZK_.js";import{_ as g}from"./AddManualLink.vue_vue_type_script_setup_true_lang-CQzWTLsb.js";import"./Container-CLJQvqnD.js";import"./index-CBho6rsP.js";import"./VContainer-DKHNP7rI.js";/* empty css              */import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./Toolbar-GfWaAZNh.js";import"./VToolbar-B9zhRGbf.js";import"./VBtn-BOIOydWK.js";import"./Button-CKoakfK8.js";import"./ListItem-DC58B-Oa.js";import"./NowPlayingBadge.vue_vue_type_style_index_0_lang-BBvJ2GE2.js";import"./VInput-CthlhD7f.js";import"./MediaItemThumb-CbztwwtB.js";import"./PanelviewItemCompact-0b7dnUhV.js";import"./VSpacer-C-Bv7Ge7.js";import"./VTextField-Sp-MxMBq.js";import"./VInfiniteScroll-hhgaPcVh.js";import"./layout-D8AfXc1V.js";import"./VRow-CoIuIaw9.js";import"./VVirtualScroll-Cb6ed4Ze.js";import"./VAlert-BbF_x8Sn.js";import"./VDialog-DihmGs5r.js";const Q=_({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)=>(h(),w(T,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{Q as default};
