import{I as d}from"./ItemsListing-08846369.js";import{I as h,_ as k}from"./ProviderDetails.vue_vue_type_script_setup_true_lang-a4d46145.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-a1b8d248.js";import{m as D}from"./VCheckbox-5797eb11.js";import{M as N}from"./MediaItemImages-a946de02.js";import"./eventbus-142801ce.js";import"./VListItem-99589506.js";import"./ListItem-8ce3726a.js";import"./Button-36db0a16.js";import"./_plugin-vue_export-helper-c27b6911.js";import"./VMenu-a4b04473.js";import"./VCard-62364c90.js";import"./VCardText-426e9876.js";import"./VSpacer-c665d1ef.js";/* empty css              */import"./PanelviewItemCompact-412c96c5.js";import"./VAlert-11c8d9d0.js";import"./Container-6ba8cd4d.js";import"./Toolbar-e7daca02.js";import"./VList-db9ad95c.js";import"./VToolbar-69b0039c.js";import"./VTextField-11675678.js";import"./VCheckboxBtn-b34ea085.js";import"./VInfiniteScroll-b88bd748.js";import"./layout-2c6f8b0d.js";import"./VVirtualScroll-abd3c2c6.js";import"./VDialog-15a0c55b.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};
