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

Function missingCheck

src/utils/syncHandler.ts:138–170  ·  view source on GitHub ↗
(item, missing, types, mode)

Source from the content-addressed store, hash-verified

136}
137
138export function missingCheck(item, missing, types, mode) {
139 if (item.master && item.master.uid) {
140 const tempTypes: any[] = [];
141 tempTypes.push(getType(item.master.url));
142 for (let i = 0; i < item.slaves.length; i++) {
143 const slave = item.slaves[i];
144 tempTypes.push(getType(slave.url));
145 }
146 for (const t in types) {
147 const type = types[t];
148 if (!tempTypes.includes(type)) {
149 const entry = {
150 title: item.master.title,
151 type: item.master.type,
152 syncType: type,
153 malId: item.master.malId,
154 score: item.master.score,
155 watchedEp: item.master.watchedEp,
156 status: item.master.status,
157 startDate: item.master.startDate,
158 finishDate: item.master.finishDate,
159 rewatchCount: item.master.rewatchCount,
160 url: `https://myanimelist.net/${item.master.type}/${item.master.malId}`,
161 error: null,
162 } as Partial<listElement>;
163 if (item.master.type === 'manga') {
164 entry.readVol = item.master.readVol;
165 }
166 missing.push(entry);
167 }
168 }
169 }
170}
171
172// Sync
173

Callers 1

generateSyncFunction · 0.85

Calls 1

getTypeFunction · 0.70

Tested by

no test coverage detected