import{I as v}from"./ItemsListing-9a3a53ae.js";import{I as y,_ as k}from"./ProviderDetails.vue_vue_type_script_setup_true_lang-a5edd4c3.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-9299e1c1.js";import"./VCheckbox-75b4c12a.js";import"./eventbus-fb52ce0b.js";import"./VListItem-748fc7af.js";import"./VCheckboxBtn-ad9d405a.js";import"./VList-6d58de6a.js";import"./VCardText-7bb4efb6.js";import"./VCard-6d87d169.js";import"./VMenu-02b91385.js";import"./_plugin-vue_export-helper-c27b6911.js";import"./ListItem-50af6ebb.js";import"./Button-784539f4.js";import"./VSpacer-caa12be4.js";/* empty css              */import"./PanelviewItemCompact-c5d1faef.js";import"./VAlert-708f5408.js";import"./Container-ff473259.js";import"./Toolbar-eb89f7db.js";import"./VToolbar-2949cae0.js";import"./VTextField-9151d790.js";import"./VInfiniteScroll-dfad6ac1.js";import"./layout-0bba43de.js";import"./VVirtualScroll-1c00b40c.js";import"./VDialog-bec8ba32.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};
