remove " - Topic" from artist name

This commit is contained in:
Araxeus
2021-04-14 13:44:32 +03:00
parent 46ac0a1ed3
commit a2207a2cb3

View File

@ -46,6 +46,9 @@ const handleData = async (responseText, win) => {
let data = JSON.parse(responseText);
songInfo.title = data?.videoDetails?.title;
songInfo.artist = data?.videoDetails?.author;
if (songInfo.artist.endsWith(" - Topic")) {
songInfo.artist = songInfo.artist.slice(0, -8);
}
songInfo.views = data?.videoDetails?.viewCount;
songInfo.imageSrc = data?.videoDetails?.thumbnail?.thumbnails?.pop()?.url;
songInfo.songDuration = data?.videoDetails?.lengthSeconds;