Fixed Style issues

pull/51/head
Trivernis 6 years ago
parent 5114228134
commit 3ae7fbc6fa

@ -2,6 +2,10 @@ const cmdLib = require('../../CommandLib'),
anilistApi = require('../../api/AnilistApi'),
location = './lib/commands/AnilistApiCommands';
/**
* The AniList commands are all commands that interact with the anilist api.
*/
/**
* Returns a string for a name.
* @param nameNode {String} The AniList name node in format {first, last, native}
@ -56,6 +60,12 @@ class RichMediaInfo extends cmdLib.ExtendedRichEmbed {
}
if (mediaInfo.endDate && mediaInfo.endDate.day)
fields['End Date'] = `${mediaInfo.endDate.day}.${mediaInfo.endDate.month}.${mediaInfo.endDate.year}`;
this.addStaffInfo(mediaInfo);
this.addFields(fields);
}
addStaffInfo(mediaInfo) {
let fields = {};
if (mediaInfo.staff && mediaInfo.staff.edges) {
let staffContent = mediaInfo.staff.edges.map((x) => {
let url = x.node.siteUrl;
@ -83,7 +93,6 @@ class RichMediaInfo extends cmdLib.ExtendedRichEmbed {
fields['Staff'] = staffFieldValue;
}
}
this.addFields(fields);
}
}
@ -269,7 +278,7 @@ class AniListCommandModule extends cmdLib.CommandModule {
else
characterData = await anilistApi.searchCharacterByName(s);
this._logger.silly(`Character Query returned ${JSON.stringify(characterData)}`);
return new RichCharacterInfo(characterData)
return new RichCharacterInfo(characterData);
} catch (err) {
if (err.message) {
this._logger.verbose(err.message);

@ -76,7 +76,7 @@ class ModuleLogger {
constructor(moduleInstance) {
this.logger = logger;
if (moduleInstance.constructor) {
if (moduleInstance.constructor)
switch (moduleInstance.constructor.name) {
case 'String':
this.logName = moduleInstance;
@ -87,9 +87,9 @@ class ModuleLogger {
default:
this.logName = moduleInstance.constructor.name;
}
} else {
else
this.logName = moduleInstance.toString();
}
}
silly(msg, meta) {

Loading…
Cancel
Save