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

Function setEntrySettings

src/utils/general.ts:255–285  ·  view source on GitHub ↗
(type, id, options, tags = '')

Source from the content-addressed store, hash-verified

253}
254
255export async function setEntrySettings(type, id, options, tags = '') {
256 const tempOptions = {};
257 if (options) {
258 for (const key in options) {
259 switch (key) {
260 case 'u':
261 case 'p':
262 tempOptions[key] = options[key];
263 break;
264 default:
265 }
266 }
267
268 if (api.settings.get('malTags')) {
269 // TAG mode
270 tags = setUrlInTags(JSON.stringify(tempOptions), tags);
271 } else {
272 // No TAG mode
273 await api.storage.set(`tagSettings/${type}/${id}`, JSON.stringify(tempOptions));
274 }
275 }
276
277 if (!Object.values(tempOptions).find(el => Boolean(el))) {
278 tags = setUrlInTags('', tags);
279 if (!api.settings.get('malTags')) {
280 await api.storage.remove(`tagSettings/${type}/${id}`);
281 }
282 }
283
284 return tags;
285}
286
287export async function getEntrySettings(type, id, tags = '') {
288 const tempOptions: any = {

Callers

nothing calls this directly

Calls 4

setUrlInTagsFunction · 0.85
removeMethod · 0.80
getMethod · 0.65
setMethod · 0.65

Tested by

no test coverage detected