import{I as m}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 y,o as h,b as a,ag as b,a as k,I as w,c as o,g as I,f as _,e as i,u as g,j as s,i as n,ai as T}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),ie=f({__name:"TrackDetails",props:{itemId:{},provider:{},album:{}},setup(p){const r=p,t=y(),l=async function(){t.value=await a.getTrack(r.itemId,r.provider,r.album)};h(()=>{if(r.provider=="library"){const e=a.subscribe(b.MEDIA_ITEM_UPDATED,l,`library://artist/${r.itemId}`);k(e)}}),w(()=>r.itemId,e=>{e&&l()},{immediate:!0});const u=async function(e){return await a.getTrackVersions(t.value.item_id,t.value.provider)},d=async function(e){return await a.getTrackAlbums(r.itemId,r.provider,e.libraryOnly)};return(e,E)=>(o(),I("section",null,[_(c,{item:t.value,"active-provider":e.provider},null,8,["item","active-provider"]),t.value?(o(),i(m,{key:0,itemtype:"trackalbums","parent-item":t.value,"show-provider":!0,"show-favorites-only-filter":!1,"show-library-only-filter":t.value.provider=="library"&&g(T)(t.value).length>0,"show-track-number":!1,"show-refresh-button":!1,"load-items":d,"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(m,{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),B,t.value?(o(),i(v,{key:2,"item-details":t.value},null,8,["item-details"])):s("",!0)]))}});export{ie as default};
