Fix: Track title overflow

Fixed an issue where the lastfm track title would overflow and cover the artist
This commit is contained in:
J-onasJones 2023-09-26 17:17:31 +02:00
parent fafa5ca29a
commit 88f89ceb0f

View file

@ -26,8 +26,9 @@
* @param {string} str * @param {string} str
*/ */
function truncateString(str) { function truncateString(str) {
if (str.length > 29) { const max_length = 27;
return str.slice(0, 29) + "..."; if (str.length > max_length) {
return str.slice(0, max_length) + "...";
} else { } else {
return str; return str;
} }