import{I as y}from"./ItemsListing-1e4c97cc.js";import{I as k,_ as I}from"./ProviderDetails.vue_vue_type_script_setup_true_lang-1e678135.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-13cec455.js";import"./ItemContextMenu.vue_vue_type_style_index_0_scoped_d4387993_lang-070a5f76.js";import"./eventbus-1a74ea4a.js";import"./VListItem-3995941d.js";import"./VLabel-dc3f418b.js";import"./VList-a053873b.js";import"./VCardText-3285fd42.js";import"./VCard-7c0bc2b7.js";import"./VMenu-693c2219.js";import"./_plugin-vue_export-helper-c27b6911.js";import"./ListItem-359f4456.js";import"./Button-a9c1eb8e.js";import"./PanelviewItemCompact-ca3ca463.js";import"./VCheckboxBtn-deee0e68.js";import"./VSpacer-46ab8aa1.js";/* empty css              */import"./VAlert-3e4ba415.js";import"./Container-34b102f9.js";import"./Toolbar-c1a5714a.js";import"./VToolbar-be936393.js";import"./VTextField-59596a04.js";import"./VVirtualScroll-c6e56d95.js";import"./VInfiniteScroll-cb91c423.js";import"./layout-5b19be1f.js";import"./VDialog-d88e5297.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};
