import{I as f}from"./ItemsListing-DWzn5l67.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-DdI--Yet.js";import{_ as g}from"./AddManualLink.vue_vue_type_script_setup_true_lang-BwytyuOP.js";import"./MediaItemThumb-DHcqTVjl.js";import"./ProviderIcon.vue_vue_type_style_index_0_lang-D41gG9IS.js";import"./VChip-BBcriFso.js";import"./VBtn-g6NhQ7fK.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./ListItem-BK1DMsnV.js";import"./VCheckbox-B4YfxJ0R.js";import"./VCheckboxBtn-BWCQ3DqN.js";import"./PanelviewItemCompact-kTIN1Q1A.js";import"./VSpacer-DDLLNEUh.js";/* empty css              */import"./Container-B4zACZDu.js";import"./VContainer-BtdP8B7E.js";import"./Toolbar-BGUFqu6B.js";import"./VToolbar-DRvSLcNG.js";import"./VTextField-CkYsZnxG.js";import"./VInfiniteScroll-B6R5NfAO.js";import"./layout-CiO1VcK1.js";import"./VRow-VEN0m6ZM.js";import"./VVirtualScroll-D10a-qpl.js";import"./VAlert-CIZAmx66.js";import"./VDialog-Babb4d0Q.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};
