import{I as y}from"./ItemsListing-f772417c.js";import{I as k,_ as I}from"./ProviderDetails.vue_vue_type_script_setup_true_lang-09daad1c.js";import{d as _,r as o,L as h,o as b,b as r,a6 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-fef80a0b.js";import"./utils-12666f6b.js";import"./eventbus-771fa739.js";import"./VListItem-ffbd5641.js";import"./VChip-c36452fb.js";import"./VList-5ec4033f.js";import"./VCard-c054bc7f.js";import"./VCardText-6ea04424.js";import"./VMenu-fbaa74ce.js";import"./_plugin-vue_export-helper-c27b6911.js";import"./ListItem-0b81466a.js";import"./Button-8bcfa9cb.js";import"./VTextField-78aee9b7.js";import"./VVirtualScroll-8fc6e2a1.js";import"./VSpacer-3e41f36f.js";/* empty css              */import"./VAlert-ca55d6e3.js";import"./Container-eb2e118f.js";import"./Toolbar-7a96321e.js";import"./VToolbar-82238121.js";import"./VInfiniteScroll-0016ce41.js";import"./layout-58a35fd6.js";import"./VDialog-36d910a1.js";const Y=_({__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)};h(()=>e.itemId,t=>{t&&c()},{immediate:!0}),b(()=>{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{Y as default};
