import{I as y}from"./ItemsListing-6dc88bbd.js";import{I as k,_ as I}from"./ProviderDetails.vue_vue_type_script_setup_true_lang-cf5608d7.js";import{d as _,r as o,N as b,o as h,b as r,ac as w,a as D,c as s,g,f as E,e as p,j as u,F as B}from"./index-abd7b0d3.js";import"./ItemContextMenu.vue_vue_type_style_index_0_scoped_7aadaa8c_lang-8ee75bda.js";import"./eventbus-3394fed7.js";import"./VListItem-623fa258.js";import"./VChip-13179554.js";import"./VList-856decd1.js";import"./VCard-61a799ef.js";import"./VCardText-199b0fb3.js";import"./VMenu-1534bcb0.js";import"./_plugin-vue_export-helper-c27b6911.js";import"./ListItem-09177683.js";import"./Button-e561c42b.js";import"./VTextField-8263a3db.js";import"./VVirtualScroll-d9ad5563.js";import"./VSpacer-a55bbc93.js";/* empty css              */import"./Alert-3496524c.js";import"./VAlert-6f0f39d0.js";import"./Container-62927d7c.js";import"./Toolbar-6ade126e.js";import"./VToolbar-9761d31e.js";import"./VInfiniteScroll-6a5d71a2.js";import"./layout-8d36d037.js";import"./VDialog-5c90d426.js";const Z=_({__name:"PlaylistDetails",props:{itemId:{},provider:{}},setup(c){const a=c,l=o(!1),e=o(),m=o(!1),d=async function(){e.value=await r.getPlaylist(a.itemId,a.provider)};b(()=>a.itemId,t=>{t&&d()},{immediate:!0}),h(()=>{const t=r.subscribe(w.MEDIA_ITEM_ADDED,i=>{var n;const v=i.data;((n=e.value)==null?void 0:n.uri)==v.uri&&(l.value=!0)});D(t)});const f=async function(t){const i=await r.getPlaylistTracks(a.itemId,a.provider,t.refresh,t.limit,t.offset);return m.value=i.total!=null,i};return(t,i)=>(s(),g(B,null,[E(k,{item:e.value},null,8,["item"]),e.value?(s(),p(y,{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-paged-data":f,limit:50,"sort-keys":m.value?["position","position_desc","name","artist","album","duration","duration_desc"]:["default"],"update-available":l.value,title:t.$t("playlist_tracks"),"allow-key-hooks":!0},null,8,["parent-item","sort-keys","update-available","title"])):u("",!0),e.value?(s(),p(I,{key:1,"item-details":e.value},null,8,["item-details"])):u("",!0)],64))}});export{Z as default};
