♻️ 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; description?: string;
}): APIEmbed { }): APIEmbed {
return this.buildMessage({ return this.buildMessage({
title: title, title,
description: description, description,
mixin(embedBuilder) { mixin(embedBuilder) {
return embedBuilder return embedBuilder
.setAuthor({ .setAuthor({

View File

@ -44,9 +44,9 @@ export class JellyfinSearchService {
try { try {
const { data, status } = await searchApi.get({ const { data, status } = await searchApi.get({
searchTerm: searchTerm, searchTerm,
includeItemTypes: includeItemTypes, includeItemTypes,
limit: limit, limit,
}); });
if (status !== 200) { if (status !== 200) {
@ -138,7 +138,7 @@ export class JellyfinSearchService {
const { data } = await searchApi.getItems({ const { data } = await searchApi.getItems({
ids: [id], ids: [id],
userId: this.jellyfinService.getUserId(), userId: this.jellyfinService.getUserId(),
includeItemTypes: includeItemTypes, includeItemTypes,
}); });
if (!data.Items || data.Items.length !== 1) { if (!data.Items || data.Items.length !== 1) {
@ -157,9 +157,9 @@ export class JellyfinSearchService {
const searchApi = getItemsApi(api); const searchApi = getItemsApi(api);
const { data } = await searchApi.getItems({ const { data } = await searchApi.getItems({
ids: ids, ids,
userId: this.jellyfinService.getUserId(), userId: this.jellyfinService.getUserId(),
includeItemTypes: includeItemTypes, includeItemTypes,
}); });
if (!data.Items || data.Items.length !== 1) { if (!data.Items || data.Items.length !== 1) {
@ -184,7 +184,7 @@ export class JellyfinSearchService {
const axiosReponse = await remoteImageApi.getRemoteImages({ const axiosReponse = await remoteImageApi.getRemoteImages({
itemId: id, itemId: id,
includeAllLanguages: true, includeAllLanguages: true,
limit: limit, limit,
}); });
if (axiosReponse.status !== 200) { if (axiosReponse.status !== 200) {
@ -219,7 +219,7 @@ export class JellyfinSearchService {
try { try {
const response = await searchApi.getItems({ const response = await searchApi.getItems({
includeItemTypes: [BaseItemKind.Audio], includeItemTypes: [BaseItemKind.Audio],
limit: limit, limit,
sortBy: ['random'], sortBy: ['random'],
userId: this.jellyfinService.getUserId(), userId: this.jellyfinService.getUserId(),
recursive: true, recursive: true,

View File

@ -12,7 +12,7 @@ import { defaultMemberPermissions } from 'src/utils/environment';
@Command({ @Command({
name: 'disconnect', name: 'disconnect',
description: 'Join your current voice channel', description: 'Join your current voice channel',
defaultMemberPermissions: defaultMemberPermissions, defaultMemberPermissions,
}) })
export class DisconnectCommand { export class DisconnectCommand {
constructor( constructor(

View File

@ -11,7 +11,7 @@ import { defaultMemberPermissions } from 'src/utils/environment';
@Command({ @Command({
name: 'help', name: 'help',
description: 'Get help if you're having problems with this bot', description: 'Get help if you're having problems with this bot',
defaultMemberPermissions: defaultMemberPermissions, defaultMemberPermissions,
}) })
export class HelpCommand { export class HelpCommand {
constructor(private readonly discordMessageService: DiscordMessageService) {} constructor(private readonly discordMessageService: DiscordMessageService) {}

View File

@ -11,7 +11,7 @@ import { defaultMemberPermissions } from 'src/utils/environment';
@Command({ @Command({
name: 'next', name: 'next',
description: 'Go to the next track in the playlist', description: 'Go to the next track in the playlist',
defaultMemberPermissions: defaultMemberPermissions, defaultMemberPermissions,
}) })
@Injectable() @Injectable()
export class SkipTrackCommand { export class SkipTrackCommand {

View File

@ -12,7 +12,7 @@ import { defaultMemberPermissions } from 'src/utils/environment';
@Command({ @Command({
name: 'pause', name: 'pause',
description: 'Pause or resume the playback of the current track', description: 'Pause or resume the playback of the current track',
defaultMemberPermissions: defaultMemberPermissions, defaultMemberPermissions,
}) })
export class PausePlaybackCommand { export class PausePlaybackCommand {
constructor( constructor(

View File

@ -34,7 +34,7 @@ import { PlayCommandParams, SearchType } from './play.params.ts';
@Command({ @Command({
name: 'play', name: 'play',
description: 'Search for an item on your Jellyfin instance', description: 'Search for an item on your Jellyfin instance',
defaultMemberPermissions: defaultMemberPermissions, defaultMemberPermissions,
}) })
export class PlayItemCommand { export class PlayItemCommand {
private readonly logger: Logger = new Logger(PlayItemCommand.name); private readonly logger: Logger = new Logger(PlayItemCommand.name);

View File

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

View File

@ -12,7 +12,7 @@ import { defaultMemberPermissions } from 'src/utils/environment';
@Command({ @Command({
name: 'previous', name: 'previous',
description: 'Go to the previous track', description: 'Go to the previous track',
defaultMemberPermissions: defaultMemberPermissions, defaultMemberPermissions,
}) })
export class PreviousTrackCommand { export class PreviousTrackCommand {
constructor( constructor(

View File

@ -17,7 +17,7 @@ import { defaultMemberPermissions } from 'src/utils/environment';
@Command({ @Command({
name: 'random', name: 'random',
description: 'Enqueues a random selection of tracks to your playlist', description: 'Enqueues a random selection of tracks to your playlist',
defaultMemberPermissions: defaultMemberPermissions, defaultMemberPermissions,
}) })
@Injectable() @Injectable()
export class EnqueueRandomItemsCommand { export class EnqueueRandomItemsCommand {

View File

@ -12,7 +12,7 @@ import { defaultMemberPermissions } from 'src/utils/environment';
@Command({ @Command({
name: 'stop', name: 'stop',
description: 'Stop playback entirely and clear the current playlist', description: 'Stop playback entirely and clear the current playlist',
defaultMemberPermissions: defaultMemberPermissions, defaultMemberPermissions,
}) })
@Injectable() @Injectable()
export class StopPlaybackCommand { export class StopPlaybackCommand {
@ -41,8 +41,8 @@ export class StopPlaybackCommand {
this.discordMessageService[ this.discordMessageService[
hasActiveTrack ? 'buildMessage' : 'buildErrorMessage' hasActiveTrack ? 'buildMessage' : 'buildErrorMessage'
]({ ]({
title: title, title,
description: description, description,
}), }),
], ],
}); });

View File

@ -12,7 +12,7 @@ import { defaultMemberPermissions } from 'src/utils/environment';
@Command({ @Command({
name: 'summon', name: 'summon',
description: 'Join your current voice channel', description: 'Join your current voice channel',
defaultMemberPermissions: defaultMemberPermissions, defaultMemberPermissions,
}) })
export class SummonCommand { export class SummonCommand {
private readonly logger = new Logger(SummonCommand.name); private readonly logger = new Logger(SummonCommand.name);

View File

@ -16,7 +16,7 @@ import { defaultMemberPermissions } from 'src/utils/environment';
@Command({ @Command({
name: 'volume', name: 'volume',
description: 'Change the volume', description: 'Change the volume',
defaultMemberPermissions: defaultMemberPermissions, defaultMemberPermissions,
}) })
export class VolumeCommand { export class VolumeCommand {
private readonly logger = new Logger(VolumeCommand.name); private readonly logger = new Logger(VolumeCommand.name);

View File

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