Skip to content

Commit

Permalink
Improve YouTube video title parsing
Browse files Browse the repository at this point in the history
Set video title as track name if artist and track cannot be extracted from video title.
  • Loading branch information
alexesprit committed May 12, 2019
1 parent 4686335 commit 3d72e30
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/core/content/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,14 @@ const Util = {
}

// No match? Try splitting, then.
if (artist === null && track === null) {
if (Util.isArtistTrackEmpty({ artist, track })) {
({ artist, track } = this.splitArtistTrack(title));
}

if (Util.isArtistTrackEmpty({ artist, track })) {
track = title;
}

return { artist, track };
},

Expand Down

0 comments on commit 3d72e30

Please sign in to comment.