🔀 Merge branch 'dev' into refactor/strict-typescript

This commit is contained in:
Manuel 2023-04-02 15:54:20 +02:00
commit 49312412fb
8 changed files with 18 additions and 19 deletions

View File

@ -9,7 +9,6 @@ import {
joinVoiceChannel,
NoSubscriberBehavior,
VoiceConnection,
VoiceConnectionStatus,
} from '@discordjs/voice';
import { Injectable } from '@nestjs/common';
@ -18,11 +17,11 @@ import { EventEmitter2, OnEvent } from '@nestjs/event-emitter';
import { GuildMember } from 'discord.js';
import { GenericTryHandler } from '../../models/generic-try-handler';
import { Track } from '../../models/shared/Track';
import { PlaybackService } from '../../playback/playback.service';
import { JellyfinStreamBuilderService } from '../jellyfin/jellyfin.stream.builder.service';
import { JellyfinWebSocketService } from '../jellyfin/jellyfin.websocket.service';
import { GenericTryHandler } from '../../models/generic-try-handler';
import { PlaybackService } from '../../playback/playback.service';
import { Track } from '../../models/shared/Track';
import { DiscordMessageService } from './discord.message.service';
@ -93,7 +92,7 @@ export class DiscordVoiceService {
this.jellyfinWebSocketService.initializeAndConnect();
if (this.voiceConnection == undefined) {
if (this.voiceConnection === undefined) {
this.voiceConnection = getVoiceConnection(member.guild.id);
}
@ -225,7 +224,7 @@ export class DiscordVoiceService {
if (this.audioPlayer === undefined) {
this.logger.debug(
`Initialized new instance of AudioPlayer because it has not been defined yet`,
"Initialized new instance of AudioPlayer because it has not been defined yet",
);
this.audioPlayer = createAudioPlayer({
debug: process.env.DEBUG?.toLowerCase() === 'true',
@ -292,7 +291,7 @@ export class DiscordVoiceService {
return;
}
this.logger.debug(`Audio player finished playing old resource`);
this.logger.debug("Audio player finished playing old resource");
const playlist = this.playbackService.getPlaylistOrDefault();
const finishedTrack = playlist.getActiveTrack();
@ -309,7 +308,7 @@ export class DiscordVoiceService {
);
if (!hasNextTrack) {
this.logger.debug(`Reached the end of the playlist`);
this.logger.debug("Reached the end of the playlist");
return;
}

View File

@ -60,7 +60,7 @@ export class JellyinPlaystateService {
private async onPlaybackFinished(track: Track) {
if (!track) {
this.logger.error(
`Unable to report playback because finished track was undefined`,
"Unable to report playback because finished track was undefined",
);
return;
}
@ -78,7 +78,7 @@ export class JellyinPlaystateService {
if (!track) {
this.logger.error(
`Unable to report changed playstate to Jellyfin because no track was active`,
"Unable to report changed playstate to Jellyfin because no track was active",
);
return;
}

View File

@ -38,7 +38,7 @@ export class JellyfinSearchService {
if (includeItemTypes.length === 0) {
this.logger.warn(
`Included item types are empty. This may lead to unwanted results`,
"Included item types are empty. This may lead to unwanted results",
);
}

View File

@ -114,7 +114,7 @@ export class JellyfinWebSocketService implements OnModuleDestroy {
this.handleSendPlaystateCommandRequest(sendPlaystateCommandRequest);
break;
case SessionMessageType[SessionMessageType.UserDataChanged]:
this.logger.debug(`Received update for user session data`);
this.logger.debug("Received update for user session data");
break;
default:
this.logger.warn(

View File

@ -20,14 +20,14 @@ import {
InteractionReplyOptions,
} from 'discord.js';
import { PlaybackService } from '../../playback/playback.service';
import { formatMillisecondsAsHumanReadable } from '../../utils/timeUtils';
import { DiscordMessageService } from '../../clients/discord/discord.message.service';
import { DiscordVoiceService } from '../../clients/discord/discord.voice.service';
import { JellyfinSearchService } from '../../clients/jellyfin/jellyfin.search.service';
import { SearchHint } from '../../models/search/SearchHint';
import { PlaybackService } from '../../playback/playback.service';
import { formatMillisecondsAsHumanReadable } from '../../utils/timeUtils';
import { SearchType, PlayCommandParams } from './play.params.ts';
import { PlayCommandParams, SearchType } from './play.params.ts';
@Injectable()
@Command({
@ -70,7 +70,7 @@ export class PlayItemCommand {
embeds: [
this.discordMessageService.buildMessage({
title: 'No results found',
description: `- Check for any misspellings\n- Grant me access to your desired libraries\n- Avoid special characters`,
description: "- Check for any misspellings\n- Grant me access to your desired libraries\n- Avoid special characters",
}),
],
ephemeral: true,

View File

@ -83,7 +83,7 @@ export class PlaylistInteractionCollector {
return current - 1;
default:
this.logger.error(
`Unable to map button interaction from collector to target page`,
"Unable to map button interaction from collector to target page",
);
return undefined;
}

View File

@ -36,7 +36,7 @@ export class VolumeCommand {
await interaction.editReply({
embeds: [
this.discordMessageService.buildMessage({
title: `Unable to change your volume`,
title: "Unable to change your volume",
description:
'The bot is not playing any music or is not straming to a channel',
}),

View File

@ -33,7 +33,7 @@ describe('UpdatesService', () => {
} as DiscordMessageService;
}
if (token === Client || token == '__inject_discord_client__') {
if (token === Client || token === '__inject_discord_client__') {
return {
guilds: {
cache: [