import{I as v}from"./ItemsListing-D0RDJqR8.js";import{I as y,_ as h}from"./ProviderDetails.vue_vue_type_script_setup_true_lang-CI_qVBO1.js";import{d as k,r as m,K as I,o as _,b as r,a7 as b,a as w,c as i,h as D,f as g,e as p,j as n,F as E}from"./index-CQHe9KB5.js";import"./VCheckbox-_eVssUuR.js";import"./eventbus-CxBHXMjo.js";import"./VListItem-932LEcae.js";import"./VCheckboxBtn-WpBm-DQx.js";import"./VList-SeV0eskX.js";import"./VCardText-BC98CPwQ.js";import"./VCard-BBArKN8n.js";import"./VMenu-C_g4AWFG.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./ListItem-BlTvbW6N.js";import"./Button-C2tPqXAJ.js";import"./VSpacer-BB-V2OH5.js";/* empty css              */import"./PanelviewItemCompact-C9xC4OzX.js";import"./VAlert-CgwdfNK_.js";import"./Container-D0GZf7eO.js";import"./Toolbar-Bxz1a-Vc.js";import"./VToolbar-AihbUtg2.js";import"./VTextField-DJj81lxi.js";import"./VInfiniteScroll-tYOoNmCo.js";import"./layout-BxB_31nW.js";import"./VVirtualScroll-qRehF0qb.js";import"./VDialog-pSjwSbGd.js";const Y=k({__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)};I(()=>t.itemId,a=>{a&&d()},{immediate:!0}),_(()=>{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(),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(h,{key:1,"item-details":e.value},null,8,["item-details"])):n("",!0)],64))}});export{Y as default};
