Skip to content

Commit

Permalink
Allow ignoring length when finding matches
Browse files Browse the repository at this point in the history
  • Loading branch information
nukeop committed May 19, 2017
1 parent 301ff63 commit b6f1687
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion app/utils/SongFinder.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,10 @@ function getTrack(artist, title, length, callback) {
yt.youtubeFetchVideoDetails(newItem, () => {
var ytmillis = newItem.data.length.split(':');
ytmillis = (ytmillis[0]*60 + 1*ytmillis[1]) * 1000;
var ratio = ytmillis/length;
var ratio = 1.0;
if (length !=0) {
ratio = ytmillis/length;
}

if (Math.abs(1.0-ratio) < ratioTolerance) {
var comparisonItem = {
Expand Down

0 comments on commit b6f1687

Please sign in to comment.