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

Method init

src/kitsu/kitsuClass.ts:56–98  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

54 }
55
56 async init() {
57 await waitForPageToBeVisible();
58 if (this.url.indexOf('?mal-sync=authentication') > -1) {
59 this.authentication();
60 }
61
62 const urlpart = utils.urlPart(this.url, 3);
63 if ((urlpart === 'anime' || urlpart === 'manga') && utils.urlPart(this.url, 4)) {
64 if (this.same && typeof this.page !== 'undefined' && this.page.malObj !== 'undefined') {
65 this.streamingUI();
66 this.malToKiss();
67 this.pageRelation();
68 return;
69 }
70 const malObj = new KitsuSingle(this.url);
71 await malObj.update();
72
73 this.page = {
74 page: 'detail',
75 id: malObj.getIds().kitsu.id,
76 malid: malObj.getIds().mal,
77 apiCacheKey: malObj.getApiCacheKey(),
78 type: urlpart,
79 malObj,
80 };
81 con.log('page', this.page);
82 this.streamingUI();
83 this.malToKiss();
84 this.pageRelation();
85 }
86
87 const urlpart4 = utils.urlPart(this.url, 5);
88 if (urlpart4 === 'library') {
89 let type = 'anime';
90 if (utils.urlParam(this.url, 'media') === 'manga') type = 'manga';
91 this.page = {
92 page: 'bookmarks',
93 type,
94 };
95 con.log('page', this.page);
96 this.bookmarks();
97 }
98 }
99
100 authentication() {
101 try {

Callers 1

constructorMethod · 0.95

Calls 6

authenticationMethod · 0.95
streamingUIMethod · 0.95
malToKissMethod · 0.95
pageRelationMethod · 0.95
bookmarksMethod · 0.95
waitForPageToBeVisibleFunction · 0.90

Tested by

no test coverage detected