import{_ as v}from"./ItemsListing.vue_vue_type_style_index_0_lang-5f9be450.js";import{_ as y,a as _}from"./ProviderDetails.vue_vue_type_script_setup_true_lang-60caed51.js";import{v as k,r as n,w as b,o as h,L as r,al as w,b as I,y as l,E as D,l as E,z as p,I as u,am as T}from"./index-4abadf84.js";import"./ListviewItem-233411ae.js";import"./VBadge-148f67ae.js";import"./Container-cc02c26a.js";import"./forwardRefs-7da7908a.js";import"./VMenu-5b409939.js";/* empty css              */import"./VCheckboxBtn-c7727adb.js";import"./VSlideGroup-fc835928.js";import"./VCard-63dfea61.js";import"./VCardText-a4be1fd3.js";import"./VTooltip-2600ff41.js";import"./PanelviewItem.vue_vue_type_style_index_0_lang-3d5ca720.js";import"./contextmenu-c1d86d74.js";import"./Alert-3abd6204.js";import"./VToolbar-42c79991.js";import"./VTextField-ce4a0dcf.js";import"./VVirtualScroll-26a90d88.js";import"./layout-09803970.js";import"./VDialog-d38103ad.js";const R=k({__name:"PlaylistDetails",props:{itemId:{},provider:{}},setup(c){const a=c,s=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 o=i.data;((m=e.value)==null?void 0:m.uri)==o.uri&&(s.value=!0)});I(t)});const f=async function(t){const i=[];return await r.getPlaylistTracks(a.itemId,a.provider,o=>{i.push(...o)},t.refresh&&!s.value),t.refresh&&await T(100),s.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":s.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{R as default};
