diff --git a/src/clients/discord/discord.message.service.ts b/src/clients/discord/discord.message.service.ts index 8a4a9c7..74ef51b 100644 --- a/src/clients/discord/discord.message.service.ts +++ b/src/clients/discord/discord.message.service.ts @@ -35,10 +35,12 @@ export class DiscordMessageService { buildMessage({ title, description, + authorUrl, mixin = (builder) => builder, }: { title: string; description?: string; + authorUrl?: string; mixin?: (embedBuilder: EmbedBuilder) => EmbedBuilder; }): APIEmbed { const date = formatRFC7231(new Date()); @@ -48,6 +50,7 @@ export class DiscordMessageService { .setAuthor({ name: title, iconURL: Constants.Design.Icons.JellyfinLogo, + url: authorUrl, }) .setFooter({ text: `${date}`, diff --git a/src/clients/jellyfin/jellyfin.search.service.ts b/src/clients/jellyfin/jellyfin.search.service.ts index f342ea2..047d16c 100644 --- a/src/clients/jellyfin/jellyfin.search.service.ts +++ b/src/clients/jellyfin/jellyfin.search.service.ts @@ -2,16 +2,17 @@ import { Injectable } from '@nestjs/common'; import { JellyfinService } from './jellyfin.service'; import { - BaseItemDto, BaseItemKind, SearchHint, - SearchHintResult, } from '@jellyfin/sdk/lib/generated-client/models'; import { getItemsApi } from '@jellyfin/sdk/lib/utils/api/items-api'; import { getPlaylistsApi } from '@jellyfin/sdk/lib/utils/api/playlists-api'; import { getSearchApi } from '@jellyfin/sdk/lib/utils/api/search-api'; import { Logger } from '@nestjs/common/services'; -import { JellyfinAudioPlaylist, JellyfinMusicAlbum } from '../../models/jellyfinAudioItems'; +import { + JellyfinAudioPlaylist, + JellyfinMusicAlbum, +} from '../../models/jellyfinAudioItems'; @Injectable() export class JellyfinSearchService { diff --git a/src/commands/help.command.ts b/src/commands/help.command.ts index baa548c..0457dd1 100644 --- a/src/commands/help.command.ts +++ b/src/commands/help.command.ts @@ -17,31 +17,25 @@ export class HelpCommand implements DiscordCommand { return { embeds: [ this.discordMessageService.buildMessage({ - title: 'a', + title: 'Jellyfin Discord Bot', description: 'Jellyfin Discord Bot is an open source and self-hosted Discord bot, that integrates with your Jellyfin Media server and enables you to playback music from your libraries. You can use the Discord Slash Commands to invoke bot commands.', + authorUrl: 'https://github.com/manuel-rw/jellyfin-discord-music-bot', mixin(embedBuilder) { - return embedBuilder - .setAuthor({ - name: 'Jellyfin Discord Bot', - iconURL: - 'https://github.com/walkxcode/dashboard-icons/blob/main/png/jellyfin.png?raw=true', - url: 'https://github.com/manuel-rw/jellyfin-discord-music-bot', - }) - .addFields([ - { - name: 'Report an issue', - value: - 'https://github.com/manuel-rw/jellyfin-discord-music-bot/issues/new/choose', - inline: true, - }, - { - name: 'Source code', - value: - 'https://github.com/manuel-rw/jellyfin-discord-music-bot', - inline: true, - }, - ]); + return embedBuilder.addFields([ + { + name: 'Report an issue', + value: + 'https://github.com/manuel-rw/jellyfin-discord-music-bot/issues/new/choose', + inline: true, + }, + { + name: 'Source code', + value: + 'https://github.com/manuel-rw/jellyfin-discord-music-bot', + inline: true, + }, + ]); }, }), ], diff --git a/src/commands/play.comands.ts b/src/commands/play.comands.ts index 4bc58fc..fe7a97c 100644 --- a/src/commands/play.comands.ts +++ b/src/commands/play.comands.ts @@ -28,7 +28,6 @@ import { searchResultAsJellyfinAudio, } from '../models/jellyfinAudioItems'; import { PlaybackService } from '../playback/playback.service'; -import { Constants } from '../utils/constants'; @Command({ name: 'play', @@ -99,7 +98,7 @@ export class PlayItemCommand const selectOptions: { label: string; value: string; emoji?: string }[] = firstItems.map((item) => ({ - label: item.prettyPrint(dto.search), + label: item.prettyPrint(dto.search).replace(/\*/g, ''), value: item.getValueId(), emoji: item.getEmoji(), })); @@ -107,14 +106,8 @@ export class PlayItemCommand return { embeds: [ this.discordMessageService.buildMessage({ - title: 'a', + title: 'Jellyfin Search Results', description: description, - mixin(embedBuilder) { - return embedBuilder.setAuthor({ - name: 'Jellyfin Search Results', - iconURL: Constants.Design.Icons.JellyfinLogo, - }); - }, }), ], components: [