import{I as v}from"./ItemsListing-nJ4gZwpG.js";import{I as y,_ as I}from"./ProviderDetails.vue_vue_type_script_setup_true_lang-CUmuLiJs.js";import{x as k,r as l,w as _,o as h,I as r,ag as b,b as w,y as i,D,n as g,z as p,K as n,F as E}from"./index-B55Az6uZ.js";import"./ItemContextMenu.vue_vue_type_style_index_0_scoped_3a9a25e3_lang-bhWnvEZi.js";import"./ProviderIcon.vue_vue_type_script_setup_true_lang-DmwHlomN.js";import"./VListItem-CTt5-rrr.js";import"./VChip-USL2zd6t.js";import"./VList-BbG08zRJ.js";import"./VCardText-6y4Yo2hg.js";import"./VCard-Ba6kturx.js";import"./VMenu-BJOay2FN.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./eventbus-CGRXT3Tn.js";import"./ListItem-BIOYzg71.js";import"./VCheckbox-BXkbvEGB.js";import"./VCheckboxBtn-gndQvl0N.js";import"./VTooltip-B2xVdDYJ.js";import"./VSpacer-Bt_rBx5Q.js";/* empty css              */import"./PanelviewItemCompact-BTMAfeVs.js";import"./Container-DwLI_eNo.js";import"./VContainer-Bwbf98oq.js";import"./Toolbar-CnjrHAL9.js";import"./VToolbar-Cw0gv67a.js";import"./VTextField-DVCLCsz9.js";import"./VInfiniteScroll-08LzEGPu.js";import"./layout-CXuYJmUE.js";import"./VRow-DsoK3S8F.js";import"./VVirtualScroll-Ds3B_Lds.js";import"./VAlert-DmQ6rEG3.js";import"./marquee_text_sync-D_EPQvtP.js";import"./VDialog-B4Ltljs_.js";const it=k({__name:"PlaylistDetails",props:{itemId:{},provider:{}},setup(u){const t=u,o=l(!1),e=l(),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 m;const f=s.data;((m=e.value)==null?void 0:m.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(I,{key:1,"item-details":e.value},null,8,["item-details"])):n("",!0)],64))}});export{it as default};
