import{I as v}from"./ItemsListing-Coo-fYjR.js";import{I as y,_ as I}from"./ProviderDetails.vue_vue_type_script_setup_true_lang-CBpKx5a-.js";import{x as h,r as l,w as k,o as _,I as r,ah as b,b as w,y as i,D,n as g,z as p,K as n,F as E}from"./index-CmG5Lu4c.js";import"./ItemContextMenu.vue_vue_type_style_index_0_scoped_3a9a25e3_lang-DDAWVj5t.js";import"./ProviderIcon.vue_vue_type_script_setup_true_lang-3rkrFzvc.js";import"./VListItem-B8naaqXT.js";import"./VChip-BTF3BXxF.js";import"./VList-B3rYhbT8.js";import"./VMenu-Cq7Is-YL.js";import"./VCard-CydYR8T2.js";import"./VCardText-BBnD13q2.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./eventbus-CGRXT3Tn.js";import"./ListItem-oqytiPeb.js";import"./VCheckbox-B2EKci9b.js";import"./VCheckboxBtn-B3luQs9_.js";import"./VSpacer-icVgDxg4.js";/* empty css              */import"./PanelviewItemCompact-bT5_S05b.js";import"./Container-S0AVaCVQ.js";import"./VContainer-BlIut0Ek.js";import"./Toolbar-D6_sJyDo.js";import"./VToolbar-Digny4I4.js";import"./VTextField-BdHUeHhi.js";import"./VInfiniteScroll-BsiPw7TI.js";import"./layout-ChM0Bb5g.js";import"./VRow-C-ThHV-Q.js";import"./VVirtualScroll-QvVcc1QG.js";import"./VAlert-DMLWOftx.js";import"./marquee_text_sync-D9BIP5Y7.js";import"./VDialog-C9-gohtw.js";const rt=h({__name:"PlaylistDetails",props:{itemId:{},provider:{}},setup(u){const t=u,o=l(!1),e=l(),d=async function(){e.value=await r.getPlaylist(t.itemId,t.provider)};k(()=>t.itemId,a=>{a&&d()},{immediate:!0}),_(()=>{const a=r.subscribe(b.MEDIA_ITEM_UPDATED,s=>{var m;const f=s.data;((m=e.value)==null?void 0:m.uri)==f.uri&&(o.value=!0)});w(a)});const c=async function(a){return await r.getPlaylistTracks(t.itemId,t.provider,a.refresh)};return(a,s)=>(i(),D(E,null,[g(y,{item:e.value},null,8,["item"]),e.value?(i(),p(v,{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(),p(I,{key:1,"item-details":e.value},null,8,["item-details"])):n("",!0)],64))}});export{rt as default};
