From 36ba5143db80c8dd588e302e530d7041f525b3bf Mon Sep 17 00:00:00 2001 From: Manuel <30572287+manuel-rw@users.noreply.github.com> Date: Sun, 3 Sep 2023 14:37:07 +0200 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20Fix=20code=20smells=20(#23?= =?UTF-8?q?1)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app.module.ts | 2 +- src/commands/playlist/playlist.command.ts | 6 +----- src/models/search/SearchHint.ts | 1 + src/models/shared/Playlist.ts | 2 +- 4 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/app.module.ts b/src/app.module.ts index bdea924..c7f507d 100644 --- a/src/app.module.ts +++ b/src/app.module.ts @@ -1,7 +1,7 @@ import { DiscordModule } from '@discord-nestjs/core'; import { Logger, Module, OnModuleInit } from '@nestjs/common'; -import { ConfigModule, ConfigService } from '@nestjs/config'; +import { ConfigModule } from '@nestjs/config'; import { EventEmitterModule } from '@nestjs/event-emitter'; import { ScheduleModule } from '@nestjs/schedule'; diff --git a/src/commands/playlist/playlist.command.ts b/src/commands/playlist/playlist.command.ts index d25f58f..b683018 100644 --- a/src/commands/playlist/playlist.command.ts +++ b/src/commands/playlist/playlist.command.ts @@ -1,6 +1,5 @@ import { CollectorInterceptor, SlashCommandPipe } from '@discord-nestjs/common'; import { - AppliedCollectors, Command, Handler, IA, @@ -13,11 +12,9 @@ import { Injectable, Logger, UseInterceptors } from '@nestjs/common'; import { ActionRowBuilder, ButtonBuilder, - ButtonInteraction, ButtonStyle, CommandInteraction, EmbedBuilder, - InteractionCollector, InteractionReplyOptions, InteractionUpdateOptions, } from 'discord.js'; @@ -33,10 +30,10 @@ import { import { Interval } from '@nestjs/schedule'; import { lightFormat } from 'date-fns'; +import { defaultMemberPermissions } from 'src/utils/environment'; import { PlaylistInteractionCollector } from './playlist.interaction-collector'; import { PlaylistCommandParams } from './playlist.params'; import { PlaylistTempCommandData } from './playlist.types'; -import { defaultMemberPermissions } from 'src/utils/environment'; @Injectable() @Command({ @@ -59,7 +56,6 @@ export class PlaylistCommand { async handler( @InteractionEvent(SlashCommandPipe) dto: PlaylistCommandParams, @IA() interaction: CommandInteraction, - @AppliedCollectors(0) collector: InteractionCollector, ): Promise { const page = dto.page ?? 0; diff --git a/src/models/search/SearchHint.ts b/src/models/search/SearchHint.ts index 64d3fdb..9c89ca9 100644 --- a/src/models/search/SearchHint.ts +++ b/src/models/search/SearchHint.ts @@ -19,6 +19,7 @@ export class SearchHint { return `🎵 ${this.name}`; } + // eslint-disable-next-line @typescript-eslint/no-unused-vars async toTracks(searchService: JellyfinSearchService): Promise { return [new Track(this.id, this.name, this.runtimeInMilliseconds, {})]; } diff --git a/src/models/shared/Playlist.ts b/src/models/shared/Playlist.ts index c93bf5d..d6a4ede 100644 --- a/src/models/shared/Playlist.ts +++ b/src/models/shared/Playlist.ts @@ -1,4 +1,4 @@ -import { EventEmitter2, OnEvent } from '@nestjs/event-emitter'; +import { EventEmitter2 } from '@nestjs/event-emitter'; import { Track } from './Track';