import{I as v}from"./ItemsListing-d367002d.js";import{I as y,_ as k}from"./ProviderDetails.vue_vue_type_script_setup_true_lang-7a08d984.js";import{d as I,r as m,N as _,o as h,b as r,a7 as b,a as w,c as i,g,f as D,e as p,j as n,F as E}from"./index-5e5d70f8.js";import"./VCheckbox-e50bb5e3.js";import"./eventbus-5e9bd59e.js";import"./VListItem-a276ed14.js";import"./VCheckboxBtn-d41d6adf.js";import"./VList-1bffb8df.js";import"./VCardText-bdfad4e5.js";import"./VCard-35632c3b.js";import"./VMenu-4ca080f5.js";import"./_plugin-vue_export-helper-c27b6911.js";import"./ListItem-f9f543a5.js";import"./Button-558e640e.js";import"./VSpacer-3df5a092.js";/* empty css              */import"./PanelviewItemCompact-5dcada9d.js";import"./VAlert-8c135db5.js";import"./Container-39ff39e9.js";import"./Toolbar-9ec9e26d.js";import"./VToolbar-c09ee689.js";import"./VTextField-fa7e9a48.js";import"./VInfiniteScroll-01a7fa67.js";import"./layout-41b62dfb.js";import"./VVirtualScroll-a35573be.js";import"./VDialog-8fad6ca7.js";const Y=I({__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)};_(()=>t.itemId,a=>{a&&d()},{immediate:!0}),h(()=>{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(),g(E,null,[D(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(k,{key:1,"item-details":e.value},null,8,["item-details"])):n("",!0)],64))}});export{Y as default};
