Skip to content

Commit

Permalink
fix: basic eslint warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
adrienjoly committed Dec 23, 2023
1 parent bcf0f18 commit 2a38d20
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 33 deletions.
4 changes: 2 additions & 2 deletions public/js/feed-trackorder.js
Expand Up @@ -21,15 +21,15 @@ const init = function () {
success: function (res) {
cb(res);
},
error: function (e) {
error: function () {
cb();
},
});
}

$('#playlistTrackOrderSubmit').click(function () {
const order = [];
const posts = $('.post').each(function () {
$('.post').each(function () {
order.push($(this).attr('data-pid'));
});
submitTrackOrder(plId, order, function (res) {
Expand Down
24 changes: 0 additions & 24 deletions public/js/hotTracks.js
Expand Up @@ -164,20 +164,6 @@ global.timeAgoWithString = function (timestamp) {
{ 'year(s)': 12 },
];

const padNumber = function (str, n) {
let ret = '' + str;
while (ret.length < n) {
// pad with leading zeroes
ret = '0' + ret;
}
return ret;
};

const renderTime = function (t) {
var t = new Date(t);
return t.getHours() + ':' + padNumber(t.getMinutes(), 2);
};

const renderTimestamp = function (timestamp) {
let t = timestamp / 1000,
lastScale = 'second(s)';
Expand All @@ -201,16 +187,6 @@ global.timeAgoWithString = function (timestamp) {
return MONTHS_SHORT[t.getMonth()] + (sameYear ? '' : ' ' + t.getFullYear());
};

let date = new Date(timestamp);
date =
renderTime(date) +
' - ' +
date.getDate() +
' ' +
MONTHS_SHORT[date.getMonth()] +
' ' +
date.getFullYear();

let ago = new Date() - timestamp;
if (ago < 1000 * 60 * 60 * 24 * 32) {
ago = renderTimestamp(ago);
Expand Down
4 changes: 2 additions & 2 deletions public/js/playem-youtube-iframe-patch.js
Expand Up @@ -52,7 +52,7 @@ function YoutubeIframePlayer() {
this.safeClientCall('onApiReady', this);
}

Player.prototype.safeCall = function (fctName, param) {
Player.prototype.safeCall = function (fctName) {
if (!this.iframeReady)
return console.warn('YT-iframe not ready => ignoring call to', fctName);
try {
Expand Down Expand Up @@ -137,7 +137,7 @@ function YoutubeIframePlayer() {
}
};

Player.prototype.getTrackPosition = function (callback) {
Player.prototype.getTrackPosition = function () {
this.safeCall('getTrackPosition'); // -> will call onTrackInfo()
};

Expand Down
4 changes: 2 additions & 2 deletions public/js/playem-youtube-iframe.js
Expand Up @@ -37,7 +37,7 @@ function YoutubeIframePlayer() {
this.safeClientCall('onApiReady', this);
}

Player.prototype.safeCall = function (fctName, param) {
Player.prototype.safeCall = function (fctName) {
if (!this.iframeReady)
return console.warn('YT-iframe not ready => ignoring call to', fctName);
try {
Expand Down Expand Up @@ -117,7 +117,7 @@ function YoutubeIframePlayer() {
this.embedVars.playerContainer.removeChild(this.iframe);
};

Player.prototype.getTrackPosition = function (callback) {
Player.prototype.getTrackPosition = function () {
this.safeCall('getTrackPosition'); // -> will call onTrackInfo()
};

Expand Down
1 change: 0 additions & 1 deletion test/api/auth.api.tests.js
Expand Up @@ -9,7 +9,6 @@ const get = promisify(apiClient.get);
const logout = promisify(apiClient.logout);
const loginAs = promisify(apiClient.loginAs);
const signupAs = promisify(apiClient.signupAs);
const getUser = promisify(apiClient.getUser);

const genSecureUser = (() => {
let globalNumber = 0;
Expand Down
2 changes: 1 addition & 1 deletion test/api/playlist.api.tests.js
Expand Up @@ -2,7 +2,7 @@ const assert = require('assert');
const util = require('util');
const request = require('request');

const { URL_PREFIX, DUMMY_USER } = require('../fixtures.js');
const { DUMMY_USER } = require('../fixtures.js');
const { ObjectId } = require('../approval-tests-helpers.js');
const api = require('../api-client.js');
const { OpenwhydTestEnv } = require('../OpenwhydTestEnv.js');
Expand Down
2 changes: 1 addition & 1 deletion test/approval/routes/routes.approval.tests.js
Expand Up @@ -39,7 +39,7 @@ test.before(async (t) => {
testDataCollections.user.find(({ _id }) => id === _id.toString());
});

test.after(async (t) => {
test.after(async () => {
if (!DONT_KILL) await openwhyd.release();
});

Expand Down

0 comments on commit 2a38d20

Please sign in to comment.