import{I as y}from"./ItemsListing-496384e5.js";import{I as k,_ as I}from"./ProviderDetails.vue_vue_type_script_setup_true_lang-54af6448.js";import{d as _,r as o,L as b,o as h,b as r,ab as w,a as g,c as s,g as D,f as E,e as p,j as u,F as B}from"./index-bf0eaf20.js";import"./ItemContextMenu.vue_vue_type_style_index_0_scoped_d4387993_lang-b7e5044b.js";import"./eventbus-b340f869.js";import"./VListItem-223b492d.js";import"./VLabel-e07a3413.js";import"./VList-21e2a257.js";import"./VCardText-8a9fa9c7.js";import"./VCard-97256dbd.js";import"./VMenu-71b97cab.js";import"./_plugin-vue_export-helper-c27b6911.js";import"./ListItem-b1725b5d.js";import"./Button-574f04d4.js";import"./PanelviewItemCompact-cb3303f4.js";import"./VCheckboxBtn-f3296201.js";import"./VSpacer-36b6f8a9.js";/* empty css              */import"./VAlert-e2b3a5a6.js";import"./Container-88f21350.js";import"./Toolbar-1985c49b.js";import"./VToolbar-219721ba.js";import"./VTextField-ad1ef579.js";import"./VVirtualScroll-837eb7b9.js";import"./VInfiniteScroll-71aa3856.js";import"./layout-8db27034.js";import"./VDialog-18e61467.js";const tt=_({__name:"PlaylistDetails",props:{itemId:{},provider:{}},setup(d){const e=d,l=o(!1),a=o(),m=o(!1),c=async function(){a.value=await r.getPlaylist(e.itemId,e.provider)};b(()=>e.itemId,t=>{t&&c()},{immediate:!0}),h(()=>{const t=r.subscribe(w.MEDIA_ITEM_ADDED,i=>{var n;const v=i.data;((n=a.value)==null?void 0:n.uri)==v.uri&&(l.value=!0)});g(t)});const f=async function(t){const i=await r.getPlaylistTracks(e.itemId,e.provider,t.refresh,t.limit,t.offset);return m.value=i.total!=null,i};return(t,i)=>(s(),D(B,null,[E(k,{item:a.value},null,8,["item"]),a.value?(s(),p(y,{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":f,limit:50,"sort-keys":m.value?["position","position_desc","name","artist","album","duration","duration_desc"]:["position"],"update-available":l.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","sort-keys","update-available","title","path"])):u("",!0),a.value?(s(),p(I,{key:1,"item-details":a.value},null,8,["item-details"])):u("",!0)],64))}});export{tt as default};
