@@ -55,8 +55,9 @@ const songInfo = {
55
55
56
56
const handleData = async ( responseText , win ) => {
57
57
let data = JSON . parse ( responseText ) ;
58
- songInfo . title = data ?. videoDetails ?. title ;
59
- songInfo . artist = await getArtist ( win ) || cleanupArtistName ( data ?. videoDetails ?. author ) ;
58
+ songInfo . title = cleanupName ( data ?. videoDetails ?. title ) ;
59
+ songInfo . artist =
60
+ ( await getArtist ( win ) ) || cleanupName ( data ?. videoDetails ?. author ) ;
60
61
songInfo . views = data ?. videoDetails ?. viewCount ;
61
62
songInfo . imageSrc = data ?. videoDetails ?. thumbnail ?. thumbnails ?. pop ( ) ?. url ;
62
63
songInfo . songDuration = data ?. videoDetails ?. lengthSeconds ;
@@ -98,8 +99,15 @@ const registerProvider = (win) => {
98
99
} ) ;
99
100
} ;
100
101
101
- const suffixesToRemove = [ ' - Topic' , 'VEVO' ] ;
102
- function cleanupArtistName ( artist ) {
102
+ const suffixesToRemove = [
103
+ " - Topic" ,
104
+ "VEVO" ,
105
+ " (Performance Video)" ,
106
+ " (Official Music Video)" ,
107
+ " (Official Video)" ,
108
+ " (Clip officiel)" ,
109
+ ] ;
110
+ function cleanupName ( artist ) {
103
111
if ( ! artist ) {
104
112
return artist ;
105
113
}
@@ -114,4 +122,4 @@ function cleanupArtistName(artist) {
114
122
module . exports = registerCallback ;
115
123
module . exports . setupSongInfo = registerProvider ;
116
124
module . exports . getImage = getImage ;
117
- module . exports . cleanupArtistName = cleanupArtistName ;
125
+ module . exports . cleanupName = cleanupName ;
0 commit comments