♻️ Fix code smells (#230)

This commit is contained in:
Manuel 2023-09-03 14:33:21 +02:00 committed by GitHub
parent 631058093d
commit bf1acb121b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
14 changed files with 24 additions and 24 deletions

View File

@ -15,8 +15,8 @@ export class DiscordMessageService {
description?: string;
}): APIEmbed {
return this.buildMessage({
title: title,
description: description,
title,
description,
mixin(embedBuilder) {
return embedBuilder
.setAuthor({

View File

@ -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,

View File

@ -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(

View File

@ -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) {}

View File

@ -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 {

View File

@ -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(

View File

@ -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);

View File

@ -42,7 +42,7 @@ import { defaultMemberPermissions } from 'src/utils/environment';
@Command({
name: 'playlist',
description: 'Print the current track information',
defaultMemberPermissions: defaultMemberPermissions,
defaultMemberPermissions,
})
@UseInterceptors(CollectorInterceptor)
@UseCollectors(PlaylistInteractionCollector)

View File

@ -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(

View File

@ -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 {

View File

@ -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,
}),
],
});

View File

@ -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);

View File

@ -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);

View File

@ -10,7 +10,7 @@ export const formatMillisecondsAsHumanReadable = (
end: 0,
}),
{
format: format,
format,
},
);
return duration;