diff --git a/.config/quickshell/modules/common/functions/string_utils.js b/.config/quickshell/modules/common/functions/string_utils.js index 117b68f8e..6becbc265 100644 --- a/.config/quickshell/modules/common/functions/string_utils.js +++ b/.config/quickshell/modules/common/functions/string_utils.js @@ -113,14 +113,14 @@ function wordWrap(str, maxLen) { function cleanMusicTitle(title) { if (!title) return ""; // Brackets - title = title.replace(/ *\([^)]*\) */g, " "); // Round brackets - title = title.replace(/ *\[[^\]]*\] */g, " "); // Square brackets - title = title.replace(/ *\{[^\}]*\} */g, " "); // Curly brackets + title = title.replace(/^ *\([^)]*\) */g, " "); // Round brackets + title = title.replace(/^ *\[[^\]]*\] */g, " "); // Square brackets + title = title.replace(/^ *\{[^\}]*\} */g, " "); // Curly brackets // Japenis brackets - title = title.replace(/【[^】]*】/, "") // Touhou - title = title.replace(/《[^》]*》/, "") // ?? - title = title.replace(/「[^」]*」/, "") // OP/ED - title = title.replace(/『[^』]*』/, "") // OP/ED + title = title.replace(/^ *【[^】]*】/, "") // Touhou + title = title.replace(/^ *《[^》]*》/, "") // ?? + title = title.replace(/^ *「[^」]*」/, "") // OP/ED + title = title.replace(/^ *『[^』]*』/, "") // OP/ED return title; }