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

Method malToKitsu

src/_provider/Kitsu/single.ts:391–412  ·  view source on GitHub ↗
(malid: number, type: any)

Source from the content-addressed store, hash-verified

389 }
390
391 protected malToKitsu(malid: number, type: any) {
392 return this.apiCall(
393 'GET',
394 `https://kitsu.app/api/edge/mappings?filter[externalSite]=myanimelist/${type}&filter[externalId]=${malid}&include=item&fields[item]=id`,
395 {},
396 )
397 .catch(e => {
398 if (e instanceof NotAutenticatedError) {
399 this._authenticated = false;
400 return this.apiCall(
401 'GET',
402 `https://kitsu.app/api/edge/mappings?filter[externalSite]=myanimelist/${type}&filter[externalId]=${malid}&include=item&fields[item]=id`,
403 {},
404 false,
405 );
406 }
407 throw e;
408 })
409 .then(res => {
410 return res;
411 });
412 }
413
414 protected async userId() {
415 const userId = await api.storage.get('kitsuUserId');

Callers 2

_updateMethod · 0.95
getDataMethod · 0.80

Calls 1

apiCallMethod · 0.95

Tested by

no test coverage detected