import{_,f as y}from"./ItemsListing.vue_vue_type_script_setup_true_lang-83c47556.js";import{_ as k}from"./InfoHeader.vue_vue_type_style_index_0_lang-ffdc6f99.js";import{C as b}from"./Container-4773c160.js";import{l as h,r as c,w,o as I,O as l,af as D,b as C,q as E,y as g,j as n,x as T}from"./index-a5bb9833.js";import"./ListviewItem-e2342ce8.js";import"./MediaItemThumb.vue_vue_type_style_index_0_lang-a35ce75a.js";import"./VMenu-240a4406.js";import"./VDivider-df9414f0.js";import"./VBtn-629f5316.js";import"./VListItem-39677d21.js";import"./VDialog-667c0916.js";import"./VCard-04ae357c.js";import"./VToolbar-b79315e8.js";import"./VSelect-4d69c543.js";/* empty css                             */import"./PanelviewItem.vue_vue_type_style_index_0_lang-d218249a.js";import"./Alert-a5ce795e.js";import"./VBadge-f7d58168.js";import"./VRow-7d86481a.js";/* empty css              */import"./layout-ff13c6fd.js";const Q=h({__name:"PlaylistDetails",props:{itemId:{},provider:{}},setup(d){const i=d,s=c(!1),o=c(),p=async function(){o.value=await l.getPlaylist(i.itemId,i.provider)};w(()=>i.itemId,t=>{t&&p()},{immediate:!0}),I(()=>{const t=l.subscribe(D.MEDIA_ITEM_ADDED,e=>{var r;const a=e.data;((r=o.value)==null?void 0:r.uri)==a.uri&&(s.value=!0)});C(t)});const f=async function(t,e,a,r,v=!0){const m=[];return await l.getPlaylistTracks(i.itemId,i.provider,u=>{console.log("chunk",u.length),m.push(...u)}),y(m,t,e,a,r,v)};return(t,e)=>{var a;return E(),g("section",null,[n(k,{item:o.value,"active-provider":(a=o.value)==null?void 0:a.provider_mappings[0].provider_domain},null,8,["item","active-provider"]),n(b,null,{default:T(()=>[n(_,{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"])]),_:1})])}}});export{Q as default};
