import{_ as v,f as y}from"./ItemsListing.vue_vue_type_style_index_0_lang-13c0a7ea.js";import{_,a as k}from"./ProviderDetails.vue_vue_type_script_setup_true_lang-562a4470.js";import{l as b,r as n,w as h,o as w,L as s,a9 as I,b as D,y as l,I as E,j as T,z as p,H as u}from"./index-0b85ac09.js";import{s as B}from"./utils-6da9b08b.js";import"./ListviewItem-8ca5221f.js";import"./ListItem-13203a50.js";import"./VImg-0b02a672.js";import"./VMenu-17c39295.js";import"./VTooltip-98b8e750.js";import"./VCheckboxBtn-f7c239ad.js";import"./PanelviewItem.vue_vue_type_style_index_0_lang-849cf90d.js";import"./VCard-49371ce3.js";import"./contextmenu-224584f8.js";import"./eventbus-d154090d.js";import"./Alert-0cea1739.js";import"./Container-f51d504d.js";/* empty css              */import"./VToolbar-7dc49a97.js";import"./VTextField-5fb2df8c.js";import"./VBadge-0d62eaa1.js";import"./VRow-b57e52b9.js";import"./VVirtualScroll-3bbd56c5.js";import"./layout-815d5a1a.js";import"./VDialog-69cc554b.js";const X=b({__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)};h(()=>a.itemId,t=>{t&&d()},{immediate:!0}),w(()=>{const t=s.subscribe(I.MEDIA_ITEM_ADDED,i=>{var m;const r=i.data;((m=e.value)==null?void 0:m.uri)==r.uri&&(o.value=!0)});D(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 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(),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-data":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(k,{key:1,"item-details":e.value},null,8,["item-details"])):u("",!0)]))}});export{X as default};
