import{I as n}from"./ItemsListing-efdefe10.js";import{I as c,_ as v}from"./ProviderDetails.vue_vue_type_script_setup_true_lang-3318bf4e.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-2e87fa03.js";import"./VCheckbox-386509eb.js";import"./eventbus-0b29a02c.js";import"./VListItem-89fd7b1a.js";import"./VCheckboxBtn-95584b13.js";import"./VList-a4b75488.js";import"./VCardText-064374a3.js";import"./VCard-c125380f.js";import"./VMenu-148e092d.js";import"./_plugin-vue_export-helper-c27b6911.js";import"./ListItem-db7cb046.js";import"./Button-74c30473.js";import"./VSpacer-f5f551d9.js";/* empty css              */import"./PanelviewItemCompact-a679900d.js";import"./VAlert-d83244d0.js";import"./Container-a429dbf0.js";import"./Toolbar-0e15c31f.js";import"./VToolbar-00d7489e.js";import"./VTextField-6302d32d.js";import"./VInfiniteScroll-72c5f022.js";import"./layout-61f409b8.js";import"./VVirtualScroll-9a54f195.js";import"./VDialog-8481a663.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};
