mirror of
https://github.com/informaticker/discord-jellyfin-bot.git
synced 2024-11-25 02:51:57 +01:00
refactor: Replace template strings with regular string literals
Template literals are useful when you need: 1. [Interpolated strings](https://en.wikipedia.org/wiki/String_interpolation).
This commit is contained in:
parent
41c98a3c9c
commit
f033790420
@ -219,7 +219,7 @@ export class DiscordVoiceService {
|
|||||||
|
|
||||||
if (this.audioPlayer === undefined) {
|
if (this.audioPlayer === undefined) {
|
||||||
this.logger.debug(
|
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({
|
this.audioPlayer = createAudioPlayer({
|
||||||
debug: process.env.DEBUG?.toLowerCase() === 'true',
|
debug: process.env.DEBUG?.toLowerCase() === 'true',
|
||||||
@ -265,7 +265,7 @@ export class DiscordVoiceService {
|
|||||||
return;
|
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 playlist = this.playbackService.getPlaylistOrDefault();
|
||||||
const finishedTrack = playlist.getActiveTrack();
|
const finishedTrack = playlist.getActiveTrack();
|
||||||
@ -280,7 +280,7 @@ export class DiscordVoiceService {
|
|||||||
);
|
);
|
||||||
|
|
||||||
if (!hasNextTrack) {
|
if (!hasNextTrack) {
|
||||||
this.logger.debug(`Reached the end of the playlist`);
|
this.logger.debug("Reached the end of the playlist");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -60,7 +60,7 @@ export class JellyinPlaystateService {
|
|||||||
private async onPlaybackFinished(track: Track) {
|
private async onPlaybackFinished(track: Track) {
|
||||||
if (!track) {
|
if (!track) {
|
||||||
this.logger.error(
|
this.logger.error(
|
||||||
`Unable to report playback because finished track was undefined`,
|
"Unable to report playback because finished track was undefined",
|
||||||
);
|
);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -78,7 +78,7 @@ export class JellyinPlaystateService {
|
|||||||
|
|
||||||
if (!track) {
|
if (!track) {
|
||||||
this.logger.error(
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -37,7 +37,7 @@ export class JellyfinSearchService {
|
|||||||
|
|
||||||
if (includeItemTypes.length === 0) {
|
if (includeItemTypes.length === 0) {
|
||||||
this.logger.warn(
|
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",
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -123,7 +123,7 @@ export class JellyfinWebSocketService implements OnModuleDestroy {
|
|||||||
this.handleSendPlaystateCommandRequest(sendPlaystateCommandRequest);
|
this.handleSendPlaystateCommandRequest(sendPlaystateCommandRequest);
|
||||||
break;
|
break;
|
||||||
case SessionMessageType[SessionMessageType.UserDataChanged]:
|
case SessionMessageType[SessionMessageType.UserDataChanged]:
|
||||||
this.logger.debug(`Received update for user session data`);
|
this.logger.debug("Received update for user session data");
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
this.logger.warn(
|
this.logger.warn(
|
||||||
|
@ -70,7 +70,7 @@ export class PlayItemCommand {
|
|||||||
embeds: [
|
embeds: [
|
||||||
this.discordMessageService.buildMessage({
|
this.discordMessageService.buildMessage({
|
||||||
title: 'No results found',
|
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,
|
ephemeral: true,
|
||||||
|
@ -80,7 +80,7 @@ export class PlaylistInteractionCollector {
|
|||||||
return current - 1;
|
return current - 1;
|
||||||
default:
|
default:
|
||||||
this.logger.error(
|
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;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
@ -36,7 +36,7 @@ export class VolumeCommand {
|
|||||||
await interaction.editReply({
|
await interaction.editReply({
|
||||||
embeds: [
|
embeds: [
|
||||||
this.discordMessageService.buildMessage({
|
this.discordMessageService.buildMessage({
|
||||||
title: `Unable to change your volume`,
|
title: "Unable to change your volume",
|
||||||
description:
|
description:
|
||||||
'The bot is not playing any music or is not straming to a channel',
|
'The bot is not playing any music or is not straming to a channel',
|
||||||
}),
|
}),
|
||||||
|
Loading…
Reference in New Issue
Block a user