mirror of
https://github.com/BluemediaDev/muse.git
synced 2025-05-11 12:21:37 +02:00
Add split
command (#363)
Co-authored-by: Max Isom <hi@maxisom.me> Co-authored-by: Max Isom <codetheweb@users.noreply.github.com>
This commit is contained in:
parent
d438d46c09
commit
3dd1f21945
8 changed files with 188 additions and 61 deletions
|
@ -13,13 +13,13 @@ const getMaxSongTitleLength = (title: string) => {
|
|||
return nonASCII.test(title) ? 28 : 48;
|
||||
};
|
||||
|
||||
const getSongTitle = ({title, url}: QueuedSong, shouldTruncate = false) => {
|
||||
const getSongTitle = ({title, url, offset}: QueuedSong, shouldTruncate = false) => {
|
||||
const cleanSongTitle = title.replace(/\[.*\]/, '').trim();
|
||||
|
||||
const songTitle = shouldTruncate ? truncate(cleanSongTitle, getMaxSongTitleLength(cleanSongTitle)) : cleanSongTitle;
|
||||
const youtubeId = url.length === 11 ? url : getYouTubeID(url) ?? '';
|
||||
|
||||
return `[${songTitle}](https://www.youtube.com/watch?v=${youtubeId})`;
|
||||
return `[${songTitle}](https://www.youtube.com/watch?v=${youtubeId}${offset === 0 ? '' : '&t=' + String(offset)})`;
|
||||
};
|
||||
|
||||
const getQueueInfo = (player: Player) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue