import{I as d}from"./ItemsListing-Dd2XfzXe.js";import{I as y,_ as b}from"./ProviderDetails.vue_vue_type_style_index_0_lang-IDW8d92N.js";import{c as s,E as k}from"./index-HFEfURXv.js";import{d as w,r as h,w as I,o as T,a1 as g,b as D,e as l,H as B,D as m,I as u,f as p,B as E}from"./lucide-sS6c3snl.js";import"./Container-LvH0QRIT.js";import"./index-kQIztB-E.js";import"./vuetify-ffr1lJCG.js";import"./Toolbar-BVGuuXVD.js";import"./vue-router-CDtPtBGv.js";import"./Button-Dcdmvtuy.js";import"./ListItem-C-8fkaRP.js";import"./NowPlayingBadge.vue_vue_type_style_index_0_lang-Bgx2hOXi.js";import"./MediaItemThumb-D4l-2_B4.js";import"./vue-i18n-h4EBIvPF.js";import"./PanelviewItemCompact-PrcYkefq.js";import"./userPreferences-CRnDt302.js";import"./marquee_text_sync-BgCfvceK.js";import"./qrcode-Dq-byqKu.js";import"./marked-C0Rlrcoy.js";import"./color-BTziYnFN.js";import"./vueuse-B-HgI0gk.js";/* empty css            */import"./swiper-BtP4dEja.js";const W=w({__name:"TrackDetails",props:{itemId:{},provider:{},album:{}},setup(i){const r=i,e=h(),v=async function(){e.value=await s.getTrack(r.itemId,r.provider,r.album)};I(()=>r.itemId,t=>{t&&v()},{immediate:!0}),T(()=>{const t=s.subscribe(k.MEDIA_ITEM_UPDATED,a=>{const o=a.data;if(e.value?.uri==o.uri)e.value=o;else if("provider_mappings"in o){for(const n of o.provider_mappings)if(n.item_id==r.itemId&&[n.provider_instance,n.provider_domain].includes(r.provider)){e.value=o;break}}});g(t)});const f=async function(t){return await s.getTrackVersions(e.value.item_id,e.value.provider)},c=async function(t){return await s.getTrackAlbums(r.itemId,r.provider,t.libraryOnly)};return(t,a)=>(l(),D("section",null,[B(y,{item:e.value,"active-provider":i.provider},null,8,["item","active-provider"]),e.value?(l(),m(d,{key:0,itemtype:"trackalbums","parent-item":e.value,"show-provider":!0,"show-favorites-only-filter":!1,"show-library-only-filter":e.value.provider=="library"&&E(s).hasStreamingProviders.value,"show-track-number":!1,"show-refresh-button":!1,"load-items":c,"sort-keys":["name","sort_name","year","year_desc"],title:t.$t("appears_on"),path:i.provider+i.itemId,"allow-collapse":!0},null,8,["parent-item","show-library-only-filter","title","path"])):u("",!0),a[0]||(a[0]=p("br",null,null,-1)),e.value?(l(),m(d,{key:1,itemtype:"trackversions","parent-item":e.value,"show-provider":!0,"show-favorites-only-filter":!1,"show-track-number":!1,"load-items":f,"sort-keys":["name","sort_name","duration"],title:t.$t("other_versions"),"hide-on-empty":!0,path:i.provider+i.itemId,"allow-collapse":!0,"show-refresh-button":!1,"refresh-on-parent-update":!0},null,8,["parent-item","title","path"])):u("",!0),a[1]||(a[1]=p("br",null,null,-1)),e.value?(l(),m(b,{key:2,"item-details":e.value},null,8,["item-details"])):u("",!0),a[2]||(a[2]=p("br",null,null,-1))]))}});export{W as default};
