import{I as d}from"./ItemsListing-D6AMqIYc.js";import{I as y,_ as b}from"./ProviderDetails.vue_vue_type_style_index_0_lang-ClXR5oFa.js";import{c as s,E as k}from"./index-CxiRlsCY.js";import{d as w,r as h,w as I,o as T,a0 as g,b as D,e as l,H as E,D as m,I as p,f as u,u as B}from"./lucide-C2DU1LFb.js";import"./Container-CwfZ2VgM.js";import"./index-kQIztB-E.js";import"./vuetify-RelkxOq-.js";import"./utils-CDN07tui.js";import"./Toolbar-MwYpbj3t.js";import"./userPreferences-ln7cf3P6.js";import"./vue-router-BgJK_hRC.js";import"./Button-DBt8j7D4.js";import"./ListItem-DzUpG5Dm.js";import"./NowPlayingBadge.vue_vue_type_style_index_0_lang-D7lqdhVg.js";import"./MediaItemThumb-C7OhU3lK.js";import"./ProviderIcon.vue_vue_type_style_index_0_lang-C17dV9_V.js";import"./vue-i18n-DySrp6mW.js";import"./PanelviewItemCompact-Cjl_ij1h.js";import"./marquee_text_sync-BtOjTSaq.js";import"./qrcode-DSFhiIp2.js";import"./marked-C0Rlrcoy.js";import"./color-BTziYnFN.js";import"./vueuse-DIaEWNCo.js";/* empty css            */import"./swiper-Jy9GbtzK.js";const Y=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,[E(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"&&B(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"])):p("",!0),a[0]||(a[0]=u("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"])):p("",!0),a[1]||(a[1]=u("br",null,null,-1)),e.value?(l(),m(b,{key:2,"item-details":e.value},null,8,["item-details"])):p("",!0),a[2]||(a[2]=u("br",null,null,-1))]))}});export{Y as default};
