import{I as l}from"./ItemsListing-db2c60f3.js";import{I as c,_ as v}from"./ProviderDetails.vue_vue_type_script_setup_true_lang-47aa75bc.js";import{d as f,r as b,o as y,b as i,af as h,a as _,J as k,c as o,g as w,f as I,e as a,u as g,j as s,i as n,ah as A}from"./index-2dd0c7d2.js";import"./ListviewItem-a6570b10.js";import"./helpers-4d7c5bf6.js";import"./Container-fdf4c1f5.js";import"./VListItem-cb387084.js";import"./_plugin-vue_export-helper-c27b6911.js";/* empty css              */import"./VLabel-1f522f96.js";import"./VList-d110868a.js";import"./VCard-907b4685.js";import"./VCardText-0ed41581.js";import"./VMenu-97c1c955.js";import"./ListItem-87435fbb.js";import"./Button-69b906cf.js";import"./VTooltip-e62b61bd.js";import"./VCheckboxBtn-c3f9b6ff.js";import"./PanelviewItem-68416368.js";import"./VSpacer-e11897c6.js";import"./Alert-65a1093b.js";import"./VAlert-4eed3112.js";import"./Toolbar-1720c469.js";import"./VBadge-91055b8b.js";import"./VToolbar-6047eebf.js";import"./ItemContextMenu.vue_vue_type_style_index_0_scoped_7aadaa8c_lang-7ff19a96.js";import"./eventbus-d154090d.js";import"./VTextField-de7279c6.js";import"./VVirtualScroll-660ff9a6.js";import"./VSnackbar-6950ff68.js";import"./layout-42d7f450.js";import"./VDialog-e187bf14.js";const D=n("br",null,null,-1),B=n("br",null,null,-1),se=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(),w("section",null,[I(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{se as default};
