import{I as v}from"./ItemsListing-e7c9377b.js";import{I as y,_ as k}from"./ProviderDetails.vue_vue_type_script_setup_true_lang-612520ab.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,f as D,e as p,j as n,F as E}from"./index-e34071c2.js";import"./VCheckbox-081529bb.js";import"./eventbus-edb4a70e.js";import"./VListItem-6fb16d04.js";import"./VCheckboxBtn-43c6a5b9.js";import"./VList-5a526902.js";import"./VCardText-2a290ffe.js";import"./VCard-0f63f60c.js";import"./VMenu-8ea0aa0a.js";import"./_plugin-vue_export-helper-c27b6911.js";import"./ListItem-f09faddc.js";import"./Button-d52131a6.js";import"./VSpacer-b7ae4876.js";/* empty css              */import"./PanelviewItemCompact-8de8744a.js";import"./VAlert-cd8a958f.js";import"./Container-1af89f37.js";import"./Toolbar-bbf3d11a.js";import"./VToolbar-790d92bd.js";import"./VTextField-df721147.js";import"./VInfiniteScroll-311fcdfe.js";import"./layout-4fa46c33.js";import"./VVirtualScroll-8b839030.js";import"./VDialog-57dacf99.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_UPDATED,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(),g(E,null,[D(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};
