()
| 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 |
nothing calls this directly
no test coverage detected