import{I as d}from"./ItemsListing-BGUL9QyB.js";import{I as k,_ as I}from"./ProviderDetails.vue_vue_type_script_setup_true_lang-Bf7qdK33.js";import{x as g,r as V,w as A,y as a,D as h,n as B,z as l,G as D,K as m,B as s,I as o}from"./index-CFvoaD7J.js";import{M as C}from"./MediaItemImages-BiCFx55U.js";import"./ItemContextMenu.vue_vue_type_style_index_0_scoped_4409cede_lang-41DbVClm.js";import"./ProviderIcon.vue_vue_type_script_setup_true_lang-Ji67J6Pu.js";import"./VListItem-CSPID7yq.js";import"./VChip-Ccz1-bmn.js";import"./VList-fGk9SRdf.js";import"./VCardText-CpOuj25H.js";import"./VCard-DxLPF-Ra.js";import"./VMenu-9pSrU4Fo.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./eventbus-CGRXT3Tn.js";import"./ListItem-nYGtvGaY.js";import"./VCheckbox-B5r7QKHZ.js";import"./VCheckboxBtn-CRgZyCzV.js";import"./VTooltip-DC73AT2B.js";import"./VSpacer-UYEiyhN7.js";/* empty css              */import"./PanelviewItemCompact-BQIsDE0n.js";import"./Container-BDz3QMuX.js";import"./VContainer-CzfHAKpA.js";import"./Toolbar-DNen7a-V.js";import"./VToolbar-Da4d1W_R.js";import"./VTextField-DF4u_eMy.js";import"./VInfiniteScroll-D1yVLjQf.js";import"./layout-BeGdxe2Y.js";import"./VRow-BC1No8oB.js";import"./VVirtualScroll-BDBVEoUv.js";import"./VAlert-CIiIOQza.js";import"./marquee_text_sync-k18A2BIX.js";import"./VDialog-CdvGeqlS.js";const me=g({__name:"AlbumDetails",props:{itemId:{},provider:{}},setup(v){const i=v,e=V(),f=async function(){e.value=await o.getAlbum(i.itemId,i.provider)};A(()=>i.itemId,r=>{r&&f()},{immediate:!0});const y=async function(r){return await o.getAlbumTracks(i.itemId,i.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 a(),h("section",null,[B(k,{item:e.value,"active-provider":r.provider},null,8,["item","active-provider"]),e.value?(a(),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?(a(),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)?(a(),l(C,{key:2,modelValue:e.value.metadata.images,"onUpdate:modelValue":[t[0]||(t[0]=w=>e.value.metadata.images=w),c]},null,8,["modelValue"])):m("",!0),t[3]||(t[3]=s("br",null,null,-1)),e.value?(a(),l(I,{key:3,"item-details":e.value},null,8,["item-details"])):m("",!0),t[4]||(t[4]=s("br",null,null,-1))])}}});export{me as default};
