import{I as v}from"./ItemsListing-2655a521.js";import{I as y,_ as k}from"./ProviderDetails.vue_vue_type_script_setup_true_lang-91ac6b4e.js";import{d as h,r as p,I,o as _,b as s,ag as b,a as w,c as l,g as D,f as g,e as n,j as u,ah as E}from"./index-1fa25223.js";import"./ListviewItem-fa4b6d44.js";import"./helpers-f9fbf435.js";import"./Container-55c3ff81.js";import"./VListItem-53d44b85.js";import"./_plugin-vue_export-helper-c27b6911.js";/* empty css              */import"./VLabel-148b546a.js";import"./VList-f519ecda.js";import"./VCard-99bbc2f5.js";import"./VCardText-bbb7eb1a.js";import"./VMenu-85495654.js";import"./ListItem-9f85535e.js";import"./Button-0d671d73.js";import"./VTooltip-c87f5f44.js";import"./VCheckboxBtn-4c4cfeff.js";import"./PanelviewItem-f1eef939.js";import"./Alert-501a5edb.js";import"./VAlert-034cbd55.js";import"./Toolbar-77a90b60.js";import"./VBadge-3b97e665.js";import"./VToolbar-a7b4dbd4.js";import"./ItemContextMenu.vue_vue_type_style_index_0_scoped_be40882c_lang-79825e42.js";import"./eventbus-d154090d.js";import"./VTextField-46c02b72.js";import"./VVirtualScroll-f6a01209.js";import"./layout-6738e727.js";import"./VSelect-58338ce7.js";import"./VDialog-0a55bc34.js";const it=h({__name:"PlaylistDetails",props:{itemId:{},provider:{}},setup(c){const a=c,o=p(!1),e=p(),d=async function(){e.value=await s.getPlaylist(a.itemId,a.provider)};I(()=>a.itemId,t=>{t&&d()},{immediate:!0}),_(()=>{const t=s.subscribe(b.MEDIA_ITEM_ADDED,i=>{var m;const r=i.data;((m=e.value)==null?void 0:m.uri)==r.uri&&(o.value=!0)});w(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 E(100),o.value=!1,i};return(t,i)=>(l(),D("section",null,[g(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,"show-refresh-button":!0,"load-items":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(),n(k,{key:1,"item-details":e.value},null,8,["item-details"])):u("",!0)]))}});export{it as default};
