import{I as v}from"./ItemsListing-08846369.js";import{I as y,_ as k}from"./ProviderDetails.vue_vue_type_script_setup_true_lang-a4d46145.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-a1b8d248.js";import"./VCheckbox-5797eb11.js";import"./eventbus-142801ce.js";import"./VListItem-99589506.js";import"./VCheckboxBtn-b34ea085.js";import"./VList-db9ad95c.js";import"./VCardText-426e9876.js";import"./VCard-62364c90.js";import"./VMenu-a4b04473.js";import"./_plugin-vue_export-helper-c27b6911.js";import"./ListItem-8ce3726a.js";import"./Button-36db0a16.js";import"./VSpacer-c665d1ef.js";/* empty css              */import"./PanelviewItemCompact-412c96c5.js";import"./VAlert-11c8d9d0.js";import"./Container-6ba8cd4d.js";import"./Toolbar-e7daca02.js";import"./VToolbar-69b0039c.js";import"./VTextField-11675678.js";import"./VInfiniteScroll-b88bd748.js";import"./layout-2c6f8b0d.js";import"./VVirtualScroll-abd3c2c6.js";import"./VDialog-15a0c55b.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};
