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

Function main

src/background/releaseProgress.ts:61–87  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

59}
60
61async function main() {
62 const alive = new KeepAlive();
63 alive.start();
64
65 try {
66 setBadgeText('⌛');
67 await api.settings.init();
68 if (!api.settings.get('epPredictions')) {
69 throw 'epPredictions disabled';
70 }
71 await listUpdateWithPOST(1, 'anime');
72 await listUpdateWithPOST(1, 'manga');
73 if (api.settings.get('loadPTWForProgress')) {
74 await listUpdateWithPOST(6, 'anime');
75 await listUpdateWithPOST(6, 'manga');
76 }
77 con.log('Progress done');
78 setBadgeText('');
79 alive.stop();
80 return true;
81 } catch (e) {
82 con.log('Progress Failed', e);
83 }
84 setBadgeText('');
85 alive.stop();
86 return false;
87}
88
89async function listUpdateWithPOST(state, type) {
90 const logger = con.m('release').m(type);

Callers 2

initProgressSchedulerFunction · 0.70

Calls 6

startMethod · 0.95
stopMethod · 0.95
listUpdateWithPOSTFunction · 0.85
setBadgeTextFunction · 0.70
getMethod · 0.65
initMethod · 0.45

Tested by

no test coverage detected