import{_ as v,f as y}from"./ItemsListing.vue_vue_type_style_index_0_lang-3c57f819.js";import{_,a as k}from"./ProviderDetails.vue_vue_type_script_setup_true_lang-f7de8b21.js";import{l as b,r as p,w as h,o as w,L as r,a9 as I,b as D,y as l,I as E,j as T,z as n,H as u}from"./index-d8f9df52.js";import{s as B}from"./utils-9f654e0f.js";import"./ListviewItem-c40e4501.js";import"./ListItem-7f13d5f5.js";import"./VImg-4a7a1cb8.js";import"./VMenu-7da753a3.js";import"./VTooltip-c8363108.js";import"./VCheckboxBtn-a71f5d8b.js";import"./PanelviewItem.vue_vue_type_style_index_0_lang-7cb7ae2f.js";import"./VCard-45095a4d.js";import"./contextmenu-4e7016bd.js";import"./eventbus-d154090d.js";import"./Alert-6364676b.js";import"./Container-e16d8739.js";/* empty css              */import"./VToolbar-2e81aa20.js";import"./VTextField-98808566.js";import"./VBadge-e81619d5.js";import"./VRow-d7ad6808.js";import"./VVirtualScroll-fd913adb.js";import"./layout-609b1d14.js";import"./VDialog-c52f4549.js";const X=b({__name:"PlaylistDetails",props:{itemId:{},provider:{}},setup(c){const a=c,o=p(!1),e=p(),f=async function(){e.value=await r.getPlaylist(a.itemId,a.provider)};h(()=>a.itemId,t=>{t&&f()},{immediate:!0}),w(()=>{const t=r.subscribe(I.MEDIA_ITEM_ADDED,i=>{var m;const s=i.data;((m=e.value)==null?void 0:m.uri)==s.uri&&(o.value=!0)});D(t)});const d=async function(t){const i=[];return await r.getPlaylistTracks(a.itemId,a.provider,s=>{i.push(...s)},t.refresh),t.refresh&&await B(1e3),o.value=!1,y(i,t)};return(t,i)=>(l(),E("section",null,[T(_,{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","name","artist","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{X as default};
