import{_ as n}from"./ItemsListing.vue_vue_type_style_index_0_lang-02893598.js";import{_ as d,a as v}from"./ProviderDetails.vue_vue_type_script_setup_true_lang-9ad4f695.js";import{d as f,r as h,o as y,b as a,ah as b,a as _,I as k,c as o,h as w,f as I,e as i,u as T,j as s,g as m,aj as g}from"./index-0ae84607.js";import"./ListviewItem-156d947d.js";import"./VBadge-bfb26993.js";import"./Container-eb92362b.js";import"./forwardRefs-d0d7c5bd.js";import"./Button-a1dfd3f5.js";import"./VMenu-f26d3a19.js";/* empty css              */import"./VInput-00e20677.js";import"./VSlideGroup-18f8a11f.js";import"./VCard-e96ab32b.js";import"./VCardText-b1a0de89.js";import"./VTooltip-054ea37d.js";import"./PanelviewItem.vue_vue_type_style_index_0_lang-a0b4c306.js";import"./contextmenu-5ae46870.js";import"./Alert-ee4ff93d.js";import"./VAlert-212471f5.js";import"./VToolbar-b7dd8339.js";import"./VTextField-4bf39c0d.js";import"./VVirtualScroll-06bbaaf5.js";import"./layout-f3684635.js";import"./VDialog-2b5eada8.js";const D=m("br",null,null,-1),$=m("br",null,null,-1),Z=f({__name:"TrackDetails",props:{itemId:{},provider:{},album:{}},setup(p){const r=p,t=h(),l=async function(){t.value=await a.getTrack(r.itemId,r.provider,r.album)};y(()=>{if(r.provider=="library"){const e=a.subscribe(b.MEDIA_ITEM_UPDATED,l,`library://artist/${r.itemId}`);_(e)}}),k(()=>r.itemId,e=>{e&&l()},{immediate:!0});const u=async function(e){return await a.getTrackVersions(t.value.item_id,t.value.provider)},c=async function(e){return await a.getTrackAlbums(r.itemId,r.provider,e.libraryOnly)};return(e,B)=>(o(),w("section",null,[I(d,{item:t.value,"active-provider":e.provider},null,8,["item","active-provider"]),t.value?(o(),i(n,{key:0,itemtype:"trackalbums","parent-item":t.value,"show-provider":!0,"show-favorites-only-filter":!1,"show-library-only-filter":t.value.provider=="library"&&T(g)(t.value).length>0,"show-track-number":!1,"show-refresh-button":!1,"load-items":c,"sort-keys":["name","sort_name","year","year_desc"],title:e.$t("appears_on"),path:e.provider+e.itemId,"allow-collapse":!0},null,8,["parent-item","show-library-only-filter","title","path"])):s("",!0),D,t.value?(o(),i(n,{key:1,itemtype:"trackversions","parent-item":t.value,"show-provider":!0,"show-favorites-only-filter":!1,"show-track-number":!1,"load-items":u,"show-refresh-button":!1,"sort-keys":["name","sort_name","duration"],title:e.$t("other_versions"),"hide-on-empty":!0,path:e.provider+e.itemId,"allow-collapse":!0},null,8,["parent-item","title","path"])):s("",!0),$,t.value?(o(),i(v,{key:2,"item-details":t.value},null,8,["item-details"])):s("",!0)]))}});export{Z as default};
