Skip to content

Commit 70a4b7b

Browse files
authored
Match with clean_song_name_alpha_numeric in PlaylistManager correctly (#2253)
* Match with clean_song_name_alpha_numeric in PlaylistManager correctly * Linting
1 parent d208ecd commit 70a4b7b

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/helpers/playlist_manager.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import {
1414
sendErrorMessage,
1515
sendInfoMessage,
1616
} from "./discord_utils";
17+
import { sql } from "kysely";
1718
import { youtube_v3 } from "googleapis";
1819
import Axios from "axios";
1920
import EnvVariableManager from "../env_variable_manager";
@@ -985,8 +986,13 @@ export default class PlaylistManager {
985986
eb(
986987
"clean_song_name_alpha_numeric",
987988
"like",
988-
songName.replace(/[^0-9a-z]/gi, "") ||
989-
songName,
989+
songName.replace(/[^0-9a-z]/gi, "")
990+
? eb.fn("CleanSongName", [
991+
sql`${songName}`,
992+
])
993+
: eb.fn("CleanSongName", [
994+
sql`${songName.replace(/[^0-9a-z]/gi, "")}`,
995+
]),
990996
),
991997
),
992998
),

0 commit comments

Comments
 (0)