MCPcopy Create free account
hub / github.com/MALSync/MALSync / initFrontendMode

Function initFrontendMode

src/_provider/listAbstract.ts:170–188  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

168 protected updateListener;
169
170 public initFrontendMode() {
171 this.modes.frontend = true;
172 this.updateListener = emitter.on(
173 'update.*',
174 data => {
175 con.log('update', data);
176 if (data.cacheKey) {
177 const item = this.templist.find(el => el.cacheKey === data.cacheKey);
178 con.log(item);
179 if (item && data.state) {
180 item.watchedEp = data.state.episode;
181 item.score = data.state.score;
182 item.status = data.state.status;
183 }
184 }
185 },
186 { objectify: true },
187 );
188 }
189
190 public destroy() {
191 if (this.updateListener) {

Callers

nothing calls this directly

Calls 1

onMethod · 0.80

Tested by

no test coverage detected