You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have often encountered the problem that on youtube (and other platform) the artists are seperated by tags like: [",", "&", "x"] which causes the following.
I used something like the following in my script. The point is to extract just the first artist via Regex because last.fm only handles it correctly that way.
function cleanupArtist(artist: string) {
// Define patterns to find additional artists or features.
const patterns = [/ & .*/, / x .*/, / feat\..*/];
let cleanedArtist = artist;
patterns.forEach((pattern) => {
cleanedArtist = cleanedArtist.replace(pattern, '');
});
return cleanedArtist.trim();
}
The text was updated successfully, but these errors were encountered:
@Ceddicedced Thanks for sharing this. Not sure if it'll get merged in, but it was exactly what I needed for my project after identifying this same problem.
I have often encountered the problem that on youtube (and other platform) the artists are seperated by tags like: [",", "&", "x"] which causes the following.
I used something like the following in my script. The point is to extract just the first artist via Regex because last.fm only handles it correctly that way.
The text was updated successfully, but these errors were encountered: