import{_ as v}from"./ItemsListing.vue_vue_type_style_index_0_lang-cfe67ae4.js";import{_ as y,a as _}from"./ProviderDetails.vue_vue_type_script_setup_true_lang-6ac061a5.js";import{v as k,r as n,w as b,o as h,L as r,an as w,b as I,y as l,E as D,l as E,z as p,I as u,ao as T}from"./index-5804982a.js";import"./ListviewItem-8b7ae6a6.js";import"./VBadge-3d00ada8.js";import"./Container-d5ee1f41.js";import"./forwardRefs-03519353.js";import"./VMenu-18f2572a.js";/* empty css              */import"./VInput-fe7a35fc.js";import"./VSlideGroup-711de993.js";import"./VCard-cc8044ef.js";import"./VCardText-963b2439.js";import"./VTooltip-5622a67d.js";import"./PanelviewItem.vue_vue_type_style_index_0_lang-04756f0a.js";import"./contextmenu-95007cdc.js";import"./Alert-38a1b933.js";import"./VAlert-8600f5db.js";import"./VToolbar-ce6590ba.js";import"./VTextField-b58cde95.js";import"./VVirtualScroll-72995e2a.js";import"./layout-b05dbcdd.js";import"./VDialog-c56f60de.js";const S=k({__name:"PlaylistDetails",props:{itemId:{},provider:{}},setup(c){const a=c,o=n(!1),e=n(),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 T(100),o.value=!1,i};return(t,i)=>(l(),D("section",null,[E(y,{item:e.value},null,8,["item"]),e.value?(l(),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,"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(),p(_,{key:1,"item-details":e.value},null,8,["item-details"])):u("",!0)]))}});export{S as default};
