"use strict";(globalThis["webpackChunksynclounge"]=globalThis["webpackChunksynclounge"]||[]).push([[9062],{9062:(t,e,a)=>{a.r(e),a.d(e,{default:()=>u});var i=a(4437),r=a(6275),n=a(5294),s=function(){var t=this,e=t._self._c;return t.metadata?e("div",["series"===t.metadata.type||"show"===t.metadata.type?e("PlexSeries",{attrs:{metadata:t.metadata}}):"season"===t.metadata.type?e("PlexSeason",{attrs:{metadata:t.metadata}}):e("PlexItem",{attrs:{metadata:t.metadata}})],1):e(n.Z,[e(i.Z,{staticStyle:{position:"relative"},attrs:{cols:"12"}},[e(r.Z,{staticClass:"amber--text",staticStyle:{left:"50%",top:"50%"},attrs:{size:60,indeterminate:""}})],1)],1)},l=[],o=a(629);const h={name:"PlexMedia",components:{PlexItem:()=>Promise.all([a.e(7482),a.e(6031),a.e(2443),a.e(7810)]).then(a.bind(a,7810)),PlexSeason:()=>a.e(9268).then(a.bind(a,9268)),PlexSeries:()=>a.e(978).then(a.bind(a,978))},props:{machineIdentifier:{type:String,required:!0},ratingKey:{type:[Number,String],required:!0}},data:()=>({metadata:null,abortController:null}),computed:{...(0,o.Se)("plexservers",["GET_MEDIA_IMAGE_URL"]),combinedKey(){return{machineIdentifier:this.machineIdentifier,ratingKey:this.ratingKey}}},watch:{combinedKey:{handler(){return this.fetchMetadata()},immediate:!0}},beforeDestroy(){this.abortRequests()},methods:{...(0,o.nv)("plexservers",["SET_MEDIA_AS_BACKGROUND","FETCH_PLEX_METADATA"]),...(0,o.OI)(["SET_ACTIVE_METADATA"]),abortRequests(){this.abortController&&(this.abortController.abort(),this.abortController=null)},async fetchMetadataCriticalSection(t){this.metadata=await this.FETCH_PLEX_METADATA({ratingKey:this.ratingKey,machineIdentifier:this.machineIdentifier,signal:t}),this.SET_ACTIVE_METADATA(this.metadata),await this.SET_MEDIA_AS_BACKGROUND({machineIdentifier:this.machineIdentifier,...this.metadata})},async fetchMetadata(){this.abortRequests();const t=new AbortController;this.abortController=t;try{await this.fetchMetadataCriticalSection(t.signal)}catch(e){if(!t.signal.aborted)throw e}}}},d=h;var c=a(1001),m=(0,c.Z)(d,s,l,!1,null,null,null);const u=m.exports}}]);
//# sourceMappingURL=9062.a1989c62.js.map