import{I as y}from"./ItemsListing-6e3c9168.js";import{I as k,_ as I}from"./ProviderDetails.vue_vue_type_script_setup_true_lang-544d464a.js";import{d as _,r as o,L as h,o as b,b as r,a6 as w,a as D,c as s,g,f as E,e as n,j as u,F as B}from"./index-0272dc54.js";import"./utils-a32c3776.js";import"./eventbus-e44cf169.js";import"./VListItem-a3b7f8b7.js";import"./VChip-e0012620.js";import"./VList-21f55857.js";import"./VCard-88cdf1d8.js";import"./VCardText-41d932c2.js";import"./VMenu-30df3a7b.js";import"./_plugin-vue_export-helper-c27b6911.js";import"./ListItem-ab5df53d.js";import"./Button-7bab5496.js";import"./VTextField-0a661ba3.js";import"./VVirtualScroll-c94c27f1.js";import"./VSpacer-39969d39.js";/* empty css              */import"./Alert-4069c5b8.js";import"./VAlert-fb48582c.js";import"./Container-3f082c46.js";import"./Toolbar-b074e682.js";import"./VToolbar-3145d715.js";import"./VInfiniteScroll-d471d074.js";import"./layout-e087828e.js";import"./VDialog-555c438e.js";const Z=_({__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 p;const v=i.data;((p=a.value)==null?void 0:p.uri)==v.uri&&(l.value=!0)});D(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(),g(B,null,[E(k,{item:a.value},null,8,["item"]),a.value?(s(),n(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"]:["default"],"update-available":l.value,title:t.$t("playlist_tracks"),"allow-key-hooks":!0,path:`playlist.${e.itemId}.${e.provider}`,"restore-state":!0},null,8,["parent-item","sort-keys","update-available","title","path"])):u("",!0),a.value?(s(),n(I,{key:1,"item-details":a.value},null,8,["item-details"])):u("",!0)],64))}});export{Z as default};
