import{_ as v}from"./ItemsListing.vue_vue_type_style_index_0_lang-6fa46e09.js";import{_,a as y}from"./ProviderDetails.vue_vue_type_script_setup_true_lang-2ad91279.js";import{l as k,r as n,w as b,o as h,J as r,ai as w,b as I,v as l,B as D,j as B,x as p,G as u,aj as E}from"./index-e5db0b73.js";import"./ListviewItem-7c178b7a.js";import"./VBadge-efd00f67.js";import"./ListItem-ac3869d3.js";import"./VImg-7a057c50.js";import"./VMenu-d9833a31.js";import"./VCheckboxBtn-46446b67.js";import"./VCard-c9b9f4e9.js";import"./VTooltip-71530943.js";import"./PanelviewItem.vue_vue_type_style_index_0_lang-221d4edc.js";import"./contextmenu-8eac6b44.js";import"./Alert-1172b8fb.js";import"./Container-238e2d02.js";import"./VToolbar-4e8dded4.js";import"./VTextField-46667b30.js";import"./VVirtualScroll-01555b84.js";import"./layout-3130552d.js";import"./VDialog-cda0f95b.js";const O=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 E(100),s.value=!1,i};return(t,i)=>(l(),D("section",null,[B(_,{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(y,{key:1,"item-details":e.value},null,8,["item-details"])):u("",!0)]))}});export{O as default};
