import{_,f as I}from"./ItemsListing.vue_vue_type_script_setup_true_lang-436cf3d3.js";import{_ as E}from"./InfoHeader.vue_vue_type_style_index_0_lang-36a95710.js";import{l as B,r as c,w as g,o as L,O as m,af as V,b as z,q as o,y as f,j as n,v as b,x as k,F as N,z as S,A as h,M as y,ah as F,L as A}from"./index-e9211ef1.js";import{L as $,a as w}from"./Container-349a0ac0.js";import{a as R}from"./VCard-138864fc.js";import"./ListviewItem-b7a4258b.js";import"./MediaItemThumb.vue_vue_type_style_index_0_lang-278977b5.js";import"./VMenu-bc0cce60.js";import"./VDivider-336c24cd.js";import"./VBtn-68784d55.js";import"./VListItem-230d1393.js";import"./VDialog-5f240a62.js";import"./VToolbar-daf2b89f.js";import"./VSelect-04a129eb.js";/* empty css                             */import"./PanelviewItem.vue_vue_type_style_index_0_lang-fefd2afe.js";import"./Alert-55091fd0.js";import"./VSpacer-bdf2f653.js";import"./VBadge-9fa94f29.js";import"./VRow-e8f3e51e.js";/* empty css              */import"./layout-4499d5bc.js";const oe=B({__name:"ArtistDetails",props:{itemId:{},provider:{}},setup(C){const s=C,u=c("library"),l=c(!1),a=c(),d=async function(){const e=u.value;u.value="",a.value=await m.getArtist(s.itemId,s.provider),u.value=e};g(()=>s.itemId,e=>{e&&d()},{immediate:!0}),L(()=>{const e=m.subscribe(V.MEDIA_ITEM_ADDED,r=>{var i;const t=r.data;((i=a.value)==null?void 0:i.uri)==t.uri&&(l.value=!0)});z(e)});const D=async function(e,r,t,i,p=!0){const v=await m.getArtistAlbums(s.itemId,s.provider);return I(v,e,r,t,i,p)},T=async function(e,r,t,i,p=!0){const v=await m.getArtistTracks(s.itemId,s.provider);return I(v,e,r,t,i,p)};return(e,r)=>(o(),f("section",null,[n(E,{item:a.value,"active-provider":e.provider},null,8,["item","active-provider"]),n(_,{itemtype:"artisttracks","parent-item":a.value,"show-provider":!1,"show-favorites-only-filter":!1,"show-track-number":!1,"load-data":T,"sort-keys":["timestamp_added DESC","sort_name","sort_album"],"update-available":l.value,onRefreshClicked:r[0]||(r[0]=t=>{d(),l.value=!1}),title:e.$t("tracks"),checksum:e.provider+e.itemId},null,8,["parent-item","update-available","title","checksum"]),n(_,{itemtype:"artistalbums","parent-item":a.value,"show-provider":!1,"show-favorites-only-filter":!1,"load-data":D,"sort-keys":["timestamp_added DESC","sort_name","year"],"update-available":l.value,onRefreshClicked:r[1]||(r[1]=t=>{d(),l.value=!1}),title:e.$t("albums"),checksum:e.provider+e.itemId},null,8,["parent-item","update-available","title","checksum"]),a.value&&a.value.provider=="library"?(o(),b(R,{key:0,style:{"margin-left":"20px","margin-right":"20px"}},{default:k(()=>[(o(!0),f(N,null,S(h(F)(a.value),t=>(o(),f("div",{key:t.provider_instance},[[t.provider_domain,t.provider_instance].includes(e.provider)?y("",!0):(o(),b($,{key:0,onClick:i=>e.$router.push({name:"artist",params:{itemId:t.item_id,provider:t.provider_instance}}),subtitle:e.$t("check_item_on_provider",[a.value.name,h(m).providerManifests[t.provider_domain].name])},{prepend:k(()=>[A("div",null,[n(w,{domain:t.provider_domain,size:30},null,8,["domain"])])]),_:2},1032,["onClick","subtitle"])),e.provider!="library"&&a.value.provider=="library"?(o(),b($,{key:1,onClick:r[2]||(r[2]=i=>e.$router.push({name:"artist",params:{itemId:a.value.item_id,provider:a.value.provider}})),subtitle:e.$t("check_item_in_library",[a.value.name])},{prepend:k(()=>[A("div",null,[n(w,{domain:"library",size:30})])]),_:1},8,["subtitle"])):y("",!0)]))),128))]),_:1})):y("",!0)]))}});export{oe as default};
