import{I as d}from"./ItemsListing-BwjD1tmq.js";import{I as w,_ as I}from"./ProviderDetails.vue_vue_type_script_setup_true_lang-B-vwm4W9.js";import{d as g,r as V,K as h,c as i,h as A,f as B,e as l,u as D,j as m,g as s,b as o}from"./index-CLKg64ON.js";import{M as C}from"./MediaItemImages-BexLeDzA.js";import"./VCheckbox-CpTv3BhW.js";import"./eventbus-D-xzWv8v.js";import"./VListItem-B_TSjQ1y.js";import"./VCheckboxBtn-DXJHHMHd.js";import"./VList-BvG6-yh2.js";import"./VCardText-BAUfdzDA.js";import"./VCard-BaRPabiE.js";import"./VMenu-CLSWQG_U.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./ListItem-f79Nhqh7.js";import"./Button-F8l3l_P8.js";import"./VSpacer-CqqJVVs3.js";/* empty css              */import"./PanelviewItemCompact-CM48-dMH.js";import"./VAlert-CCGDAWu2.js";import"./Container-ZPskS02H.js";import"./Toolbar-BaIn3BvJ.js";import"./VToolbar-DSn0RyUD.js";import"./VTextField-C1QkMZRy.js";import"./VInfiniteScroll-pn5EaZ8a.js";import"./layout-CYdR31l5.js";import"./VVirtualScroll-DKBgr9yN.js";import"./VDialog-BpGrcp5y.js";const te=g({__name:"AlbumDetails",props:{itemId:{},provider:{}},setup(v){const a=v,e=V(),f=async function(){e.value=await o.getAlbum(a.itemId,a.provider)};h(()=>a.itemId,r=>{r&&f()},{immediate:!0});const y=async function(r){return await o.getAlbumTracks(a.itemId,a.provider,r.libraryOnly)},b=async function(r){return await o.getAlbumVersions(e.value.item_id,e.value.provider)},c=async function(){e.value&&(e.value=await o.sendCommand("music/albums/update",{item_id:e.value.item_id,update:e.value,overwrite:!0}))};return(r,t)=>{var n,u,p;return i(),A("section",null,[B(w,{item:e.value,"active-provider":r.provider},null,8,["item","active-provider"]),e.value?(i(),l(d,{key:0,itemtype:"albumtracks","parent-item":e.value,"show-provider":!0,"show-favorites-only-filter":!0,"show-library-only-filter":e.value.provider=="library"&&D(o).hasStreamingProviders.value,"show-refresh-button":!1,"load-items":y,"sort-keys":["track_number","name","sort_name","duration","duration_desc"],title:r.$t("tracks")},null,8,["parent-item","show-library-only-filter","title"])):m("",!0),t[1]||(t[1]=s("br",null,null,-1)),e.value?(i(),l(d,{key:1,itemtype:"albumversions","parent-item":e.value,"show-provider":!0,"show-favorites-only-filter":!1,"show-refresh-button":!1,"load-items":b,"sort-keys":["provider","name","year"],title:r.$t("other_versions"),"hide-on-empty":!0},null,8,["parent-item","title"])):m("",!0),t[2]||(t[2]=s("br",null,null,-1)),((n=e.value)==null?void 0:n.provider)=="library"&&((p=(u=e.value)==null?void 0:u.metadata)!=null&&p.images)?(i(),l(C,{key:2,modelValue:e.value.metadata.images,"onUpdate:modelValue":[t[0]||(t[0]=k=>e.value.metadata.images=k),c]},null,8,["modelValue"])):m("",!0),t[3]||(t[3]=s("br",null,null,-1)),e.value?(i(),l(I,{key:3,"item-details":e.value},null,8,["item-details"])):m("",!0),t[4]||(t[4]=s("br",null,null,-1))])}}});export{te as default};
