MCPcopy Index your code
hub / github.com/MALSync/MALSync / sync

Function sync

src/utils/syncHandler.ts:399–470  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

397 return api.storage.remove('backgroundListSync');
398 },
399 async sync() {
400 if (await background.isEnabled()) {
401 con.log('Start Background list Sync');
402 setBadgeText('♻');
403
404 return syncLists('anime')
405 .then(() => {
406 return syncLists('manga');
407 })
408 .then(() => {
409 setBadgeText('');
410 })
411 .catch(e => {
412 con.error(e);
413 setBadgeText('');
414 });
415 }
416 con.error('Background list Sync not allowed');
417 return [];
418
419 async function syncLists(type) {
420 const mode = 'mirror';
421 const list = {};
422 const missing = [];
423
424 const providerList = getListProvider({
425 mal: {
426 text: 'Init',
427 list: null,
428 master: false,
429 },
430 anilist: {
431 text: 'Init',
432 list: null,
433 master: false,
434 },
435 kitsu: {
436 text: 'Init',
437 list: null,
438 master: false,
439 },
440 mangabaka: {
441 text: 'Init',
442 list: null,
443 master: false,
444 },
445 simkl: {
446 text: 'Init',
447 list: null,
448 master: false,
449 },
450 shiki: {
451 text: 'Init',
452 list: null,
453 master: false,
454 },
455 });
456

Callers

nothing calls this directly

Calls 3

syncListsFunction · 0.85
errorMethod · 0.80
setBadgeTextFunction · 0.70

Tested by

no test coverage detected