@irfanshadikrishad/anilist 1.7.0 ā 1.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CITATION.cff +6 -6
- package/bin/helpers/auth.d.ts +1 -1
- package/bin/helpers/auth.js +80 -79
- package/bin/helpers/fetcher.js +7 -7
- package/bin/helpers/lists.js +196 -197
- package/bin/helpers/truncate.js +2 -2
- package/bin/helpers/types.d.ts +1 -1
- package/bin/helpers/validation.d.ts +2 -2
- package/bin/helpers/validation.js +11 -11
- package/bin/helpers/workers.d.ts +1 -1
- package/bin/helpers/workers.js +92 -92
- package/bin/index.js +77 -77
- package/bin/lib/colorize.d.ts +8 -0
- package/bin/lib/colorize.js +19 -0
- package/package.json +88 -84
package/bin/helpers/truncate.js
CHANGED
package/bin/helpers/types.d.ts
CHANGED
|
@@ -9,8 +9,8 @@ declare class Validate {
|
|
|
9
9
|
}[]): boolean;
|
|
10
10
|
/**
|
|
11
11
|
* Validate if MyAnimeList Anime XML file is valid or not
|
|
12
|
-
* @param xmlData
|
|
13
|
-
* @returns boolean
|
|
12
|
+
* @param {string} xmlData
|
|
13
|
+
* @returns {Promise<boolean>}
|
|
14
14
|
*/
|
|
15
15
|
static Import_AnimeXML(xmlData: string): Promise<boolean>;
|
|
16
16
|
/**
|
|
@@ -7,7 +7,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
7
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
|
-
import { parseStringPromise } from
|
|
10
|
+
import { parseStringPromise } from 'xml2js';
|
|
11
11
|
class Validate {
|
|
12
12
|
/**
|
|
13
13
|
* Validate importable JSON file
|
|
@@ -16,12 +16,12 @@ class Validate {
|
|
|
16
16
|
*/
|
|
17
17
|
static Import_JSON(data) {
|
|
18
18
|
return (Array.isArray(data) &&
|
|
19
|
-
data.every((item) => typeof item ===
|
|
19
|
+
data.every((item) => typeof item === 'object' && item !== null && 'id' in item));
|
|
20
20
|
}
|
|
21
21
|
/**
|
|
22
22
|
* Validate if MyAnimeList Anime XML file is valid or not
|
|
23
|
-
* @param xmlData
|
|
24
|
-
* @returns boolean
|
|
23
|
+
* @param {string} xmlData
|
|
24
|
+
* @returns {Promise<boolean>}
|
|
25
25
|
*/
|
|
26
26
|
static Import_AnimeXML(xmlData) {
|
|
27
27
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -43,12 +43,12 @@ class Validate {
|
|
|
43
43
|
return isValidId && hasRequiredFields;
|
|
44
44
|
});
|
|
45
45
|
if (!isValid) {
|
|
46
|
-
console.error(
|
|
46
|
+
console.error('Validation failed: Some anime entries are missing required fields or have invalid IDs.');
|
|
47
47
|
}
|
|
48
48
|
return isValid;
|
|
49
49
|
}
|
|
50
50
|
catch (error) {
|
|
51
|
-
console.error(
|
|
51
|
+
console.error('Error parsing or validating XML:', error);
|
|
52
52
|
return false;
|
|
53
53
|
}
|
|
54
54
|
});
|
|
@@ -78,12 +78,12 @@ class Validate {
|
|
|
78
78
|
return isValidId && hasRequiredFields;
|
|
79
79
|
});
|
|
80
80
|
if (!isValid) {
|
|
81
|
-
console.error(
|
|
81
|
+
console.error('Validation failed: Some manga entries are missing required fields or have invalid IDs.');
|
|
82
82
|
}
|
|
83
83
|
return isValid;
|
|
84
84
|
}
|
|
85
85
|
catch (error) {
|
|
86
|
-
console.error(
|
|
86
|
+
console.error('Error parsing or validating XML:', error);
|
|
87
87
|
return false;
|
|
88
88
|
}
|
|
89
89
|
});
|
|
@@ -97,10 +97,10 @@ class Validate {
|
|
|
97
97
|
return __awaiter(this, void 0, void 0, function* () {
|
|
98
98
|
try {
|
|
99
99
|
if (!(file === null || file === void 0 ? void 0 : file.trim())) {
|
|
100
|
-
console.error(
|
|
100
|
+
console.error('File content is empty or invalid.');
|
|
101
101
|
return false;
|
|
102
102
|
}
|
|
103
|
-
const obj3ct = JSON.parse(file);
|
|
103
|
+
const obj3ct = yield JSON.parse(file);
|
|
104
104
|
if (!obj3ct || !Array.isArray(obj3ct.anime)) {
|
|
105
105
|
console.error("Invalid JSON structure: Missing or malformed 'anime' array.");
|
|
106
106
|
return false;
|
|
@@ -108,7 +108,7 @@ class Validate {
|
|
|
108
108
|
return true;
|
|
109
109
|
}
|
|
110
110
|
catch (error) {
|
|
111
|
-
console.error(
|
|
111
|
+
console.error('Failed to parse JSON file:', error);
|
|
112
112
|
return false;
|
|
113
113
|
}
|
|
114
114
|
});
|
package/bin/helpers/workers.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DateMonthYear, MALAnimeStatus, MALMangaStatus, MediaWithProgress, User } from
|
|
1
|
+
import { DateMonthYear, MALAnimeStatus, MALMangaStatus, MediaWithProgress, User } from './types.js';
|
|
2
2
|
declare const aniListEndpoint = "https://graphql.anilist.co";
|
|
3
3
|
declare const redirectUri = "https://anilist.co/api/v2/oauth/pin";
|
|
4
4
|
declare function getTitle(title: {
|
package/bin/helpers/workers.js
CHANGED
|
@@ -18,31 +18,31 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
18
18
|
}
|
|
19
19
|
return t;
|
|
20
20
|
};
|
|
21
|
-
import fs from
|
|
22
|
-
import { readdir, writeFile } from
|
|
23
|
-
import inquirer from
|
|
24
|
-
import { createRequire } from
|
|
25
|
-
import open from
|
|
26
|
-
import { homedir } from
|
|
27
|
-
import Papa from
|
|
28
|
-
import { join } from
|
|
29
|
-
import process from
|
|
30
|
-
import Spinner from
|
|
31
|
-
import { Auth } from
|
|
32
|
-
import { fetcher } from
|
|
33
|
-
import { animeSearchQuery } from
|
|
34
|
-
import { MALAnimeStatus, MALMangaStatus, } from
|
|
21
|
+
import fs from 'fs';
|
|
22
|
+
import { readdir, writeFile } from 'fs/promises';
|
|
23
|
+
import inquirer from 'inquirer';
|
|
24
|
+
import { createRequire } from 'module';
|
|
25
|
+
import open from 'open';
|
|
26
|
+
import { homedir } from 'os';
|
|
27
|
+
import Papa from 'papaparse';
|
|
28
|
+
import { join } from 'path';
|
|
29
|
+
import process from 'process';
|
|
30
|
+
import Spinner from 'tiny-spinner';
|
|
31
|
+
import { Auth } from './auth.js';
|
|
32
|
+
import { fetcher } from './fetcher.js';
|
|
33
|
+
import { animeSearchQuery } from './queries.js';
|
|
34
|
+
import { MALAnimeStatus, MALMangaStatus, } from './types.js';
|
|
35
35
|
const aniListEndpoint = `https://graphql.anilist.co`;
|
|
36
|
-
const redirectUri =
|
|
36
|
+
const redirectUri = 'https://anilist.co/api/v2/oauth/pin';
|
|
37
37
|
const spinner = new Spinner();
|
|
38
38
|
function getTitle(title) {
|
|
39
|
-
return (title === null || title === void 0 ? void 0 : title.english) || (title === null || title === void 0 ? void 0 : title.romaji) ||
|
|
39
|
+
return (title === null || title === void 0 ? void 0 : title.english) || (title === null || title === void 0 ? void 0 : title.romaji) || '???';
|
|
40
40
|
}
|
|
41
41
|
function formatDateObject(dateObj) {
|
|
42
42
|
if (!dateObj)
|
|
43
|
-
return
|
|
44
|
-
return ([dateObj.day, dateObj.month, dateObj.year].filter(Boolean).join(
|
|
45
|
-
|
|
43
|
+
return 'null';
|
|
44
|
+
return ([dateObj.day, dateObj.month, dateObj.year].filter(Boolean).join('/') ||
|
|
45
|
+
'null');
|
|
46
46
|
}
|
|
47
47
|
function getNextSeasonAndYear() {
|
|
48
48
|
const currentMonth = new Date().getMonth() + 1;
|
|
@@ -51,59 +51,59 @@ function getNextSeasonAndYear() {
|
|
|
51
51
|
let nextYear;
|
|
52
52
|
// Determine the current season
|
|
53
53
|
if (currentMonth >= 12 || currentMonth <= 2) {
|
|
54
|
-
nextSeason =
|
|
54
|
+
nextSeason = 'SPRING';
|
|
55
55
|
nextYear = currentMonth === 12 ? currentYear + 1 : currentYear;
|
|
56
56
|
}
|
|
57
57
|
else if (currentMonth >= 3 && currentMonth <= 5) {
|
|
58
|
-
nextSeason =
|
|
58
|
+
nextSeason = 'SUMMER';
|
|
59
59
|
nextYear = currentYear;
|
|
60
60
|
}
|
|
61
61
|
else if (currentMonth >= 6 && currentMonth <= 8) {
|
|
62
|
-
nextSeason =
|
|
62
|
+
nextSeason = 'FALL';
|
|
63
63
|
nextYear = currentYear;
|
|
64
64
|
}
|
|
65
65
|
else if (currentMonth >= 9 && currentMonth <= 11) {
|
|
66
|
-
nextSeason =
|
|
66
|
+
nextSeason = 'WINTER';
|
|
67
67
|
nextYear = currentYear + 1;
|
|
68
68
|
}
|
|
69
69
|
return { nextSeason, nextYear };
|
|
70
70
|
}
|
|
71
71
|
function removeHtmlAndMarkdown(input) {
|
|
72
72
|
if (input) {
|
|
73
|
-
input = input.replace(/<\/?[^>]+(>|$)/g,
|
|
74
|
-
input = input.replace(/(^|\n)#{1,6}\s+(.+?)(\n|$)/g,
|
|
75
|
-
input = input.replace(/(\*\*|__)(.*?)\1/g,
|
|
76
|
-
input = input.replace(/(\*|_)(.*?)\1/g,
|
|
77
|
-
input = input.replace(/`(.+?)`/g,
|
|
78
|
-
input = input.replace(/\[(.*?)\]\(.*?\)/g,
|
|
79
|
-
input = input.replace(/!\[(.*?)\]\(.*?\)/g,
|
|
80
|
-
input = input.replace(/(^|\n)>\s+(.+?)(\n|$)/g,
|
|
81
|
-
input = input.replace(/(^|\n)-\s+(.+?)(\n|$)/g,
|
|
82
|
-
input = input.replace(/(^|\n)\d+\.\s+(.+?)(\n|$)/g,
|
|
83
|
-
input = input.replace(/(^|\n)\s*([-*_]){3,}\s*(\n|$)/g,
|
|
84
|
-
input = input.replace(/~~(.*?)~~/g,
|
|
85
|
-
input = input.replace(/\s+/g,
|
|
73
|
+
input = input.replace(/<\/?[^>]+(>|$)/g, '');
|
|
74
|
+
input = input.replace(/(^|\n)#{1,6}\s+(.+?)(\n|$)/g, '$2 ');
|
|
75
|
+
input = input.replace(/(\*\*|__)(.*?)\1/g, '$2');
|
|
76
|
+
input = input.replace(/(\*|_)(.*?)\1/g, '$2');
|
|
77
|
+
input = input.replace(/`(.+?)`/g, '$1');
|
|
78
|
+
input = input.replace(/\[(.*?)\]\(.*?\)/g, '$1');
|
|
79
|
+
input = input.replace(/!\[(.*?)\]\(.*?\)/g, '$1');
|
|
80
|
+
input = input.replace(/(^|\n)>\s+(.+?)(\n|$)/g, '$2 ');
|
|
81
|
+
input = input.replace(/(^|\n)-\s+(.+?)(\n|$)/g, '$2 ');
|
|
82
|
+
input = input.replace(/(^|\n)\d+\.\s+(.+?)(\n|$)/g, '$2 ');
|
|
83
|
+
input = input.replace(/(^|\n)\s*([-*_]){3,}\s*(\n|$)/g, '$1');
|
|
84
|
+
input = input.replace(/~~(.*?)~~/g, '$1');
|
|
85
|
+
input = input.replace(/\s+/g, ' ').trim();
|
|
86
86
|
}
|
|
87
87
|
return input;
|
|
88
88
|
}
|
|
89
89
|
function getDownloadFolderPath() {
|
|
90
90
|
const homeDirectory = homedir();
|
|
91
91
|
// Determine the Downloads folder path based on the platform
|
|
92
|
-
if (process.platform ===
|
|
93
|
-
return join(homeDirectory,
|
|
92
|
+
if (process.platform === 'win32') {
|
|
93
|
+
return join(homeDirectory, 'Downloads');
|
|
94
94
|
}
|
|
95
|
-
else if (process.platform ===
|
|
96
|
-
return join(homeDirectory,
|
|
95
|
+
else if (process.platform === 'darwin' || process.platform === 'linux') {
|
|
96
|
+
return join(homeDirectory, 'Downloads');
|
|
97
97
|
}
|
|
98
98
|
return homeDirectory;
|
|
99
99
|
}
|
|
100
100
|
function getFormattedDate() {
|
|
101
101
|
const date = new Date();
|
|
102
|
-
const day = String(date.getDate()).padStart(2,
|
|
103
|
-
const month = String(date.getMonth() + 1).padStart(2,
|
|
102
|
+
const day = String(date.getDate()).padStart(2, '0');
|
|
103
|
+
const month = String(date.getMonth() + 1).padStart(2, '0');
|
|
104
104
|
const year = date.getFullYear();
|
|
105
|
-
const hours = String(date.getHours()).padStart(2,
|
|
106
|
-
const minutes = String(date.getMinutes()).padStart(2,
|
|
105
|
+
const hours = String(date.getHours()).padStart(2, '0');
|
|
106
|
+
const minutes = String(date.getMinutes()).padStart(2, '0');
|
|
107
107
|
// Format as DD-MM-YYYY-HH-MM
|
|
108
108
|
return `${day}-${month}-${year}-${hours}-${minutes}`;
|
|
109
109
|
}
|
|
@@ -116,13 +116,13 @@ function saveJSONasJSON(js0n, dataType) {
|
|
|
116
116
|
return __awaiter(this, void 0, void 0, function* () {
|
|
117
117
|
try {
|
|
118
118
|
const jsonData = JSON.stringify(js0n, null, 2);
|
|
119
|
-
const path = yield saveToPath(dataType,
|
|
120
|
-
yield writeFile(path, jsonData,
|
|
119
|
+
const path = yield saveToPath(dataType, '.json');
|
|
120
|
+
yield writeFile(path, jsonData, 'utf8');
|
|
121
121
|
console.log(`\nSaved as JSON successfully.`);
|
|
122
122
|
open(getDownloadFolderPath());
|
|
123
123
|
}
|
|
124
124
|
catch (error) {
|
|
125
|
-
console.error(
|
|
125
|
+
console.error('\nError saving JSON data:', error);
|
|
126
126
|
}
|
|
127
127
|
});
|
|
128
128
|
}
|
|
@@ -139,13 +139,13 @@ function saveJSONasCSV(js0n, dataType) {
|
|
|
139
139
|
return (Object.assign(Object.assign({}, rest), { title: getTitle(title) }));
|
|
140
140
|
});
|
|
141
141
|
const csvData = Papa.unparse(js0n_WTAS);
|
|
142
|
-
const path = yield saveToPath(dataType,
|
|
143
|
-
yield writeFile(path, csvData,
|
|
142
|
+
const path = yield saveToPath(dataType, '.csv');
|
|
143
|
+
yield writeFile(path, csvData, 'utf8');
|
|
144
144
|
console.log(`\nSaved as CSV successfully.`);
|
|
145
145
|
open(getDownloadFolderPath());
|
|
146
146
|
}
|
|
147
147
|
catch (error) {
|
|
148
|
-
console.error(
|
|
148
|
+
console.error('\nError saving CSV data:', error);
|
|
149
149
|
}
|
|
150
150
|
});
|
|
151
151
|
}
|
|
@@ -153,8 +153,8 @@ function saveJSONasXML(js0n, data_type) {
|
|
|
153
153
|
return __awaiter(this, void 0, void 0, function* () {
|
|
154
154
|
try {
|
|
155
155
|
const xmlContent = data_type === 0 ? createAnimeListXML(js0n) : createMangaListXML(js0n);
|
|
156
|
-
const path = yield saveToPath(data_type === 0 ?
|
|
157
|
-
yield writeFile(path, yield xmlContent,
|
|
156
|
+
const path = yield saveToPath(data_type === 0 ? 'anime' : 'manga', '.xml');
|
|
157
|
+
yield writeFile(path, yield xmlContent, 'utf8');
|
|
158
158
|
console.log(`\nGenerated XML for MyAnimeList.`);
|
|
159
159
|
open(getDownloadFolderPath());
|
|
160
160
|
}
|
|
@@ -184,9 +184,9 @@ function selectFile(fileType) {
|
|
|
184
184
|
if (onlyFiles.length > 0) {
|
|
185
185
|
const answers = yield inquirer.prompt([
|
|
186
186
|
{
|
|
187
|
-
type:
|
|
188
|
-
name:
|
|
189
|
-
message:
|
|
187
|
+
type: 'list',
|
|
188
|
+
name: 'fileName',
|
|
189
|
+
message: 'Select a file to import:',
|
|
190
190
|
choices: onlyFiles,
|
|
191
191
|
},
|
|
192
192
|
]);
|
|
@@ -198,7 +198,7 @@ function selectFile(fileType) {
|
|
|
198
198
|
}
|
|
199
199
|
}
|
|
200
200
|
catch (error) {
|
|
201
|
-
console.error(
|
|
201
|
+
console.error('\nError selecting file:', error);
|
|
202
202
|
return null;
|
|
203
203
|
}
|
|
204
204
|
});
|
|
@@ -233,7 +233,7 @@ function createMangaXML(malId, progress, status, chapters, title) {
|
|
|
233
233
|
return `
|
|
234
234
|
<manga>
|
|
235
235
|
<manga_mangadb_id>${malId}</manga_mangadb_id>
|
|
236
|
-
<manga_title><![CDATA[${title ? title :
|
|
236
|
+
<manga_title><![CDATA[${title ? title : 'unknown'}]]></manga_title>
|
|
237
237
|
<manga_volumes>0</manga_volumes>
|
|
238
238
|
<manga_chapters>${chapters ? chapters : 0}</manga_chapters>
|
|
239
239
|
<my_id>0</my_id>
|
|
@@ -267,7 +267,7 @@ function createAnimeListXML(mediaWithProgress) {
|
|
|
267
267
|
const episodes = anime.episodes;
|
|
268
268
|
const title = getTitle(anime.title);
|
|
269
269
|
const status = statusMap[anime.status];
|
|
270
|
-
const format = anime.format ? anime.format :
|
|
270
|
+
const format = anime.format ? anime.format : '';
|
|
271
271
|
return createAnimeXML(malId, progress, status, episodes, title, format);
|
|
272
272
|
});
|
|
273
273
|
return `<myanimelist>
|
|
@@ -282,7 +282,7 @@ function createAnimeListXML(mediaWithProgress) {
|
|
|
282
282
|
<user_total_dropped>0</user_total_dropped>
|
|
283
283
|
<user_total_plantowatch>0</user_total_plantowatch>
|
|
284
284
|
</myinfo>
|
|
285
|
-
\n${xmlEntries.join(
|
|
285
|
+
\n${xmlEntries.join('\n')}\n
|
|
286
286
|
</myanimelist>`;
|
|
287
287
|
});
|
|
288
288
|
}
|
|
@@ -317,13 +317,13 @@ function createMangaListXML(mediaWithProgress) {
|
|
|
317
317
|
<user_total_dropped>1</user_total_dropped>
|
|
318
318
|
<user_total_plantoread>1</user_total_plantoread>
|
|
319
319
|
</myinfo>
|
|
320
|
-
\n${xmlEntries.join(
|
|
320
|
+
\n${xmlEntries.join('\n')}\n
|
|
321
321
|
</myanimelist>`;
|
|
322
322
|
});
|
|
323
323
|
}
|
|
324
324
|
function getCurrentPackageVersion() {
|
|
325
325
|
const require = createRequire(import.meta.url);
|
|
326
|
-
const packageJson = require(
|
|
326
|
+
const packageJson = require('../../package.json');
|
|
327
327
|
const version = packageJson.version;
|
|
328
328
|
return version || null;
|
|
329
329
|
}
|
|
@@ -331,27 +331,27 @@ function timestampToTimeAgo(timestamp) {
|
|
|
331
331
|
const now = Math.floor(Date.now() / 1000);
|
|
332
332
|
const elapsed = now - timestamp;
|
|
333
333
|
if (elapsed < 60) {
|
|
334
|
-
return `${elapsed} second${elapsed === 1 ?
|
|
334
|
+
return `${elapsed} second${elapsed === 1 ? '' : 's'} ago`;
|
|
335
335
|
}
|
|
336
336
|
else if (elapsed < 3600) {
|
|
337
337
|
const minutes = Math.floor(elapsed / 60);
|
|
338
|
-
return `${minutes} minute${minutes === 1 ?
|
|
338
|
+
return `${minutes} minute${minutes === 1 ? '' : 's'} ago`;
|
|
339
339
|
}
|
|
340
340
|
else if (elapsed < 86400) {
|
|
341
341
|
const hours = Math.floor(elapsed / 3600);
|
|
342
|
-
return `${hours} hour${hours === 1 ?
|
|
342
|
+
return `${hours} hour${hours === 1 ? '' : 's'} ago`;
|
|
343
343
|
}
|
|
344
344
|
else if (elapsed < 2592000) {
|
|
345
345
|
const days = Math.floor(elapsed / 86400);
|
|
346
|
-
return `${days} day${days === 1 ?
|
|
346
|
+
return `${days} day${days === 1 ? '' : 's'} ago`;
|
|
347
347
|
}
|
|
348
348
|
else if (elapsed < 31536000) {
|
|
349
349
|
const months = Math.floor(elapsed / 2592000);
|
|
350
|
-
return `${months} month${months === 1 ?
|
|
350
|
+
return `${months} month${months === 1 ? '' : 's'} ago`;
|
|
351
351
|
}
|
|
352
352
|
else {
|
|
353
353
|
const years = Math.floor(elapsed / 31536000);
|
|
354
|
-
return `${years} year${years === 1 ?
|
|
354
|
+
return `${years} year${years === 1 ? '' : 's'} ago`;
|
|
355
355
|
}
|
|
356
356
|
}
|
|
357
357
|
const anidbToanilistMapper = (romanjiName, year, englishName) => __awaiter(void 0, void 0, void 0, function* () {
|
|
@@ -365,7 +365,7 @@ const anidbToanilistMapper = (romanjiName, year, englishName) => __awaiter(void
|
|
|
365
365
|
return ((_a = response.data) === null || _a === void 0 ? void 0 : _a.Page.media) || [];
|
|
366
366
|
}
|
|
367
367
|
catch (error) {
|
|
368
|
-
console.error(
|
|
368
|
+
console.error('Error fetching AniList data:', error);
|
|
369
369
|
return [];
|
|
370
370
|
}
|
|
371
371
|
});
|
|
@@ -419,38 +419,38 @@ function handleRateLimitRetry(retryCount) {
|
|
|
419
419
|
});
|
|
420
420
|
}
|
|
421
421
|
function formatDate(timestamp) {
|
|
422
|
-
return timestamp ? new Date(timestamp * 1000).toUTCString() :
|
|
422
|
+
return timestamp ? new Date(timestamp * 1000).toUTCString() : 'N/A';
|
|
423
423
|
}
|
|
424
424
|
function logUserDetails(user, followersCount, followingCount) {
|
|
425
425
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
426
|
-
console.log(
|
|
426
|
+
console.log('\nš User Information:');
|
|
427
427
|
console.table({
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
428
|
+
'ID': user.id,
|
|
429
|
+
'Name': user.name,
|
|
430
|
+
'Site URL': user.siteUrl,
|
|
431
|
+
'Donator Tier': user.donatorTier,
|
|
432
|
+
'Donator Badge': user.donatorBadge,
|
|
433
|
+
'Account Created': formatDate(user.createdAt),
|
|
434
|
+
'Account Updated': formatDate(user.updatedAt),
|
|
435
|
+
'Blocked': user.isBlocked,
|
|
436
|
+
'isFollower': user.isFollower,
|
|
437
|
+
'isFollowing': user.isFollowing,
|
|
438
|
+
'Profile Color': ((_a = user.options) === null || _a === void 0 ? void 0 : _a.profileColor) || 'N/A',
|
|
439
|
+
'Timezone': ((_b = user.options) === null || _b === void 0 ? void 0 : _b.timezone) || 'N/A',
|
|
440
|
+
'Followers': followersCount,
|
|
441
|
+
'Following': followingCount,
|
|
442
442
|
});
|
|
443
|
-
console.log(
|
|
443
|
+
console.log('\nš Anime Statistics:');
|
|
444
444
|
console.table({
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
445
|
+
'Count': ((_d = (_c = user.statistics) === null || _c === void 0 ? void 0 : _c.anime) === null || _d === void 0 ? void 0 : _d.count) || 0,
|
|
446
|
+
'Episodes Watched': ((_f = (_e = user.statistics) === null || _e === void 0 ? void 0 : _e.anime) === null || _f === void 0 ? void 0 : _f.episodesWatched) || 0,
|
|
447
|
+
'Minutes Watched': ((_h = (_g = user.statistics) === null || _g === void 0 ? void 0 : _g.anime) === null || _h === void 0 ? void 0 : _h.minutesWatched) || 0,
|
|
448
448
|
});
|
|
449
|
-
console.log(
|
|
449
|
+
console.log('\nš Manga Statistics:');
|
|
450
450
|
console.table({
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
451
|
+
'Count': ((_k = (_j = user.statistics) === null || _j === void 0 ? void 0 : _j.manga) === null || _k === void 0 ? void 0 : _k.count) || 0,
|
|
452
|
+
'Chapters Read': ((_m = (_l = user.statistics) === null || _l === void 0 ? void 0 : _l.manga) === null || _m === void 0 ? void 0 : _m.chaptersRead) || 0,
|
|
453
|
+
'Volumes Read': ((_p = (_o = user.statistics) === null || _o === void 0 ? void 0 : _o.manga) === null || _p === void 0 ? void 0 : _p.volumesRead) || 0,
|
|
454
454
|
});
|
|
455
455
|
}
|
|
456
456
|
export { anidbToanilistMapper, aniListEndpoint, createAnimeListXML, createAnimeXML, createMangaListXML, createMangaXML, formatDateObject, getCurrentPackageVersion, getDownloadFolderPath, getFormattedDate, getNextSeasonAndYear, getTitle, handleRateLimitRetry, logUserDetails, redirectUri, removeHtmlAndMarkdown, saveJSONasCSV, saveJSONasJSON, saveJSONasXML, saveToPath, selectFile, simpleDateFormat, timestampToTimeAgo, };
|