import{I as f}from"./ItemsListing-Cnfrbqt8.js";import{I as v,_ as y}from"./ProviderDetails.vue_vue_type_style_index_0_lang-B173j0nZ.js";import{az as h,J as l,L as k,a3 as I,bc as r,bB as _,a4 as b,aP as w,aG as i,o as D,aF as m,aK as n,ah as P}from"./index-D2rF_80D.js";import"./Container-C7yRkeCv.js";import"./index-kQIztB-E.js";import"./Toolbar-C66D0zTJ.js";import"./VToolbar-Db4qfa2C.js";import"./Button-CrfR8Gdt.js";import"./ListItem-CU9QYmiw.js";import"./NowPlayingBadge.vue_vue_type_style_index_0_lang-cf4_7ViH.js";import"./MediaItemThumb-A-03axGx.js";import"./VCheckbox-DccbdgFZ.js";import"./VCheckboxBtn-Dik76WyM.js";import"./VSelectionControl-BHjDOTFl.js";import"./PanelviewItemCompact-BWonx8dk.js";import"./userPreferences-DWdlmlmR.js";import"./VInfiniteScroll-CfzetGUD.js";import"./VVirtualScroll-CG155sfU.js";import"./marquee_text_sync-Bj0t3siK.js";const j=h({__name:"PlaylistDetails",props:{itemId:{},provider:{}},setup(p){const t=p,o=l(!1),e=l(),u=async function(){e.value=await r.getPlaylist(t.itemId,t.provider)};k(()=>t.itemId,a=>{a&&u()},{immediate:!0}),I(()=>{const a=r.subscribe(_.MEDIA_ITEM_UPDATED,s=>{const d=s.data;e.value?.uri==d.uri&&(o.value=!0)});b(a)});const c=async function(a){return await r.getPlaylistTracks(t.itemId,t.provider,a.refresh)};return(a,s)=>(i(),w(P,null,[D(v,{item:e.value},null,8,["item"]),e.value?(i(),m(f,{key:0,itemtype:"playlisttracks","parent-item":e.value,"show-provider":!1,"show-library":!1,"show-favorites-only-filter":!1,"show-track-number":!1,"show-refresh-button":!0,"load-items":c,"sort-keys":["position","position_desc","name","artist","album","duration","duration_desc"],"update-available":o.value,title:a.$t("playlist_tracks"),"allow-key-hooks":!0,path:`playlist.${t.itemId}.${t.provider}`,"restore-state":!0,"no-server-side-sorting":!0},null,8,["parent-item","update-available","title","path"])):n("",!0),e.value?(i(),m(y,{key:1,"item-details":e.value},null,8,["item-details"])):n("",!0)],64))}});export{j as default};
