import{I as n}from"./ItemsListing-4e050c6c.js";import{I as c,_ as v}from"./ProviderDetails.vue_vue_type_script_setup_true_lang-89045d01.js";import{d as f,r as y,o as h,b as a,a8 as b,a as k,L as w,c as o,g as I,f as _,e as i,u as g,j as s,i as m,ar as T}from"./index-5eb5c9ac.js";import"./VCheckbox-2a28a1cd.js";import"./eventbus-4894d390.js";import"./VListItem-b9a4cfb8.js";import"./VCheckboxBtn-cb68b622.js";import"./VList-13fa461d.js";import"./VCardText-1810bf8a.js";import"./VCard-cb863c33.js";import"./VMenu-4088b2e7.js";import"./_plugin-vue_export-helper-c27b6911.js";import"./ListItem-7b05ebf9.js";import"./Button-64160646.js";import"./VSpacer-81b0afbb.js";/* empty css              */import"./PanelviewItemCompact-4dc20236.js";import"./VAlert-12c553a2.js";import"./Container-1fa5169e.js";import"./Toolbar-6cac4d7d.js";import"./VToolbar-77830c55.js";import"./VTextField-574f2a77.js";import"./VInfiniteScroll-61b7ed02.js";import"./layout-2c007cef.js";import"./VVirtualScroll-5ee5768d.js";import"./VDialog-480c2f48.js";const D=m("br",null,null,-1),B=m("br",null,null,-1),ee=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(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"&&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(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),B,t.value?(o(),i(v,{key:2,"item-details":t.value},null,8,["item-details"])):s("",!0)]))}});export{ee as default};
