From 576d97ed8259c1a450da389a832d20b39dc106f3 Mon Sep 17 00:00:00 2001 From: Manuel <30572287+manuel-rw@users.noreply.github.com> Date: Sun, 18 Dec 2022 19:21:21 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20Code=20review?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Meier Lukas --- src/clients/discord/discord.message.service.ts | 2 +- src/clients/jellyfin/jellyfin.service.ts | 2 +- src/commands/play.comands.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/clients/discord/discord.message.service.ts b/src/clients/discord/discord.message.service.ts index 155108a..6524b47 100644 --- a/src/clients/discord/discord.message.service.ts +++ b/src/clients/discord/discord.message.service.ts @@ -53,7 +53,7 @@ export class DiscordMessageService { text: `${date}`, }); - if (description !== undefined && description.length > 0) { + if (!description && description.length >= 1) { embedBuilder = embedBuilder.setDescription(description); } diff --git a/src/clients/jellyfin/jellyfin.service.ts b/src/clients/jellyfin/jellyfin.service.ts index 5bcfa21..d82763a 100644 --- a/src/clients/jellyfin/jellyfin.service.ts +++ b/src/clients/jellyfin/jellyfin.service.ts @@ -56,7 +56,7 @@ export class JellyfinService { } destroy() { - if (this.api === undefined) { + if (!this.api) { this.logger.warn( 'Jellyfin Api Client was unexpectitly undefined. Graceful destroy has failed', ); diff --git a/src/commands/play.comands.ts b/src/commands/play.comands.ts index dbead9e..7126a0f 100644 --- a/src/commands/play.comands.ts +++ b/src/commands/play.comands.ts @@ -64,7 +64,7 @@ export class PlayItemCommand ), ); - if (parsedItems.length < 1) { + if (parsedItems.length === 0) { return { embeds: [ this.discordMessageService.buildErrorMessage({