import{I as d}from"./ItemsListing-e7c9377b.js";import{I as h,_ as k}from"./ProviderDetails.vue_vue_type_script_setup_true_lang-612520ab.js";import{d as w,r as g,N as I,c as a,g as V,f as A,e as i,u as B,j as o,i as m,b as l}from"./index-e34071c2.js";import{m as D}from"./VCheckbox-081529bb.js";import{M as N}from"./MediaItemImages-fce46884.js";import"./eventbus-edb4a70e.js";import"./VListItem-6fb16d04.js";import"./ListItem-f09faddc.js";import"./Button-d52131a6.js";import"./_plugin-vue_export-helper-c27b6911.js";import"./VMenu-8ea0aa0a.js";import"./VCard-0f63f60c.js";import"./VCardText-2a290ffe.js";import"./VSpacer-b7ae4876.js";/* empty css              */import"./PanelviewItemCompact-8de8744a.js";import"./VAlert-cd8a958f.js";import"./Container-1af89f37.js";import"./Toolbar-bbf3d11a.js";import"./VList-5a526902.js";import"./VToolbar-790d92bd.js";import"./VTextField-df721147.js";import"./VCheckboxBtn-43c6a5b9.js";import"./VInfiniteScroll-311fcdfe.js";import"./layout-4fa46c33.js";import"./VVirtualScroll-8b839030.js";import"./VDialog-57dacf99.js";const C=m("br",null,null,-1),M=m("br",null,null,-1),$=m("br",null,null,-1),T=m("br",null,null,-1),le=w({__name:"AlbumDetails",props:{itemId:{},provider:{}},setup(v){const r=v,e=g(),c=async function(){e.value=await l.getAlbum(r.itemId,r.provider)};I(()=>r.itemId,t=>{t&&c()},{immediate:!0});const f=async function(t){return await l.getAlbumTracks(r.itemId,r.provider,t.libraryOnly)},y=async function(t){return await l.getAlbumVersions(e.value.item_id,e.value.provider)},b=async function(){e.value&&(e.value=await l.sendCommand("music/albums/update",{item_id:e.value.item_id,update:e.value,overwrite:!0}))};return(t,s)=>{var n,u,p;return a(),V("section",null,[A(h,{item:e.value,"active-provider":t.provider},null,8,["item","active-provider"]),e.value?(a(),i(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"&&B(D)(e.value).length>0,"show-refresh-button":!1,"load-items":f,"sort-keys":["track_number","name","sort_name","duration","duration_desc"],title:t.$t("tracks")},null,8,["parent-item","show-library-only-filter","title"])):o("",!0),C,e.value?(a(),i(d,{key:1,itemtype:"albumversions","parent-item":e.value,"show-provider":!0,"show-favorites-only-filter":!1,"show-refresh-button":!1,"load-items":y,"sort-keys":["provider","name","year"],title:t.$t("other_versions"),"hide-on-empty":!0},null,8,["parent-item","title"])):o("",!0),M,((n=e.value)==null?void 0:n.provider)=="library"&&((p=(u=e.value)==null?void 0:u.metadata)!=null&&p.images)?(a(),i(N,{key:2,modelValue:e.value.metadata.images,"onUpdate:modelValue":[s[0]||(s[0]=_=>e.value.metadata.images=_),b]},null,8,["modelValue"])):o("",!0),$,e.value?(a(),i(k,{key:3,"item-details":e.value},null,8,["item-details"])):o("",!0),T])}}});export{le as default};
