import{I as v}from"./ItemsListing-BwjD1tmq.js";import{I as y,_ as h}from"./ProviderDetails.vue_vue_type_script_setup_true_lang-B-vwm4W9.js";import{d as k,r as m,K as I,o as _,b as r,a7 as b,a as w,c as i,h as D,f as g,e as p,j as n,F as E}from"./index-CLKg64ON.js";import"./VCheckbox-CpTv3BhW.js";import"./eventbus-D-xzWv8v.js";import"./VListItem-B_TSjQ1y.js";import"./VCheckboxBtn-DXJHHMHd.js";import"./VList-BvG6-yh2.js";import"./VCardText-BAUfdzDA.js";import"./VCard-BaRPabiE.js";import"./VMenu-CLSWQG_U.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./ListItem-f79Nhqh7.js";import"./Button-F8l3l_P8.js";import"./VSpacer-CqqJVVs3.js";/* empty css              */import"./PanelviewItemCompact-CM48-dMH.js";import"./VAlert-CCGDAWu2.js";import"./Container-ZPskS02H.js";import"./Toolbar-BaIn3BvJ.js";import"./VToolbar-DSn0RyUD.js";import"./VTextField-C1QkMZRy.js";import"./VInfiniteScroll-pn5EaZ8a.js";import"./layout-CYdR31l5.js";import"./VVirtualScroll-DKBgr9yN.js";import"./VDialog-BpGrcp5y.js";const Y=k({__name:"PlaylistDetails",props:{itemId:{},provider:{}},setup(u){const t=u,o=m(!1),e=m(),d=async function(){e.value=await r.getPlaylist(t.itemId,t.provider)};I(()=>t.itemId,a=>{a&&d()},{immediate:!0}),_(()=>{const a=r.subscribe(b.MEDIA_ITEM_UPDATED,s=>{var l;const f=s.data;((l=e.value)==null?void 0:l.uri)==f.uri&&(o.value=!0)});w(a)});const c=async function(a){return await r.getPlaylistTracks(t.itemId,t.provider,a.refresh)};return(a,s)=>(i(),D(E,null,[g(y,{item:e.value},null,8,["item"]),e.value?(i(),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,"show-refresh-button":!0,"load-items":c,"sort-keys":["position","position_desc","name","artist","album","duration","duration_desc"],"update-available":o.value,title:a.$t("playlist_tracks"),"allow-key-hooks":!0,path:`playlist.${t.itemId}.${t.provider}`,"restore-state":!0,"no-server-side-sorting":!0},null,8,["parent-item","update-available","title","path"])):n("",!0),e.value?(i(),p(h,{key:1,"item-details":e.value},null,8,["item-details"])):n("",!0)],64))}});export{Y as default};
