import{_ as f}from"./AddManualLink.vue_vue_type_script_setup_true_lang-C6ynelBz.js";import{I as v}from"./ItemsListing-e8i_b9av.js";import{s as l,a as i,E as y,M as _}from"./index-Cc0s9xHj.js";import{d as b,r as s,o as k,a3 as h,c as g,J as n,u,aR as w,F as T,b as E}from"./lucide-C_a_D9Y7.js";import"./Toolbar-CpDb2XyG.js";import"./vuetify-CvGbteJu.js";import"./Container-C8q3OdIF.js";import"./index-kQIztB-E.js";import"./userPreferences-CgJSfdV_.js";import"./vue-router-lrCq0UAu.js";import"./Button-CCvS9sA_.js";import"./ListItem-Ct4Nbn6d.js";import"./NowPlayingBadge.vue_vue_type_style_index_0_lang-DhKX4Vvj.js";import"./MediaItemThumb-CN3YtoJY.js";import"./ProviderIcon.vue_vue_type_style_index_0_lang-7ardqVNw.js";import"./vue-i18n-COI_JhGQ.js";import"./PanelviewItemCompact-CL6Psz6q.js";import"./qrcode-DICVlH4J.js";import"./marked-D9eDbhZJ.js";import"./color-CqFg8eif.js";import"./vueuse-Blk5jQ0T.js";/* empty css            */import"./swiper-UowLVX5q.js";const Q=b({name:"Tracks",__name:"LibraryTracks",setup(I){const r=s(!1),e=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 t=i.subscribe(y.MEDIA_ITEM_ADDED,o=>{o.object_id?.startsWith("library://track")&&(r.value=!0)});h(t)});const c=async function(t){return t.favoritesOnly=t.favoritesOnly||void 0,r.value=!1,m(t),await i.getLibraryTracks(t.favoritesOnly,t.search,t.limit,t.offset,t.sortBy,t.provider&&t.provider.length>0?t.provider:void 0,t.genreIds)},m=async function(t){if(!t.favoritesOnly&&!t.provider){e.value=l.libraryTracksCount;return}if(t.provider&&t.provider.length>0){e.value=void 0;return}e.value=await i.getLibraryTracksCount(t.favoritesOnly||!1)};return(t,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:t.$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:e.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};
