import{I as l}from"./ItemsListing-2655a521.js";import{I as c,_ as v}from"./ProviderDetails.vue_vue_type_script_setup_true_lang-91ac6b4e.js";import{d as f,r as b,o as y,b as i,ag as h,a as _,I as k,c as o,g as I,f as w,e as a,u as g,j as s,i as n,ai as A}from"./index-1fa25223.js";import"./ListviewItem-fa4b6d44.js";import"./helpers-f9fbf435.js";import"./Container-55c3ff81.js";import"./VListItem-53d44b85.js";import"./_plugin-vue_export-helper-c27b6911.js";/* empty css              */import"./VLabel-148b546a.js";import"./VList-f519ecda.js";import"./VCard-99bbc2f5.js";import"./VCardText-bbb7eb1a.js";import"./VMenu-85495654.js";import"./ListItem-9f85535e.js";import"./Button-0d671d73.js";import"./VTooltip-c87f5f44.js";import"./VCheckboxBtn-4c4cfeff.js";import"./PanelviewItem-f1eef939.js";import"./Alert-501a5edb.js";import"./VAlert-034cbd55.js";import"./Toolbar-77a90b60.js";import"./VBadge-3b97e665.js";import"./VToolbar-a7b4dbd4.js";import"./ItemContextMenu.vue_vue_type_style_index_0_scoped_be40882c_lang-79825e42.js";import"./eventbus-d154090d.js";import"./VTextField-46c02b72.js";import"./VVirtualScroll-f6a01209.js";import"./layout-6738e727.js";import"./VSelect-58338ce7.js";import"./VDialog-0a55bc34.js";const D=n("br",null,null,-1),B=n("br",null,null,-1),ae=f({__name:"AlbumDetails",props:{itemId:{},provider:{}},setup(p){const r=p,e=b(),m=async function(){e.value=await i.getAlbum(r.itemId,r.provider)};y(()=>{if(r.provider=="library"){const t=i.subscribe(h.MEDIA_ITEM_UPDATED,m,`library://album/${r.itemId}`);_(t)}}),k(()=>r.itemId,t=>{t&&m()},{immediate:!0});const u=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(),I("section",null,[w(c,{item:e.value,"active-provider":t.provider},null,8,["item","active-provider"]),e.value?(o(),a(l,{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":u,"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(l,{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{ae as default};
