import{I as v}from"./ItemsListing-efdefe10.js";import{I as y,_ as k}from"./ProviderDetails.vue_vue_type_script_setup_true_lang-3318bf4e.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-2e87fa03.js";import"./VCheckbox-386509eb.js";import"./eventbus-0b29a02c.js";import"./VListItem-89fd7b1a.js";import"./VCheckboxBtn-95584b13.js";import"./VList-a4b75488.js";import"./VCardText-064374a3.js";import"./VCard-c125380f.js";import"./VMenu-148e092d.js";import"./_plugin-vue_export-helper-c27b6911.js";import"./ListItem-db7cb046.js";import"./Button-74c30473.js";import"./VSpacer-f5f551d9.js";/* empty css              */import"./PanelviewItemCompact-a679900d.js";import"./VAlert-d83244d0.js";import"./Container-a429dbf0.js";import"./Toolbar-0e15c31f.js";import"./VToolbar-00d7489e.js";import"./VTextField-6302d32d.js";import"./VInfiniteScroll-72c5f022.js";import"./layout-61f409b8.js";import"./VVirtualScroll-9a54f195.js";import"./VDialog-8481a663.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};
