import{I as m}from"./ItemsListing-efdefe10.js";import{I as c,_ as v}from"./ProviderDetails.vue_vue_type_script_setup_true_lang-3318bf4e.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,ar as A}from"./index-2e87fa03.js";import"./VCheckbox-386509eb.js";import"./eventbus-0b29a02c.js";import"./VListItem-89fd7b1a.js";import"./VCheckboxBtn-95584b13.js";import"./VList-a4b75488.js";import"./VCardText-064374a3.js";import"./VCard-c125380f.js";import"./VMenu-148e092d.js";import"./_plugin-vue_export-helper-c27b6911.js";import"./ListItem-db7cb046.js";import"./Button-74c30473.js";import"./VSpacer-f5f551d9.js";/* empty css              */import"./PanelviewItemCompact-a679900d.js";import"./VAlert-d83244d0.js";import"./Container-a429dbf0.js";import"./Toolbar-0e15c31f.js";import"./VToolbar-00d7489e.js";import"./VTextField-6302d32d.js";import"./VInfiniteScroll-72c5f022.js";import"./layout-61f409b8.js";import"./VVirtualScroll-9a54f195.js";import"./VDialog-8481a663.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};
