import{I as m}from"./ItemsListing-2b5a8c5f.js";import{I as c,_ as v}from"./ProviderDetails.vue_vue_type_script_setup_true_lang-74f7ff1e.js";import{d as f,r as b,o as y,b as i,a8 as h,a as _,L as k,c as o,g as w,f as I,e as a,u as g,j as s,i as n,aq as A}from"./index-894ae36a.js";import"./VCheckbox-4fd4d9b8.js";import"./eventbus-f225a5d6.js";import"./VListItem-4174a915.js";import"./VCheckboxBtn-24370bba.js";import"./VList-48dd7d0f.js";import"./VCardText-f53aa54e.js";import"./VCard-3391db98.js";import"./VMenu-6b993280.js";import"./_plugin-vue_export-helper-c27b6911.js";import"./ListItem-8a38a33e.js";import"./Button-f6514084.js";import"./VSpacer-46dc65f8.js";/* empty css              */import"./PanelviewItemCompact-b99e3c0c.js";import"./VAlert-a768baba.js";import"./Container-0e8820c0.js";import"./Toolbar-43508ce0.js";import"./VToolbar-92b7b4d6.js";import"./VTextField-d7aa64d7.js";import"./VInfiniteScroll-3988a0eb.js";import"./layout-ca8c09ab.js";import"./VVirtualScroll-3adad00e.js";import"./VDialog-0a8de8a6.js";const D=n("br",null,null,-1),B=n("br",null,null,-1),ee=f({__name:"AlbumDetails",props:{itemId:{},provider:{}},setup(u){const r=u,e=b(),l=async function(){e.value=await i.getAlbum(r.itemId,r.provider)};y(()=>{if(r.provider=="library"){const t=i.subscribe(h.MEDIA_ITEM_UPDATED,l,`library://album/${r.itemId}`);_(t)}}),k(()=>r.itemId,t=>{t&&l()},{immediate:!0});const p=async function(t){return await i.getAlbumTracks(r.itemId,r.provider,t.libraryOnly)},d=async function(t){return await i.getAlbumVersions(e.value.item_id,e.value.provider)};return(t,E)=>(o(),w("section",null,[I(c,{item:e.value,"active-provider":t.provider},null,8,["item","active-provider"]),e.value?(o(),a(m,{key:0,itemtype:"albumtracks","parent-item":e.value,"show-provider":!0,"show-favorites-only-filter":!0,"show-library-only-filter":e.value.provider=="library"&&g(A)(e.value).length>0,"show-refresh-button":!1,"load-items":p,"sort-keys":["track_number","name","sort_name","duration","duration_desc"],title:t.$t("tracks")},null,8,["parent-item","show-library-only-filter","title"])):s("",!0),D,e.value?(o(),a(m,{key:1,itemtype:"albumversions","parent-item":e.value,"show-provider":!0,"show-favorites-only-filter":!1,"show-refresh-button":!1,"load-items":d,"sort-keys":["provider","name","year"],title:t.$t("other_versions"),"hide-on-empty":!0},null,8,["parent-item","title"])):s("",!0),B,e.value?(o(),a(v,{key:2,"item-details":e.value},null,8,["item-details"])):s("",!0)]))}});export{ee as default};
