import{I as v}from"./ItemsListing-2b5a8c5f.js";import{I as y,_ as k}from"./ProviderDetails.vue_vue_type_script_setup_true_lang-74f7ff1e.js";import{d as I,r as m,L as _,o as h,b as i,a8 as b,a as w,c as r,g,f as D,e as p,j as n,F as E}from"./index-894ae36a.js";import"./VCheckbox-4fd4d9b8.js";import"./eventbus-f225a5d6.js";import"./VListItem-4174a915.js";import"./VCheckboxBtn-24370bba.js";import"./VList-48dd7d0f.js";import"./VCardText-f53aa54e.js";import"./VCard-3391db98.js";import"./VMenu-6b993280.js";import"./_plugin-vue_export-helper-c27b6911.js";import"./ListItem-8a38a33e.js";import"./Button-f6514084.js";import"./VSpacer-46dc65f8.js";/* empty css              */import"./PanelviewItemCompact-b99e3c0c.js";import"./VAlert-a768baba.js";import"./Container-0e8820c0.js";import"./Toolbar-43508ce0.js";import"./VToolbar-92b7b4d6.js";import"./VTextField-d7aa64d7.js";import"./VInfiniteScroll-3988a0eb.js";import"./layout-ca8c09ab.js";import"./VVirtualScroll-3adad00e.js";import"./VDialog-0a8de8a6.js";const Y=I({__name:"PlaylistDetails",props:{itemId:{},provider:{}},setup(u){const e=u,o=m(!1),a=m(),d=async function(){a.value=await i.getPlaylist(e.itemId,e.provider)};_(()=>e.itemId,t=>{t&&d()},{immediate:!0}),h(()=>{const t=i.subscribe(b.MEDIA_ITEM_ADDED,s=>{var l;const f=s.data;((l=a.value)==null?void 0:l.uri)==f.uri&&(o.value=!0)});w(t)});const c=async function(t){return await i.getPlaylistTracks(e.itemId,e.provider,t.refresh,t.limit,t.offset)};return(t,s)=>(r(),g(E,null,[D(y,{item:a.value},null,8,["item"]),a.value?(r(),p(v,{key:0,itemtype:"playlisttracks","parent-item":a.value,"show-provider":!1,"show-library":!1,"show-favorites-only-filter":!1,"show-track-number":!1,"show-refresh-button":!0,"load-paged-data":c,limit:50,"sort-keys":["position","position_desc","name","artist","album","duration","duration_desc"],"update-available":o.value,title:t.$t("playlist_tracks"),"allow-key-hooks":!0,path:`playlist.${e.itemId}.${e.provider}`,"restore-state":!0,"no-server-side-sorting":!0},null,8,["parent-item","update-available","title","path"])):n("",!0),a.value?(r(),p(k,{key:1,"item-details":a.value},null,8,["item-details"])):n("",!0)],64))}});export{Y as default};
