Fix: odstrani podvojen izvajalec v naslovu komada
This commit is contained in:
parent
b14fbc5d5f
commit
675d8789b1
@ -130,8 +130,12 @@ function mapNowPlaying(np) {
|
||||
const camp = (np.campaign || '').toUpperCase();
|
||||
if (type === 'song') {
|
||||
const artist = (np.artist || '').trim();
|
||||
const title = (np.display_title || np.title || '').trim();
|
||||
const label = artist ? `${artist} — ${title}` : title;
|
||||
let title = (np.display_title || np.title || '').trim();
|
||||
// display_title je pogosto "Artist - Naslov"; ce se zacne z artistom, ga odstrani da ni podvojen
|
||||
if (artist && title.toLowerCase().startsWith(artist.toLowerCase())) {
|
||||
title = title.slice(artist.length).replace(/^\s*[-–—]\s*/, '').trim();
|
||||
}
|
||||
const label = artist ? (title ? `${artist} — ${title}` : artist) : title;
|
||||
return { kind: 'song', label, artist, title, started_at: np.started_at };
|
||||
}
|
||||
if (type === 'spot') {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user