import{I as v}from"./ItemsListing-a9f20f21.js";import{I as y,_ as k}from"./ProviderDetails.vue_vue_type_script_setup_true_lang-42f1ae0c.js";import{d as I,r as m,N as _,o as h,b as r,a7 as b,a as w,c as i,g as D,f as g,e as p,j as n,F as E}from"./index-f6d6d5f3.js";import"./VCheckbox-a96acb8a.js";import"./eventbus-72e8654e.js";import"./VListItem-79e9844f.js";import"./VCheckboxBtn-c1335d51.js";import"./VList-bf612667.js";import"./VCardText-b34629f4.js";import"./VCard-0040a03b.js";import"./VMenu-5246b81b.js";import"./_plugin-vue_export-helper-c27b6911.js";import"./ListItem-3a57b472.js";import"./Button-0a6e461b.js";import"./VSpacer-c4203efd.js";/* empty css              */import"./PanelviewItemCompact-bd25855a.js";import"./VAlert-70136757.js";import"./Container-2a9ded95.js";import"./Toolbar-4dbf8f22.js";import"./VToolbar-0d490162.js";import"./VTextField-c45341d1.js";import"./VInfiniteScroll-be8bacb0.js";import"./layout-f68308bb.js";import"./VVirtualScroll-bf2c7c27.js";import"./VDialog-0f04a475.js";const Y=I({__name:"PlaylistDetails",props:{itemId:{},provider:{}},setup(u){const t=u,o=m(!1),e=m(),d=async function(){e.value=await r.getPlaylist(t.itemId,t.provider)};_(()=>t.itemId,a=>{a&&d()},{immediate:!0}),h(()=>{const a=r.subscribe(b.MEDIA_ITEM_ADDED,s=>{var l;const f=s.data;((l=e.value)==null?void 0:l.uri)==f.uri&&(o.value=!0)});w(a)});const c=async function(a){return await r.getPlaylistTracks(t.itemId,t.provider,a.refresh)};return(a,s)=>(i(),D(E,null,[g(y,{item:e.value},null,8,["item"]),e.value?(i(),p(v,{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-items":c,"sort-keys":["position","position_desc","name","artist","album","duration","duration_desc"],"update-available":o.value,title:a.$t("playlist_tracks"),"allow-key-hooks":!0,path:`playlist.${t.itemId}.${t.provider}`,"restore-state":!0,"no-server-side-sorting":!0},null,8,["parent-item","update-available","title","path"])):n("",!0),e.value?(i(),p(k,{key:1,"item-details":e.value},null,8,["item-details"])):n("",!0)],64))}});export{Y as default};
