import{_ as v}from"./ItemsListing.vue_vue_type_style_index_0_lang-02893598.js";import{_,a as y}from"./ProviderDetails.vue_vue_type_script_setup_true_lang-9ad4f695.js";import{d as h,r as n,I as k,o as b,b as s,ah as w,a as I,c as l,h as D,f as E,e as p,j as u,ai as T}from"./index-0ae84607.js";import"./ListviewItem-156d947d.js";import"./VBadge-bfb26993.js";import"./Container-eb92362b.js";import"./forwardRefs-d0d7c5bd.js";import"./Button-a1dfd3f5.js";import"./VMenu-f26d3a19.js";/* empty css              */import"./VInput-00e20677.js";import"./VSlideGroup-18f8a11f.js";import"./VCard-e96ab32b.js";import"./VCardText-b1a0de89.js";import"./VTooltip-054ea37d.js";import"./PanelviewItem.vue_vue_type_style_index_0_lang-a0b4c306.js";import"./contextmenu-5ae46870.js";import"./Alert-ee4ff93d.js";import"./VAlert-212471f5.js";import"./VToolbar-b7dd8339.js";import"./VTextField-4bf39c0d.js";import"./VVirtualScroll-06bbaaf5.js";import"./layout-f3684635.js";import"./VDialog-2b5eada8.js";const W=h({__name:"PlaylistDetails",props:{itemId:{},provider:{}},setup(c){const a=c,o=n(!1),e=n(),d=async function(){e.value=await s.getPlaylist(a.itemId,a.provider)};k(()=>a.itemId,t=>{t&&d()},{immediate:!0}),b(()=>{const t=s.subscribe(w.MEDIA_ITEM_ADDED,i=>{var m;const r=i.data;((m=e.value)==null?void 0:m.uri)==r.uri&&(o.value=!0)});I(t)});const f=async function(t){const i=[];return await s.getPlaylistTracks(a.itemId,a.provider,r=>{i.push(...r)},t.refresh&&!o.value),t.refresh&&await T(100),o.value=!1,i};return(t,i)=>(l(),D("section",null,[E(_,{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,"show-refresh-button":!0,"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(y,{key:1,"item-details":e.value},null,8,["item-details"])):u("",!0)]))}});export{W as default};
