import{I as d}from"./ItemsListing-BPCoDFMa.js";import{I as k,_ as I}from"./ProviderDetails.vue_vue_type_script_setup_true_lang-C7zJx_G7.js";import{Q as g,x as V,w as A,Z as h,B,R as l,a9 as m,W as s,a0 as D,a4 as i,S as o}from"./index-orrnp8a1.js";import{M as C}from"./MediaItemImages-BXS-t6M3.js";import"./MediaItemThumb-BFLLxiOJ.js";import"./ProviderIcon.vue_vue_type_style_index_0_lang-DgYavPcK.js";import"./VChip-DzIcRFdM.js";import"./VBtn-BJolvyKt.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./ListItem-BOpEb2vA.js";import"./VCheckbox-BaanYS4J.js";import"./VCheckboxBtn-CICj8ZxL.js";import"./PanelviewItemCompact-Bf1Qb2IB.js";import"./VSpacer-FMK5QbR9.js";/* empty css              */import"./Container-C-MxRHLg.js";import"./VContainer-DvR1uhzJ.js";import"./Toolbar-CE2HDv9i.js";import"./VToolbar-BlKUHnwt.js";import"./VTextField-DaF8PfrV.js";import"./VInfiniteScroll-CDme3Tib.js";import"./layout-BTr25AHs.js";import"./VRow-C4MwkXJh.js";import"./VVirtualScroll-Q9Rc10mA.js";import"./VAlert-BhQ3L7Kc.js";import"./marquee_text_sync-BWkPRIK0.js";import"./VDialog-oxeMlk6d.js";const te=g({__name:"AlbumDetails",props:{itemId:{},provider:{}},setup(v){const a=v,e=V(),f=async function(){e.value=await i.getAlbum(a.itemId,a.provider)};A(()=>a.itemId,r=>{r&&f()},{immediate:!0});const y=async function(r){return await i.getAlbumTracks(a.itemId,a.provider,r.libraryOnly)},b=async function(r){return await i.getAlbumVersions(e.value.item_id,e.value.provider)},c=async function(){e.value&&(e.value=await i.sendCommand("music/albums/update",{item_id:e.value.item_id,update:e.value,overwrite:!0}))};return(r,t)=>{var n,u,p;return o(),h("section",null,[B(k,{item:e.value,"active-provider":r.provider},null,8,["item","active-provider"]),e.value?(o(),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(i).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?(o(),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)?(o(),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?(o(),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};
