import{I as y}from"./ItemsListing-ffc2935e.js";import{I as k,_ as I}from"./ProviderDetails.vue_vue_type_script_setup_true_lang-f8349cea.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-8e7daee8.js";import"./ItemContextMenu.vue_vue_type_style_index_0_scoped_d4387993_lang-755a1a8b.js";import"./eventbus-d39a7847.js";import"./VListItem-09460541.js";import"./VLabel-46f0710d.js";import"./VList-ca6176f0.js";import"./VCard-990eebd4.js";import"./VCardText-a5e6d4d4.js";import"./VMenu-64e96597.js";import"./_plugin-vue_export-helper-c27b6911.js";import"./ListItem-b626b3fa.js";import"./Button-caab2d1b.js";import"./PanelviewItemCompact-2d9663c1.js";import"./VCheckboxBtn-1b20bfe7.js";import"./VSpacer-28a82c5a.js";/* empty css              */import"./VAlert-fd6ed822.js";import"./Container-0d470ed8.js";import"./Toolbar-e48261c7.js";import"./VToolbar-645a3ba3.js";import"./VTextField-12379bad.js";import"./VVirtualScroll-01e39aac.js";import"./VInfiniteScroll-40f31e12.js";import"./layout-a17f5af6.js";import"./VDialog-1c9bf8d5.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};
