MCPcopy
hub / github.com/MALSync/MALSync / info

Method info

src/_provider/AniList/metaOverview.ts:306–457  ·  view source on GitHub ↗
(data)

Source from the content-addressed store, hash-verified

304 }
305
306 private info(data) {
307 if (data.data.Media.format) {
308 let format = data.data.Media.format.toLowerCase().replace('_', ' ');
309 format = format.charAt(0).toUpperCase() + format.slice(1);
310 this.meta.info.push({
311 title: api.storage.lang('overview_sidebar_Format'),
312 body: [{ text: format }],
313 });
314 }
315
316 if (data.data.Media.episodes)
317 this.meta.info.push({
318 title: api.storage.lang('overview_sidebar_Episodes'),
319 body: [{ text: data.data.Media.episodes }],
320 });
321
322 if (data.data.Media.duration)
323 this.meta.info.push({
324 title: api.storage.lang('overview_sidebar_Duration'),
325 body: [
326 {
327 text: `${new IntlDuration().setRelativeTime(data.data.Media.duration, 'minutes', 'Duration').getRelativeText()}`,
328 },
329 ],
330 });
331
332 if (data.data.Media.status) {
333 let status = data.data.Media.status.toLowerCase().replace('_', ' ');
334 status = status.charAt(0).toUpperCase() + status.slice(1);
335 this.meta.info.push({
336 title: api.storage.lang('overview_sidebar_Status'),
337 body: [{ text: status }],
338 });
339 }
340
341 if (data.data.Media.startDate.year)
342 this.meta.info.push({
343 title: api.storage.lang('overview_sidebar_Start_Date'),
344 body: [
345 {
346 text: new IntlDateTime(
347 new Date(
348 data.data.Media.startDate.year,
349 data.data.Media.startDate.month,
350 data.data.Media.startDate.day,
351 ),
352 ).getDateTimeText(),
353 },
354 ],
355 });
356
357 if (data.data.Media.endDate.year)
358 this.meta.info.push({
359 title: api.storage.lang('overview_sidebar_End_Date'),
360 body: [
361 {
362 text: new IntlDateTime(
363 new Date(

Callers 1

_initMethod · 0.95

Calls 4

langMethod · 0.80
getRelativeTextMethod · 0.80
setRelativeTimeMethod · 0.80
getDateTimeTextMethod · 0.80

Tested by

no test coverage detected