import{I as y}from"./ItemsListing-db2c60f3.js";import{I as k,_ as I}from"./ProviderDetails.vue_vue_type_script_setup_true_lang-47aa75bc.js";import{d as _,r as o,J as b,o as h,b as r,af as w,a as D,c as s,g,f as E,e as n,j as u,F as B}from"./index-2dd0c7d2.js";import"./ListviewItem-a6570b10.js";import"./helpers-4d7c5bf6.js";import"./Container-fdf4c1f5.js";import"./VListItem-cb387084.js";import"./_plugin-vue_export-helper-c27b6911.js";/* empty css              */import"./VLabel-1f522f96.js";import"./VList-d110868a.js";import"./VCard-907b4685.js";import"./VCardText-0ed41581.js";import"./VMenu-97c1c955.js";import"./ListItem-87435fbb.js";import"./Button-69b906cf.js";import"./VTooltip-e62b61bd.js";import"./VCheckboxBtn-c3f9b6ff.js";import"./PanelviewItem-68416368.js";import"./VSpacer-e11897c6.js";import"./Alert-65a1093b.js";import"./VAlert-4eed3112.js";import"./Toolbar-1720c469.js";import"./VBadge-91055b8b.js";import"./VToolbar-6047eebf.js";import"./ItemContextMenu.vue_vue_type_style_index_0_scoped_7aadaa8c_lang-7ff19a96.js";import"./eventbus-d154090d.js";import"./VTextField-de7279c6.js";import"./VVirtualScroll-660ff9a6.js";import"./VSnackbar-6950ff68.js";import"./layout-42d7f450.js";import"./VDialog-e187bf14.js";const rt=_({__name:"PlaylistDetails",props:{itemId:{},provider:{}},setup(c){const a=c,l=o(!1),e=o(),m=o(!1),d=async function(){e.value=await r.getPlaylist(a.itemId,a.provider)};b(()=>a.itemId,t=>{t&&d()},{immediate:!0}),h(()=>{const t=r.subscribe(w.MEDIA_ITEM_ADDED,i=>{var p;const v=i.data;((p=e.value)==null?void 0:p.uri)==v.uri&&(l.value=!0)});D(t)});const f=async function(t){const i=await r.getPlaylistTracks(a.itemId,a.provider,t.refresh,t.limit,t.offset);return m.value=i.total!=null,i};return(t,i)=>(s(),g(B,null,[E(k,{item:e.value},null,8,["item"]),e.value?(s(),n(y,{key:0,itemtype:"playlisttracks","parent-item":e.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},null,8,["parent-item","sort-keys","update-available","title"])):u("",!0),e.value?(s(),n(I,{key:1,"item-details":e.value},null,8,["item-details"])):u("",!0)],64))}});export{rt as default};
