import{_ as n}from"./ItemsListing.vue_vue_type_style_index_0_lang-784b9943.js";import{_ as c,a as v}from"./ProviderDetails.vue_vue_type_script_setup_true_lang-3991e7d4.js";import{d as f,r as b,o as y,b as i,ah as _,a as h,I as k,c as o,h as w,f as I,e as a,u as g,j as s,g as m,aj as A}from"./index-43311bc3.js";import"./ListviewItem-2b5b6af3.js";import"./VBadge-fcbfaeb4.js";import"./Container-9a0c901a.js";import"./forwardRefs-651c2bd6.js";import"./Button-8f8a6597.js";import"./VMenu-7c64b634.js";/* empty css              */import"./VInput-54c6b2cd.js";import"./VSlideGroup-390b1a05.js";import"./VCard-6b86821e.js";import"./VCardText-bdb89c1f.js";import"./VTooltip-6463f4cd.js";import"./PanelviewItem.vue_vue_type_style_index_0_lang-c2c2aaac.js";import"./contextmenu-7f33cf6e.js";import"./Alert-95d71572.js";import"./VAlert-8faad15a.js";import"./VToolbar-b1ca2657.js";import"./VTextField-9b7f128a.js";import"./VVirtualScroll-898a23a9.js";import"./layout-679c2edc.js";import"./VDialog-b13a6f94.js";const D=m("br",null,null,-1),$=m("br",null,null,-1),Z=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(_.MEDIA_ITEM_UPDATED,l,`library://album/${r.itemId}`);h(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,B)=>(o(),w("section",null,[I(c,{item:e.value,"active-provider":t.provider},null,8,["item","active-provider"]),e.value?(o(),a(n,{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(n,{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),$,e.value?(o(),a(v,{key:2,"item-details":e.value},null,8,["item-details"])):s("",!0)]))}});export{Z as default};
