Linter fixes for Javascript files.
This commit is contained in:
parent
ae759f6ab8
commit
1db5c9aa8a
14
mopidy_musicbox_webclient/static/js/controls.js
vendored
14
mopidy_musicbox_webclient/static/js/controls.js
vendored
@ -93,7 +93,7 @@ function playTrack(action) {
|
||||
mopidy.tracklist.clear().then(
|
||||
mopidy.tracklist.add({'uris': trackUris}).then(
|
||||
function(tlTracks) {
|
||||
mopidy.playback.play({'tl_track': tlTracks[selected]})
|
||||
mopidy.playback.play({'tl_track': tlTracks[selected]});
|
||||
}
|
||||
)
|
||||
);
|
||||
@ -143,7 +143,7 @@ function playTrackByUri(track_uri, playlist_uri) {
|
||||
|
||||
mopidy.tracklist.add({'uris': [playlist_uri]}).then(function(tlTracks) {
|
||||
// Can fail for all sorts of reasons. If so, just add individually.
|
||||
if (tlTracks.length == 0) {
|
||||
if (tlTracks.length === 0) {
|
||||
var trackUris = getTracksFromUri(playlist_uri, false);
|
||||
mopidy.tracklist.add({'uris': trackUris}).then(findAndPlayTrack);
|
||||
} else {
|
||||
@ -311,7 +311,7 @@ function setTracklistOption(name, new_value) {
|
||||
} else {
|
||||
$("#"+name+"bt").attr('style', 'color:#66DD33');
|
||||
}
|
||||
return new_value
|
||||
return new_value;
|
||||
}
|
||||
|
||||
function setRepeat(nwrepeat) {
|
||||
@ -364,7 +364,7 @@ function doSeekPos(value) {
|
||||
positionChanging = value;
|
||||
mopidy.playback.seek({'time_position': Math.round(value)}).then( function() {
|
||||
positionChanging = null;
|
||||
});;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@ -512,7 +512,7 @@ function addToFavourites(newTracks) {
|
||||
getFavourites().catch(console.error.bind(console)).then(function(favourites) {
|
||||
if (favourites) {
|
||||
if (favourites.tracks) {
|
||||
Array.prototype.push.apply(favourites.tracks, newTracks)
|
||||
Array.prototype.push.apply(favourites.tracks, newTracks);
|
||||
} else {
|
||||
favourites.tracks = newTracks;
|
||||
}
|
||||
@ -535,7 +535,7 @@ function addFavourite(uri, name) {
|
||||
}
|
||||
addToFavourites(newTracks);
|
||||
} else {
|
||||
if (newTracks.length == 0) {
|
||||
if (newTracks.length === 0) {
|
||||
console.log('No tracks to add');
|
||||
} else {
|
||||
console.log('Too many tracks (%d) to add', tracks.length);
|
||||
@ -568,7 +568,7 @@ function showFavourites() {
|
||||
|
||||
$.cookie.json = true;
|
||||
if ($.cookie('streamUris')) {
|
||||
tmp = '<button class="btn" style="padding: 5px; width: 100%" type="button" onclick="return upgradeStreamUrisToFavourites();">Convert StreamUris</button>'
|
||||
tmp = '<button class="btn" style="padding: 5px; width: 100%" type="button" onclick="return upgradeStreamUrisToFavourites();">Convert StreamUris</button>';
|
||||
}
|
||||
if (favourites.tracks) {
|
||||
var child = '';
|
||||
|
||||
@ -128,20 +128,20 @@ function scrollToTracklist() {
|
||||
function getArtist(pl) {
|
||||
for (var i = 0; i < pl.length; i++) {
|
||||
for (var j = 0; j < pl[i].artists.length; j++) {
|
||||
if (pl[i].artists[j].name != '') {
|
||||
if (pl[i].artists[j].name !== '') {
|
||||
return pl[i].artists[j].name;
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
//A hack to find the first album of a playlist. this is not yet returned by mopidy
|
||||
function getAlbum(pl) {
|
||||
for (var i = 0; i < pl.length; i++) {
|
||||
if (pl[i].album.name != '') {
|
||||
if (pl[i].album.name !== '') {
|
||||
return pl[i].album.name;
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
function artistsToString(artists, max) {
|
||||
@ -170,7 +170,7 @@ function albumTracksToTable(pl, target, uri) {
|
||||
popupData[pl[i].uri] = pl[i];
|
||||
liID = targetmin + '-' + pl[i].uri;
|
||||
tmp += renderSongLi(pl[i], liID, uri);
|
||||
};
|
||||
}
|
||||
tmp += '</ul>';
|
||||
$(target).html(tmp);
|
||||
$(target).attr('data', uri);
|
||||
@ -178,7 +178,7 @@ function albumTracksToTable(pl, target, uri) {
|
||||
|
||||
function renderSongLi(song, liID, uri) {
|
||||
var name;
|
||||
if (!song.name || song.name == '') {
|
||||
if (!song.name || song.name === '') {
|
||||
name = uri.split('/');
|
||||
name = decodeURI(name[name.length - 1]);
|
||||
} else {
|
||||
@ -195,7 +195,7 @@ function renderSongLi(song, liID, uri) {
|
||||
|
||||
function renderQueueSongLi(song, liID, uri, tlid) {
|
||||
var name;
|
||||
if (!song.name || song.name == '') {
|
||||
if (!song.name || song.name === '') {
|
||||
name = uri.split('/');
|
||||
name = decodeURI(name[name.length - 1]);
|
||||
} else {
|
||||
@ -212,7 +212,7 @@ function renderQueueSongLi(song, liID, uri, tlid) {
|
||||
|
||||
function resultsToTables(results, target, uri) {
|
||||
if (!results) {
|
||||
return
|
||||
return;
|
||||
}
|
||||
var tlids = [];
|
||||
if (target == CURRENT_PLAYLIST_TABLE) {
|
||||
@ -249,7 +249,7 @@ function resultsToTables(results, target, uri) {
|
||||
results[i].album.name = '';
|
||||
}
|
||||
//create name if there is no one
|
||||
if (!results[i].name || results[i].name == '') {
|
||||
if (!results[i].name || results[i].name === '') {
|
||||
name = results[i].uri.split('/');
|
||||
results[i].name = decodeURI(name[name.length - 1]) || 'Track ' + String(i);
|
||||
}
|
||||
@ -269,11 +269,11 @@ function resultsToTables(results, target, uri) {
|
||||
newtlids = [];
|
||||
nextname = '';
|
||||
} else {
|
||||
if ((results[i].album.name != nextname) || (nextname == '')) {
|
||||
if ((results[i].album.name != nextname) || (nextname === '')) {
|
||||
tableid = 'art' + i;
|
||||
//render differently if only one track in the album
|
||||
if (newalbum.length == 1) {
|
||||
if (i != 0) {
|
||||
if (i !== 0) {
|
||||
html += '<li class="smalldivider"> </li>';
|
||||
}
|
||||
iconClass = getMediaClass(newalbum[0].uri);
|
||||
@ -303,7 +303,7 @@ function resultsToTables(results, target, uri) {
|
||||
}
|
||||
}
|
||||
}
|
||||
if (newalbum[0].album.name != '') {
|
||||
if (newalbum[0].album.name !== '') {
|
||||
html += ' / ';
|
||||
}
|
||||
html += '<em>' + newalbum[0].album.name + '</em></p>';
|
||||
@ -387,7 +387,7 @@ function playlisttotable(pl, target, uri) {
|
||||
child += '</a></li>';
|
||||
tmp += child;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
$(target).html(tmp);
|
||||
$(target).attr('data', uri);
|
||||
@ -415,7 +415,7 @@ function getUris(tracks) {
|
||||
function getTracksFromUri(uri, full_track_data) {
|
||||
var returnTracksOrUris = function(tracks) {
|
||||
return (full_track_data || false) ? tracks : getUris(tracks);
|
||||
}
|
||||
};
|
||||
if (customTracklists[uri]) {
|
||||
return returnTracksOrUris(customTracklists[uri]);
|
||||
} else if (playlists[uri] && playlists[uri].tracks) {
|
||||
@ -483,7 +483,7 @@ function showOffline(on) {
|
||||
|
||||
// from http://dzone.com/snippets/validate-url-regexp
|
||||
function validUri(str) {
|
||||
var regexp = /^(mms|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/
|
||||
var regexp = /^(mms|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/;
|
||||
return regexp.test(str);
|
||||
}
|
||||
|
||||
|
||||
@ -9,9 +9,9 @@
|
||||
function resetSong() {
|
||||
setPlayState(false);
|
||||
setPosition(0);
|
||||
var data = new Object;
|
||||
var data = new Object({});
|
||||
data.tlid = -1;
|
||||
data.track = new Object;
|
||||
data.track = new Object({});
|
||||
data.track.name = '';
|
||||
data.track.artists = '';
|
||||
data.track.length = 0;
|
||||
@ -80,10 +80,10 @@ function setSongInfo(data) {
|
||||
// console.log(data, songdata);
|
||||
if (!data ) { return; }
|
||||
if (data.tlid == songdata.tlid) { return; }
|
||||
if (!data.track.name || data.track.name == '') {
|
||||
if (!data.track.name || data.track.name === '') {
|
||||
var name = data.track.uri.split('/');
|
||||
data.track.name = decodeURI(name[name.length - 1]);
|
||||
};
|
||||
}
|
||||
|
||||
updatePlayIcons(data.track.uri, data.tlid);
|
||||
artistshtml = '';
|
||||
@ -95,7 +95,7 @@ function setSongInfo(data) {
|
||||
if (rs && rs[1] == data.track.name) {
|
||||
data.track.name = (rs[0] || rs[1]);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
songdata = data;
|
||||
@ -103,7 +103,7 @@ function setSongInfo(data) {
|
||||
setSongTitle(data.track.name, false);
|
||||
songlength = Infinity;
|
||||
|
||||
if (!data.track.length || data.track.length == 0) {
|
||||
if (!data.track.length || data.track.length === 0) {
|
||||
$('#trackslider').next().find('.ui-slider-handle').hide();
|
||||
$('#trackslider').slider('disable');
|
||||
// $('#streamnameinput').val(data.track.name);
|
||||
@ -162,7 +162,7 @@ function closePopups() {
|
||||
|
||||
function popupTracks(e, listuri, trackuri, tlid) {
|
||||
if (!e)
|
||||
var e = window.event;
|
||||
e = window.event;
|
||||
$('.popupTrackName').html(popupData[trackuri].name);
|
||||
$('.popupAlbumName').html(popupData[trackuri].album.name);
|
||||
var child = "";
|
||||
@ -191,18 +191,19 @@ function popupTracks(e, listuri, trackuri, tlid) {
|
||||
|
||||
var hash = document.location.hash.split('?');
|
||||
var divid = hash[0].substr(1);
|
||||
var popupName = '';
|
||||
if (divid == 'current') {
|
||||
$(".addqueue").hide();
|
||||
var popupName = '#popupQueue';
|
||||
popupName = '#popupQueue';
|
||||
} else if (divid == 'browse') {
|
||||
$(".addqueue").show();
|
||||
var popupName = '#popupBrowse';
|
||||
popupName = '#popupBrowse';
|
||||
} else {
|
||||
$(".addqueue").show();
|
||||
var popupName = '#popupTracks';
|
||||
popupName = '#popupTracks';
|
||||
}
|
||||
|
||||
if (typeof tlid != 'undefined' && tlid != '') {
|
||||
if (typeof tlid != 'undefined' && tlid !== '') {
|
||||
$(popupName).data("list", listuri).data("track", trackuri).data("tlid", tlid).popup("open", {
|
||||
x : e.pageX,
|
||||
y : e.pageY
|
||||
@ -259,15 +260,15 @@ function initSocketevents() {
|
||||
});
|
||||
|
||||
mopidy.on("event:volumeChanged", function(data) {
|
||||
setVolume(data["volume"]);
|
||||
setVolume(data.volume);
|
||||
});
|
||||
|
||||
mopidy.on("event:muteChanged", function(data) {
|
||||
setMute(data["mute"]);
|
||||
setMute(data.mute);
|
||||
});
|
||||
|
||||
mopidy.on("event:playbackStateChanged", function(data) {
|
||||
switch (data["new_state"]) {
|
||||
switch (data.new_state) {
|
||||
case "paused":
|
||||
case "stopped":
|
||||
setPlayState(false);
|
||||
@ -283,14 +284,14 @@ function initSocketevents() {
|
||||
});
|
||||
|
||||
mopidy.on("event:seeked", function(data) {
|
||||
setPosition(parseInt(data["time_position"]));
|
||||
setPosition(parseInt(data.time_position));
|
||||
if (play) {
|
||||
startProgressTimer();
|
||||
}
|
||||
});
|
||||
|
||||
mopidy.on("event:streamTitleChanged", function(data) {
|
||||
setSongTitle(data["title"], true);
|
||||
setSongTitle(data.title, true);
|
||||
});
|
||||
}
|
||||
|
||||
@ -331,7 +332,7 @@ function toggleFullscreen() {
|
||||
|
||||
function isFullscreen() {
|
||||
return (document.fullscreenElement || // alternative standard method
|
||||
document.mozFullScreenElement || document.webkitFullscreenElement || document.msFullscreenElement ) // current working methods
|
||||
document.mozFullScreenElement || document.webkitFullscreenElement || document.msFullscreenElement ); // current working methods
|
||||
}
|
||||
|
||||
function switchContent(divid, uri) {
|
||||
@ -345,8 +346,8 @@ function switchContent(divid, uri) {
|
||||
function setHeadline(site){
|
||||
site = site.trim();
|
||||
str = $('.mainNav').find('a[href$='+site+']').text();
|
||||
if(str == ""){
|
||||
str = site.charAt(0).toUpperCase() + site.slice(1);;
|
||||
if(str === ""){
|
||||
str = site.charAt(0).toUpperCase() + site.slice(1);
|
||||
}
|
||||
$('#contentHeadline').html('<a href="#home" onclick="switchContent(\'home\'); return false;">' + str + '</a>');
|
||||
}
|
||||
@ -365,7 +366,7 @@ function updateStatusOfAll() {
|
||||
mopidy.playback.getTimePosition().then(processCurrentposition, console.error);
|
||||
mopidy.playback.getState().then(processPlaystate, console.error);
|
||||
|
||||
updateOptions()
|
||||
updateOptions();
|
||||
|
||||
mopidy.playback.getVolume().then(processVolume, console.error);
|
||||
mopidy.mixer.getMute().then(processMute, console.error);
|
||||
@ -409,7 +410,7 @@ function locationHashChanged() {
|
||||
case 'search':
|
||||
$('#navsearch a').addClass($.mobile.activeBtnClass);
|
||||
$("#searchinput").focus();
|
||||
if (customTracklists['mbw:allresultscache'] == '') {
|
||||
if (customTracklists['mbw:allresultscache'] === '') {
|
||||
initSearch($('#searchinput').val());
|
||||
}
|
||||
break;
|
||||
@ -417,12 +418,12 @@ function locationHashChanged() {
|
||||
$('#navstream a').addClass('ui-state-active ui-state-persist ui-btn-active');
|
||||
break;
|
||||
case 'artists':
|
||||
if (uri != '') {
|
||||
if (uri !== '') {
|
||||
showArtist(uri);
|
||||
}
|
||||
break;
|
||||
case 'albums':
|
||||
if (uri != '') {
|
||||
if (uri !== '') {
|
||||
showAlbum(uri);
|
||||
}
|
||||
break;
|
||||
@ -508,11 +509,13 @@ $(document).ready(function(event) {
|
||||
|
||||
//navigation temporary, rewrite this!
|
||||
$('#songinfo').click(
|
||||
function()
|
||||
{return switchContent('nowPlaying')} );
|
||||
function() {
|
||||
return switchContent('nowPlaying');
|
||||
});
|
||||
$('#controlspopupimage').click(
|
||||
function() {
|
||||
return switchContent('current')} );
|
||||
return switchContent('current');
|
||||
});
|
||||
$('#navToggleFullscreen').click(function(){
|
||||
toggleFullscreen();
|
||||
});
|
||||
|
||||
@ -72,7 +72,7 @@ function getCoverFromLastFm(track, images, size) {
|
||||
lastfm.album.getInfo( {artist: artistname, album: albumname},
|
||||
{ success: function(data) {
|
||||
for (var i = 0; i < data.album.image.length; i++) {
|
||||
if ( data.album.image[i]['size'] == size) {
|
||||
if ( data.album.image[i].size == size) {
|
||||
$(images).attr('src', data.album.image[i]['#text'] || defUrl);
|
||||
}
|
||||
}
|
||||
@ -84,7 +84,7 @@ function getArtistImage(nwartist, image, size) {
|
||||
var defUrl = 'images/user_24x32.png';
|
||||
lastfm.artist.getInfo({artist: nwartist}, {success: function(data){
|
||||
for (var i = 0; i < data.artist.image.length; i++) {
|
||||
if ( data.artist.image[i]['size'] == size) {
|
||||
if ( data.artist.image[i].size == size) {
|
||||
$(image).attr('src', data.artist.image[i]['#text'] || defUrl);
|
||||
}
|
||||
}
|
||||
|
||||
@ -76,8 +76,8 @@ function processPlaystate(data) {
|
||||
* process results of a browse list
|
||||
*********************************************************/
|
||||
function processBrowseDir(resultArr) {
|
||||
var backHtml = '<li style="background-color:#ccc"><a href="#" onclick="return getBrowseDir();"><h1 class="trackname"><i class="fa fa-arrow-circle-left"></i> Back</h1></a></li>'
|
||||
if ( (!resultArr) || (resultArr == '') || (resultArr.length == 0) ) {
|
||||
var backHtml = '<li style="background-color:#ccc"><a href="#" onclick="return getBrowseDir();"><h1 class="trackname"><i class="fa fa-arrow-circle-left"></i> Back</h1></a></li>';
|
||||
if ( (!resultArr) || (resultArr === '') || (resultArr.length === 0) ) {
|
||||
$('#browsepath').html('No tracks found...');
|
||||
$('#browselist').html(backHtml);
|
||||
showLoading(false);
|
||||
@ -124,7 +124,7 @@ function processBrowseDir(resultArr) {
|
||||
'<i class="fa fa-ellipsis-v"></i></a>' +
|
||||
'<a href="#" class="browsetrack" onclick="return playBrowsedTracks(PLAY_ALL, ' + index + ');" id="' + resultArr[i].uri +
|
||||
'"><h1 class="trackname"><i class="' + iconClass + '"></i> ' + resultArr[i].name + '</h1></a></li>';
|
||||
index++
|
||||
index++;
|
||||
} else {
|
||||
if (browseStack.length > 0) {
|
||||
iconClass="fa fa-folder-o";
|
||||
@ -152,7 +152,7 @@ function processBrowseDir(resultArr) {
|
||||
* process results of list of playlists of the user
|
||||
*********************************************************/
|
||||
function processGetPlaylists(resultArr) {
|
||||
if ((!resultArr) || (resultArr == '')) {
|
||||
if ((!resultArr) || (resultArr === '')) {
|
||||
$('#playlistslist').empty();
|
||||
return;
|
||||
}
|
||||
@ -167,7 +167,7 @@ function processGetPlaylists(resultArr) {
|
||||
} else {
|
||||
tmp = tmp + li_html + '<i class="' + getMediaClass(resultArr[i].uri) + '"></i> ' + resultArr[i].name + '</a></li>';
|
||||
}
|
||||
};
|
||||
}
|
||||
// Prepend the user's Spotify "Starred" playlist and favourites to the results. (like Spotify official client).
|
||||
tmp = favourites + starred + tmp;
|
||||
$('#playlistslist').html(tmp);
|
||||
@ -179,12 +179,12 @@ function processGetPlaylists(resultArr) {
|
||||
* process results of a returned list of playlist track refs
|
||||
*********************************************************/
|
||||
function processPlaylistItems(resultDict) {
|
||||
if (resultDict.items.length == 0) {
|
||||
if (resultDict.items.length === 0) {
|
||||
console.log('Playlist', resultDict.uri, 'is empty');
|
||||
showLoading(false);
|
||||
return;
|
||||
}
|
||||
var trackUris = []
|
||||
var trackUris = [];
|
||||
for (i = 0; i < resultDict.items.length; i++) {
|
||||
trackUris.push(resultDict.items[i].uri);
|
||||
}
|
||||
@ -198,7 +198,6 @@ function processPlaylistItems(resultDict) {
|
||||
showLoading(false);
|
||||
return playlists[newplaylisturi].tracks;
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
||||
/********************************************************
|
||||
@ -215,7 +214,7 @@ function processCurrentPlaylist(resultArr) {
|
||||
* process results of an artist lookup
|
||||
*********************************************************/
|
||||
function processArtistResults(resultArr) {
|
||||
if (!resultArr || (resultArr.length == 0)) {
|
||||
if (!resultArr || (resultArr.length === 0)) {
|
||||
$('#h_artistname').text('Artist not found...');
|
||||
getCover('', '#artistviewimage, #artistpopupimage', 'extralarge');
|
||||
showLoading(false);
|
||||
@ -234,7 +233,7 @@ function processArtistResults(resultArr) {
|
||||
* process results of an album lookup
|
||||
*********************************************************/
|
||||
function processAlbumResults(resultArr) {
|
||||
if (!resultArr || (resultArr.length == 0)) {
|
||||
if (!resultArr || (resultArr.length === 0)) {
|
||||
$('#h_albumname').text('Album not found...');
|
||||
getCover('', '#albumviewcover, #coverpopupimage', 'extralarge');
|
||||
showLoading(false);
|
||||
|
||||
@ -3,8 +3,8 @@ var progressElement = document.getElementById('trackslider');
|
||||
var positionNode = document.createTextNode('');
|
||||
var durationNode = document.createTextNode('');
|
||||
|
||||
var START_BEATS = 5 // 0.5 seconds, needs to be less than 1s to prevent unwanted updates.
|
||||
var RUN_BEATS = 300 // 30 seconds assuming default timer update rate of 100ms
|
||||
var START_BEATS = 5; // 0.5 seconds, needs to be less than 1s to prevent unwanted updates.
|
||||
var RUN_BEATS = 300; // 30 seconds assuming default timer update rate of 100ms
|
||||
var callbackHeartbeats = 0; // Timer will check syncs on every n-number of calls.
|
||||
var targetPosition = null;
|
||||
|
||||
@ -19,7 +19,7 @@ document.getElementById('songlength').appendChild(durationNode);
|
||||
function timerCallback(position, duration, isRunning) {
|
||||
updateTimers(position, duration, isRunning);
|
||||
|
||||
if (callbackHeartbeats == 0) {
|
||||
if (callbackHeartbeats === 0) {
|
||||
callbackHeartbeats = getHeartbeat();
|
||||
}
|
||||
|
||||
@ -38,7 +38,7 @@ function timerCallback(position, duration, isRunning) {
|
||||
}
|
||||
|
||||
function updateTimers(position, duration, isRunning) {
|
||||
var ready = !(duration == Infinity && position == 0 && !isRunning); // Timer has been properly initialized.
|
||||
var ready = !(duration == Infinity && position === 0 && !isRunning); // Timer has been properly initialized.
|
||||
var streaming = (duration == Infinity && position > 0); // Playing a stream.
|
||||
var ok = synced && isRunning; // Normal operation.
|
||||
var syncing = !synced && isRunning; // Busy syncing.
|
||||
@ -59,7 +59,7 @@ function updateTimers(position, duration, isRunning) {
|
||||
positionNode.nodeValue = '(sync)';
|
||||
}
|
||||
} else if (synced || streaming) {
|
||||
positionNode.nodeValue = format(position);;
|
||||
positionNode.nodeValue = format(position);
|
||||
}
|
||||
}
|
||||
|
||||
@ -71,10 +71,10 @@ function updateTimers(position, duration, isRunning) {
|
||||
}
|
||||
|
||||
function getHeartbeat() {
|
||||
if (syncsLeft > 0 && callbackHeartbeats == 0) {
|
||||
if (syncsLeft > 0 && callbackHeartbeats === 0) {
|
||||
// Step back exponentially while increasing heartbeat.
|
||||
return Math.round(delay_exponential(5, 2, MAX_SYNCS - syncsLeft));
|
||||
} else if (syncsLeft == 0 && callbackHeartbeats == 0) {
|
||||
} else if (syncsLeft === 0 && callbackHeartbeats === 0) {
|
||||
// Sync completed, keep checking using maximum number of heartbeats.
|
||||
return RUN_BEATS;
|
||||
} else {
|
||||
@ -111,7 +111,7 @@ function toInt(value) {
|
||||
function format(milliseconds) {
|
||||
if (milliseconds === Infinity) {
|
||||
return '(n/a)';
|
||||
} else if (milliseconds == 0) {
|
||||
} else if (milliseconds === 0) {
|
||||
return '0:00';
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user