import{I as m}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 y,o as h,b as a,af as b,a as k,J as w,c as o,g as I,f as _,e as i,u as g,j as s,i as n,ah as T}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:"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{se as default};
