import{_ as f}from"./AddManualLink.vue_vue_type_script_setup_true_lang-CrcvUKqp.js";import{I as v}from"./ItemsListing-DdSUpMhP.js";import{s as l,a as i,E as y,M as _}from"./index-CKxLfxpS.js";import{d as b,r as s,o as k,a3 as h,b as g,J as n,u,aL as w,F as T,e as E}from"./lucide-UY9XeFdQ.js";import"./Toolbar-Da01lZeW.js";import"./vuetify-C0IIhwYL.js";import"./Container-B1UOd5ED.js";import"./index-kQIztB-E.js";import"./userPreferences-BgjK7xB_.js";import"./vue-router-DNlH4vva.js";import"./Button-DdCpYaoc.js";import"./ListItem-BP0lui-9.js";import"./NowPlayingBadge.vue_vue_type_style_index_0_lang-CnaMVQug.js";import"./MediaItemThumb-DiY2t3Gt.js";import"./ProviderIcon.vue_vue_type_style_index_0_lang-DYXAnx83.js";import"./vue-i18n-DwYfJ_fn.js";import"./PanelviewItemCompact-BhrDAsYI.js";import"./color-CcshWhNz.js";import"./qrcode-CJNXjF_3.js";import"./marked-D9eDbhZJ.js";import"./vueuse-Dj-fx4H6.js";/* empty css            */import"./swiper-DNx4mJDO.js";const Q=b({name:"Tracks",__name:"LibraryTracks",setup(I){const r=s(!1),t=s(l.libraryTracksCount),a=s(!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"];k(()=>{const e=i.subscribe(y.MEDIA_ITEM_ADDED,o=>{o.object_id?.startsWith("library://track")&&(r.value=!0)});h(e)});const c=async function(e){return e.favoritesOnly=e.favoritesOnly||void 0,r.value=!1,m(e),await i.getLibraryTracks(e.favoritesOnly,e.search,e.limit,e.offset,e.sortBy,e.provider&&e.provider.length>0?e.provider:void 0,e.genreIds)},m=async function(e){if(!e.favoritesOnly&&!e.provider){t.value=l.libraryTracksCount;return}if(e.provider&&e.provider.length>0){t.value=void 0;return}t.value=await i.getLibraryTracksCount(e.favoritesOnly||!1)};return(e,o)=>(E(),g(T,null,[n(v,{itemtype:"tracks",path:"librarytracks","show-provider":!1,"show-favorites-only-filter":!0,"show-track-number":!1,"load-paged-data":c,"sort-keys":d,"show-album":!0,"update-available":r.value,title:e.$t("tracks"),"show-search-button":!0,"show-genre-filter":!0,"allow-key-hooks":!0,"extra-menu-items":[{label:"add_url_item",labelArgs:[],action:()=>{a.value=!0},icon:"mdi-playlist-plus"}],icon:u(w),"restore-state":!0,total:t.value,"show-provider-filter":!0},null,8,["update-available","title","extra-menu-items","icon","total"]),n(f,{modelValue:a.value,"onUpdate:modelValue":o[0]||(o[0]=p=>a.value=p),type:u(_).RADIO},null,8,["modelValue","type"])],64))}});export{Q as default};
