import{_ as p}from"./AddManualLink.vue_vue_type_script_setup_true_lang-C_yPpN3a.js";import{I as f}from"./ItemsListing-D_KqSTZS.js";import{ay as v,J as i,ax as l,a3 as y,aP as s,bb as _,a4 as b,az as k,aA as h,o as n,aD as w,aQ as T,ah as g}from"./index-BRUnowC8.js";import"./Toolbar-BEJzY0mB.js";import"./VToolbar-DS4mUdOC.js";import"./VDialog-Bh3mGVOy.js";import"./Container-ZHtGcXZO.js";import"./index-kQIztB-E.js";import"./Button-BKv4xLAv.js";import"./ListItem-jfbxOrad.js";import"./userPreferences-DBWZCHKf.js";import"./VCheckboxBtn-D390s4L9.js";import"./VSelectionControl-Co1cRcmS.js";import"./MediaItemThumb-CIE9_Elw.js";import"./PanelviewItemCompact-CsJmi5IT.js";import"./VInfiniteScroll-BORsRMGl.js";import"./VVirtualScroll-htzu2YXu.js";import"./VAlert-DQxypmdN.js";const P=v({name:"Tracks",__name:"LibraryTracks",setup(A){const o=i(!1),t=i(l.libraryTracksCount),r=i(!1),u=["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"];y(()=>{const e=s.subscribe(_.MEDIA_ITEM_ADDED,a=>{a.object_id?.startsWith("library://track")&&(o.value=!0)});b(e)});const d=async function(e){return e.favoritesOnly=e.favoritesOnly||void 0,o.value=!1,c(e),await s.getLibraryTracks(e.favoritesOnly,e.search,e.limit,e.offset,e.sortBy,e.provider&&e.provider.length>0?e.provider:void 0)},c=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 s.getLibraryTracksCount(e.favoritesOnly||!1)};return(e,a)=>(h(),k(g,null,[n(f,{itemtype:"tracks",path:"librarytracks","show-provider":!1,"show-favorites-only-filter":!0,"show-track-number":!1,"load-paged-data":d,"sort-keys":u,"show-album":!0,"update-available":o.value,title:e.$t("tracks"),"show-search-button":!0,"allow-key-hooks":!0,"extra-menu-items":[{label:"add_url_item",labelArgs:[],action:()=>{r.value=!0},icon:"mdi-playlist-plus"}],icon:"mdi-music-note","restore-state":!0,total:t.value,"show-provider-filter":!0},null,8,["update-available","title","extra-menu-items","total"]),n(p,{modelValue:r.value,"onUpdate:modelValue":a[0]||(a[0]=m=>r.value=m),type:w(T).RADIO},null,8,["modelValue","type"])],64))}});export{P as default};
