import{I as m}from"./ItemsListing-4e050c6c.js";import{I as c,_ as v}from"./ProviderDetails.vue_vue_type_script_setup_true_lang-89045d01.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-5eb5c9ac.js";import"./VCheckbox-2a28a1cd.js";import"./eventbus-4894d390.js";import"./VListItem-b9a4cfb8.js";import"./VCheckboxBtn-cb68b622.js";import"./VList-13fa461d.js";import"./VCardText-1810bf8a.js";import"./VCard-cb863c33.js";import"./VMenu-4088b2e7.js";import"./_plugin-vue_export-helper-c27b6911.js";import"./ListItem-7b05ebf9.js";import"./Button-64160646.js";import"./VSpacer-81b0afbb.js";/* empty css              */import"./PanelviewItemCompact-4dc20236.js";import"./VAlert-12c553a2.js";import"./Container-1fa5169e.js";import"./Toolbar-6cac4d7d.js";import"./VToolbar-77830c55.js";import"./VTextField-574f2a77.js";import"./VInfiniteScroll-61b7ed02.js";import"./layout-2c007cef.js";import"./VVirtualScroll-5ee5768d.js";import"./VDialog-480c2f48.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};
