mirror of
https://github.com/informaticker/discord-jellyfin-bot.git
synced 2024-11-24 18:41:57 +01:00
♻️ Fix code smells (#230)
This commit is contained in:
parent
631058093d
commit
bf1acb121b
@ -15,8 +15,8 @@ export class DiscordMessageService {
|
||||
description?: string;
|
||||
}): APIEmbed {
|
||||
return this.buildMessage({
|
||||
title: title,
|
||||
description: description,
|
||||
title,
|
||||
description,
|
||||
mixin(embedBuilder) {
|
||||
return embedBuilder
|
||||
.setAuthor({
|
||||
|
@ -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,
|
||||
|
@ -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(
|
||||
|
@ -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) {}
|
||||
|
@ -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 {
|
||||
|
@ -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(
|
||||
|
@ -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);
|
||||
|
@ -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)
|
||||
|
@ -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(
|
||||
|
@ -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 {
|
||||
|
@ -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,
|
||||
}),
|
||||
],
|
||||
});
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -10,7 +10,7 @@ export const formatMillisecondsAsHumanReadable = (
|
||||
end: 0,
|
||||
}),
|
||||
{
|
||||
format: format,
|
||||
format,
|
||||
},
|
||||
);
|
||||
return duration;
|
||||
|
Loading…
Reference in New Issue
Block a user