mirror of
https://github.com/informaticker/discord-jellyfin-bot.git
synced 2024-11-23 18:21:55 +01:00
fix lint
This commit is contained in:
parent
84ff83ede0
commit
5d6a88860c
13
src/index.js
13
src/index.js
@ -10,32 +10,31 @@ try {
|
||||
handleChannelMessage
|
||||
} = require("./messagehandler");
|
||||
const log = require("loglevel");
|
||||
const prefix = require('loglevel-plugin-prefix');
|
||||
const chalk = require('chalk');
|
||||
const prefix = require("loglevel-plugin-prefix");
|
||||
const chalk = require("chalk");
|
||||
const colors = {
|
||||
TRACE: chalk.magenta,
|
||||
DEBUG: chalk.cyan,
|
||||
INFO: chalk.blue,
|
||||
WARN: chalk.yellow,
|
||||
ERROR: chalk.red,
|
||||
ERROR: chalk.red
|
||||
};
|
||||
|
||||
log.setLevel(CONFIG["log-level"]);
|
||||
|
||||
|
||||
prefix.reg(log);
|
||||
log.enableAll();
|
||||
|
||||
prefix.apply(log, {
|
||||
format (level, name, timestamp) {
|
||||
return `${chalk.gray(`[${timestamp}]`)} ${colors[level.toUpperCase()](level)} ${chalk.green(`${name}:`)}`;
|
||||
},
|
||||
}
|
||||
});
|
||||
|
||||
prefix.apply(log.getLogger('critical'), {
|
||||
prefix.apply(log.getLogger("critical"), {
|
||||
format (level, name, timestamp) {
|
||||
return chalk.red.bold(`[${timestamp}] ${level} ${name}:`);
|
||||
},
|
||||
}
|
||||
});
|
||||
|
||||
jellyfinClientManager.init();
|
||||
|
@ -57,7 +57,6 @@ function startPlaying (voiceconnection = discordclientmanager.getDiscordClient()
|
||||
|
||||
getAudioDispatcher().on("finish", () => {
|
||||
if (isRepeat) {
|
||||
|
||||
log.debug("repeat and sending following payload as reportPlaybackStopped to the server: ", getStopPayload());
|
||||
jellyfinClientManager.getJellyfinClient().reportPlaybackStopped(getStopPayload());
|
||||
startPlaying(voiceconnection, undefined, currentPlayingPlaylistIndex, 0);
|
||||
@ -168,7 +167,6 @@ function previousTrack () {
|
||||
* @param {Object=} disconnectVoiceConnection - Optional The voice Connection do disconnect from
|
||||
*/
|
||||
function stop (disconnectVoiceConnection, itemId = getItemId()) {
|
||||
|
||||
isPaused = true;
|
||||
if (interactivemsghandler.hasMessage()) {
|
||||
interactivemsghandler.destroy();
|
||||
|
@ -1,9 +1,6 @@
|
||||
function checkJellyfinItemIDRegex (strgintomatch) {
|
||||
const regexresult = strgintomatch.match(/([0-9]|[a-f]){32}/);
|
||||
if(regexresult)
|
||||
return [regexresult[0]];
|
||||
else
|
||||
return undefined;
|
||||
if (regexresult) { return [regexresult[0]]; } else { return undefined; }
|
||||
}
|
||||
|
||||
function ticksToSeconds (ticks) {
|
||||
|
Loading…
Reference in New Issue
Block a user