import{_ as v}from"./ItemsListing.vue_vue_type_style_index_0_lang-e3f0c114.js";import{_ as y,a as _}from"./ProviderDetails.vue_vue_type_script_setup_true_lang-b493f7e4.js";import{y as k,r as p,w as b,o as h,N as r,ap as w,b as I,A as l,H as D,q as B,B as n,K as u,aq as E}from"./index-9b822783.js";import"./ListviewItem-030e11e6.js";import"./VBadge-c9fb58c5.js";import"./Container-05be0da0.js";import"./forwardRefs-af0663a3.js";import"./VMenu-8029677e.js";/* empty css              */import"./VInput-c159036c.js";import"./VSlideGroup-d3ac8eca.js";import"./VCard-0d72f9dd.js";import"./VCardText-bc96863a.js";import"./VTooltip-5955b4ca.js";import"./PanelviewItem.vue_vue_type_style_index_0_lang-846c4785.js";import"./contextmenu-b55bad56.js";import"./Alert-112324b3.js";import"./VAlert-fddf489c.js";import"./VToolbar-79c684b4.js";import"./VTextField-7d804c49.js";import"./VVirtualScroll-a3d1c1c9.js";import"./layout-71937d76.js";import"./VDialog-a6f484ad.js";const S=k({__name:"PlaylistDetails",props:{itemId:{},provider:{}},setup(c){const a=c,o=p(!1),e=p(),d=async function(){e.value=await r.getPlaylist(a.itemId,a.provider)};b(()=>a.itemId,t=>{t&&d()},{immediate:!0}),h(()=>{const t=r.subscribe(w.MEDIA_ITEM_ADDED,i=>{var m;const s=i.data;((m=e.value)==null?void 0:m.uri)==s.uri&&(o.value=!0)});I(t)});const f=async function(t){const i=[];return await r.getPlaylistTracks(a.itemId,a.provider,s=>{i.push(...s)},t.refresh&&!o.value),t.refresh&&await E(100),o.value=!1,i};return(t,i)=>(l(),D("section",null,[B(y,{item:e.value},null,8,["item"]),e.value?(l(),n(v,{key:0,itemtype:"playlisttracks","parent-item":e.value,"show-provider":!1,"show-library":!1,"show-favorites-only-filter":!1,"show-track-number":!1,"load-items":f,"sort-keys":["position","position_desc","name","artist","album","duration","duration_desc"],"update-available":o.value,title:t.$t("playlist_tracks"),"allow-key-hooks":!0},null,8,["parent-item","update-available","title"])):u("",!0),e.value?(l(),n(_,{key:1,"item-details":e.value},null,8,["item-details"])):u("",!0)]))}});export{S as default};
