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/clients/discord/discord.message.service.ts b/src/clients/discord/discord.message.service.ts index 3b76577..21e2e23 100644 --- a/src/clients/discord/discord.message.service.ts +++ b/src/clients/discord/discord.message.service.ts @@ -15,8 +15,8 @@ export class DiscordMessageService { description?: string; }): APIEmbed { return this.buildMessage({ - title: title, - description: description, + title, + description, mixin(embedBuilder) { return embedBuilder .setAuthor({ diff --git a/src/clients/jellyfin/jellyfin.search.service.ts b/src/clients/jellyfin/jellyfin.search.service.ts index 318585c..7698310 100644 --- a/src/clients/jellyfin/jellyfin.search.service.ts +++ b/src/clients/jellyfin/jellyfin.search.service.ts @@ -44,9 +44,9 @@ export class JellyfinSearchService { try { const { data, status } = await searchApi.get({ - searchTerm: searchTerm, - includeItemTypes: includeItemTypes, - limit: limit, + searchTerm, + includeItemTypes, + limit, }); if (status !== 200) { @@ -138,7 +138,7 @@ export class JellyfinSearchService { const { data } = await searchApi.getItems({ ids: [id], userId: this.jellyfinService.getUserId(), - includeItemTypes: includeItemTypes, + includeItemTypes, }); if (!data.Items || data.Items.length !== 1) { @@ -157,9 +157,9 @@ export class JellyfinSearchService { const searchApi = getItemsApi(api); const { data } = await searchApi.getItems({ - ids: ids, + ids, userId: this.jellyfinService.getUserId(), - includeItemTypes: includeItemTypes, + includeItemTypes, }); if (!data.Items || data.Items.length !== 1) { @@ -184,7 +184,7 @@ export class JellyfinSearchService { const axiosReponse = await remoteImageApi.getRemoteImages({ itemId: id, includeAllLanguages: true, - limit: limit, + limit, }); if (axiosReponse.status !== 200) { @@ -219,7 +219,7 @@ export class JellyfinSearchService { try { const response = await searchApi.getItems({ includeItemTypes: [BaseItemKind.Audio], - limit: limit, + limit, sortBy: ['random'], userId: this.jellyfinService.getUserId(), recursive: true, diff --git a/src/commands/disconnect.command.ts b/src/commands/disconnect.command.ts index 4417601..8d52466 100644 --- a/src/commands/disconnect.command.ts +++ b/src/commands/disconnect.command.ts @@ -12,7 +12,7 @@ import { defaultMemberPermissions } from 'src/utils/environment'; @Command({ name: 'disconnect', description: 'Join your current voice channel', - defaultMemberPermissions: defaultMemberPermissions, + defaultMemberPermissions, }) export class DisconnectCommand { constructor( diff --git a/src/commands/help.command.ts b/src/commands/help.command.ts index 7cd3f6a..5d525f1 100644 --- a/src/commands/help.command.ts +++ b/src/commands/help.command.ts @@ -11,7 +11,7 @@ import { defaultMemberPermissions } from 'src/utils/environment'; @Command({ name: 'help', description: 'Get help if you're having problems with this bot', - defaultMemberPermissions: defaultMemberPermissions, + defaultMemberPermissions, }) export class HelpCommand { constructor(private readonly discordMessageService: DiscordMessageService) {} diff --git a/src/commands/next.command.ts b/src/commands/next.command.ts index 874fb6e..bf99f64 100644 --- a/src/commands/next.command.ts +++ b/src/commands/next.command.ts @@ -11,7 +11,7 @@ import { defaultMemberPermissions } from 'src/utils/environment'; @Command({ name: 'next', description: 'Go to the next track in the playlist', - defaultMemberPermissions: defaultMemberPermissions, + defaultMemberPermissions, }) @Injectable() export class SkipTrackCommand { diff --git a/src/commands/pause.command.ts b/src/commands/pause.command.ts index bed0e64..86bf391 100644 --- a/src/commands/pause.command.ts +++ b/src/commands/pause.command.ts @@ -12,7 +12,7 @@ import { defaultMemberPermissions } from 'src/utils/environment'; @Command({ name: 'pause', description: 'Pause or resume the playback of the current track', - defaultMemberPermissions: defaultMemberPermissions, + defaultMemberPermissions, }) export class PausePlaybackCommand { constructor( diff --git a/src/commands/play/play.comands.ts b/src/commands/play/play.comands.ts index 8a15fe7..02ca2a3 100644 --- a/src/commands/play/play.comands.ts +++ b/src/commands/play/play.comands.ts @@ -34,7 +34,7 @@ import { PlayCommandParams, SearchType } from './play.params.ts'; @Command({ name: 'play', description: 'Search for an item on your Jellyfin instance', - defaultMemberPermissions: defaultMemberPermissions, + defaultMemberPermissions, }) export class PlayItemCommand { private readonly logger: Logger = new Logger(PlayItemCommand.name); diff --git a/src/commands/playlist/playlist.command.ts b/src/commands/playlist/playlist.command.ts index 336d283..d9016a8 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,16 +30,16 @@ 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({ name: 'playlist', description: 'Print the current track information', - defaultMemberPermissions: defaultMemberPermissions, + defaultMemberPermissions, }) @UseInterceptors(CollectorInterceptor) @UseCollectors(PlaylistInteractionCollector) @@ -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/commands/previous.command.ts b/src/commands/previous.command.ts index 349bdb5..071271e 100644 --- a/src/commands/previous.command.ts +++ b/src/commands/previous.command.ts @@ -12,7 +12,7 @@ import { defaultMemberPermissions } from 'src/utils/environment'; @Command({ name: 'previous', description: 'Go to the previous track', - defaultMemberPermissions: defaultMemberPermissions, + defaultMemberPermissions, }) export class PreviousTrackCommand { constructor( diff --git a/src/commands/random/random.command.ts b/src/commands/random/random.command.ts index a73f234..7001dae 100644 --- a/src/commands/random/random.command.ts +++ b/src/commands/random/random.command.ts @@ -17,7 +17,7 @@ import { defaultMemberPermissions } from 'src/utils/environment'; @Command({ name: 'random', description: 'Enqueues a random selection of tracks to your playlist', - defaultMemberPermissions: defaultMemberPermissions, + defaultMemberPermissions, }) @Injectable() export class EnqueueRandomItemsCommand { diff --git a/src/commands/stop.command.ts b/src/commands/stop.command.ts index 46c30ae..c538679 100644 --- a/src/commands/stop.command.ts +++ b/src/commands/stop.command.ts @@ -12,7 +12,7 @@ import { defaultMemberPermissions } from 'src/utils/environment'; @Command({ name: 'stop', description: 'Stop playback entirely and clear the current playlist', - defaultMemberPermissions: defaultMemberPermissions, + defaultMemberPermissions, }) @Injectable() export class StopPlaybackCommand { @@ -41,8 +41,8 @@ export class StopPlaybackCommand { this.discordMessageService[ hasActiveTrack ? 'buildMessage' : 'buildErrorMessage' ]({ - title: title, - description: description, + title, + description, }), ], }); diff --git a/src/commands/summon.command.ts b/src/commands/summon.command.ts index ca2304e..b6a698a 100644 --- a/src/commands/summon.command.ts +++ b/src/commands/summon.command.ts @@ -12,7 +12,7 @@ import { defaultMemberPermissions } from 'src/utils/environment'; @Command({ name: 'summon', description: 'Join your current voice channel', - defaultMemberPermissions: defaultMemberPermissions, + defaultMemberPermissions, }) export class SummonCommand { private readonly logger = new Logger(SummonCommand.name); diff --git a/src/commands/volume/volume.command.ts b/src/commands/volume/volume.command.ts index 64905e7..bf5fb5b 100644 --- a/src/commands/volume/volume.command.ts +++ b/src/commands/volume/volume.command.ts @@ -16,7 +16,7 @@ import { defaultMemberPermissions } from 'src/utils/environment'; @Command({ name: 'volume', description: 'Change the volume', - defaultMemberPermissions: defaultMemberPermissions, + defaultMemberPermissions, }) export class VolumeCommand { private readonly logger = new Logger(VolumeCommand.name); 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'; diff --git a/src/utils/timeUtils.ts b/src/utils/timeUtils.ts index ea3e860..3224eb2 100644 --- a/src/utils/timeUtils.ts +++ b/src/utils/timeUtils.ts @@ -10,7 +10,7 @@ export const formatMillisecondsAsHumanReadable = ( end: 0, }), { - format: format, + format, }, ); return duration;