import{I as v}from"./ItemsListing-4e050c6c.js";import{I as y,_ as k}from"./ProviderDetails.vue_vue_type_script_setup_true_lang-89045d01.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-5eb5c9ac.js";import"./VCheckbox-2a28a1cd.js";import"./eventbus-4894d390.js";import"./VListItem-b9a4cfb8.js";import"./VCheckboxBtn-cb68b622.js";import"./VList-13fa461d.js";import"./VCardText-1810bf8a.js";import"./VCard-cb863c33.js";import"./VMenu-4088b2e7.js";import"./_plugin-vue_export-helper-c27b6911.js";import"./ListItem-7b05ebf9.js";import"./Button-64160646.js";import"./VSpacer-81b0afbb.js";/* empty css              */import"./PanelviewItemCompact-4dc20236.js";import"./VAlert-12c553a2.js";import"./Container-1fa5169e.js";import"./Toolbar-6cac4d7d.js";import"./VToolbar-77830c55.js";import"./VTextField-574f2a77.js";import"./VInfiniteScroll-61b7ed02.js";import"./layout-2c007cef.js";import"./VVirtualScroll-5ee5768d.js";import"./VDialog-480c2f48.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};
