import{_ as v,f as _}from"./ItemsListing.vue_vue_type_style_index_0_lang-38bc2f50.js";import{_ as y,a as k}from"./ProviderDetails.vue_vue_type_script_setup_true_lang-1829229a.js";import{l as b,r as p,w as h,o as w,H as s,ao as D,b as I,v as l,A as E,j as T,x as n,D as u,ap as A}from"./index-dcf0de03.js";import"./ListviewItem-2c46c8ee.js";import"./MediaItemThumb.vue_vue_type_style_index_0_lang-b38d9ae1.js";import"./ListItem-6dad7331.js";import"./VBtn-a0da5efe.js";import"./VMenu-3bdd1b96.js";import"./index-0afee102.js";import"./VListItem-943ee224.js";import"./VCheckboxBtn-d54a899d.js";import"./VCard-111cabcf.js";/* empty css                             */import"./PanelviewItem.vue_vue_type_style_index_0_lang-44df1bef.js";import"./contextmenu-ec34ccac.js";import"./eventbus-d154090d.js";import"./Alert-eb81bdeb.js";import"./Container-d623752d.js";/* empty css              */import"./VToolbar-dfba6de4.js";import"./VTextField-f81f9175.js";import"./VBadge-8be61727.js";import"./VRow-73379099.js";import"./layout-087be267.js";import"./VDialog-ccbfddc9.js";const Y=b({__name:"PlaylistDetails",props:{itemId:{},provider:{}},setup(c){const a=c,o=p(!1),e=p(),f=async function(){e.value=await s.getPlaylist(a.itemId,a.provider)};h(()=>a.itemId,t=>{t&&f()},{immediate:!0}),w(()=>{const t=s.subscribe(D.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 d=async function(t){const i=[];return await s.getPlaylistTracks(a.itemId,a.provider,r=>{i.push(...r)},t.refresh),t.refresh&&await A(1e3),o.value=!1,_(i,t)};return(t,i)=>(l(),E("section",null,[T(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-data":d,"sort-keys":["position","position DESC","sort_name","sort_artist","sort_album"],"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(k,{key:1,"item-details":e.value},null,8,["item-details"])):u("",!0)]))}});export{Y as default};
