import{I as f}from"./ItemsListing-CHZs9N6z.js";import{I as v,_ as y}from"./ProviderDetails.vue_vue_type_script_setup_true_lang-BKRBxfS6.js";import{a7 as k,F as l,M as I,L as _,ap as i,aN as h,N as b,a8 as w,a9 as r,o as D,ai as m,aa as n,a0 as g}from"./index-CFcIX8RO.js";import"./Container-iGBsqgnx.js";import"./index-kQIztB-E.js";import"./Toolbar-DambSy-S.js";import"./VToolbar-B_3_MVxk.js";import"./Button-IxLZkOI0.js";import"./ListItem-CWPLlf7K.js";import"./NowPlayingBadge.vue_vue_type_style_index_0_lang-CGTv89Z9.js";import"./VCheckboxBtn-Dy9mjR59.js";import"./MediaItemThumb-oOnMmU-2.js";import"./PanelviewItemCompact-YHP34gKS.js";import"./VInfiniteScroll-DY-7nfIB.js";import"./VVirtualScroll-BRrQ8Y7O.js";import"./VAlert-DZurr_D6.js";import"./marquee_text_sync-gXoJPEDk.js";import"./VDialog-C2cPU7vi.js";const G=k({__name:"PlaylistDetails",props:{itemId:{},provider:{}},setup(p){const t=p,s=l(!1),e=l(),u=async function(){e.value=await i.getPlaylist(t.itemId,t.provider)};I(()=>t.itemId,a=>{a&&u()},{immediate:!0}),_(()=>{const a=i.subscribe(h.MEDIA_ITEM_UPDATED,o=>{const c=o.data;e.value?.uri==c.uri&&(s.value=!0)});b(a)});const d=async function(a){return await i.getPlaylistTracks(t.itemId,t.provider,a.refresh)};return(a,o)=>(r(),w(g,null,[D(v,{item:e.value},null,8,["item"]),e.value?(r(),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":d,"sort-keys":["position","position_desc","name","artist","album","duration","duration_desc"],"update-available":s.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?(r(),m(y,{key:1,"item-details":e.value},null,8,["item-details"])):n("",!0)],64))}});export{G as default};
