import{I as v}from"./ItemsListing-BxIggw9V.js";import{I as y,_ as I}from"./ProviderDetails.vue_vue_type_script_setup_true_lang-g1x4dXOC.js";import{x as h,r as l,w as k,o as _,I as r,ah as b,b as w,y as i,D,n as g,z as p,K as n,F as E}from"./index-Dvn4b3kE.js";import"./ItemContextMenu.vue_vue_type_style_index_0_scoped_3a9a25e3_lang-C3noc3qK.js";import"./ProviderIcon.vue_vue_type_style_index_0_lang-CxRRSRNY.js";import"./VListItem-XlHdRn90.js";import"./VChip-BKGA7XXZ.js";import"./VList-BFxH2oe3.js";import"./VMenu-BxZEtUbH.js";import"./VCard-DDEjK8sh.js";import"./VCardText-CXkKR7ML.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./eventbus-CGRXT3Tn.js";import"./ListItem-CqruFv9t.js";import"./VCheckbox-DXoKCkvo.js";import"./VCheckboxBtn-B2R62I44.js";import"./VSpacer-BpjLI35r.js";/* empty css              */import"./PanelviewItemCompact-CceVDOrI.js";import"./Container-DWavih6c.js";import"./VContainer-C3X0IHcx.js";import"./Toolbar-XsObLWPI.js";import"./VToolbar-Bi9Fkevh.js";import"./VTextField-CNfw_aKz.js";import"./VInfiniteScroll-DgELJAW0.js";import"./layout-BesXh2w9.js";import"./VRow-PHUs5bQJ.js";import"./VVirtualScroll-DezxvIhI.js";import"./VAlert-BKHMgC3s.js";import"./marquee_text_sync-BDoUCDrB.js";import"./VDialog-CHkPjb9d.js";const rt=h({__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)};k(()=>t.itemId,a=>{a&&d()},{immediate:!0}),_(()=>{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{rt as default};
