import{_,f as y}from"./ItemsListing.vue_vue_type_script_setup_true_lang-436cf3d3.js";import{_ as k}from"./InfoHeader.vue_vue_type_style_index_0_lang-36a95710.js";import{l as b,r as u,w as I,o as h,O as l,af as w,b as D,q as E,y as g,j as c}from"./index-e9211ef1.js";import"./ListviewItem-b7a4258b.js";import"./MediaItemThumb.vue_vue_type_style_index_0_lang-278977b5.js";import"./VMenu-bc0cce60.js";import"./VDivider-336c24cd.js";import"./VBtn-68784d55.js";import"./VListItem-230d1393.js";import"./Container-349a0ac0.js";/* empty css              */import"./VDialog-5f240a62.js";import"./VCard-138864fc.js";import"./VToolbar-daf2b89f.js";import"./VSelect-04a129eb.js";/* empty css                             */import"./PanelviewItem.vue_vue_type_style_index_0_lang-fefd2afe.js";import"./Alert-55091fd0.js";import"./VSpacer-bdf2f653.js";import"./VBadge-9fa94f29.js";import"./VRow-e8f3e51e.js";import"./layout-4499d5bc.js";const L=b({__name:"PlaylistDetails",props:{itemId:{},provider:{}},setup(d){const i=d,s=u(!1),o=u(),p=async function(){o.value=await l.getPlaylist(i.itemId,i.provider)};I(()=>i.itemId,t=>{t&&p()},{immediate:!0}),h(()=>{const t=l.subscribe(w.MEDIA_ITEM_ADDED,e=>{var r;const a=e.data;((r=o.value)==null?void 0:r.uri)==a.uri&&(s.value=!0)});D(t)});const f=async function(t,e,a,r,v=!0){const m=[];return await l.getPlaylistTracks(i.itemId,i.provider,n=>{console.log("chunk",n.length),m.push(...n)}),y(m,t,e,a,r,v)};return(t,e)=>{var a;return E(),g("section",null,[c(k,{item:o.value,"active-provider":(a=o.value)==null?void 0:a.provider_mappings[0].provider_domain},null,8,["item","active-provider"]),c(_,{itemtype:"playlisttracks","parent-item":o.value,"show-provider":!1,"show-library":!1,"show-favorites-only-filter":!1,"show-track-number":!1,"load-data":f,"sort-keys":["position","position DESC","sort_name","sort_artist","sort_album"],"update-available":s.value,onRefreshClicked:e[0]||(e[0]=r=>{p(),s.value=!1}),title:t.$t("playlist_tracks")},null,8,["parent-item","update-available","title"])])}}});export{L as default};
