Skip to content

Commit bb03f55

Browse files
authored
Merge pull request #463 from mayeaux/fix-ci
Fix ci
2 parents ca56174 + 3b9efa2 commit bb03f55

File tree

10 files changed

+116
-15810
lines changed

10 files changed

+116
-15810
lines changed

caching/cachePopularUploads.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ async function getPopularUploads(){
2424

2525
if(logCaching == 'true'){
2626
c.l('Beginning caching popular uploads, getting popular uploads from db');
27-
console.log(moment(new Date).format('hh:mm:ss A'))
27+
console.log(moment(new Date).format('hh:mm:ss A'));
2828
}
2929

3030
// TODO: have to have a job to update upload's view amounts
@@ -63,17 +63,17 @@ async function setPopularUploads(){
6363

6464
let formattedPopularUploads = [];
6565

66-
console.log(moment(new Date).format('hh:mm:ss A'))
66+
console.log(moment(new Date).format('hh:mm:ss A'));
6767

6868
for(const upload of popularUploads){
69-
const uploadViews = await View.find({ upload, validity: 'real' }).select('createdAt')
69+
const uploadViews = await View.find({ upload, validity: 'real' }).select('createdAt');
7070

7171
formattedPopularUploads.push(calculateViewsByPeriod(upload, uploadViews));
7272
}
7373

7474
if(logCaching == 'true'){
7575
c.l('Popular uploads have been calculated according to view periods');
76-
console.log(moment(new Date).format('hh:mm:ss A'))
76+
console.log(moment(new Date).format('hh:mm:ss A'));
7777
}
7878

7979
// build json objects representing uploads

caching/cacheRecentUploads.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const logCaching = process.env.LOG_CACHING;
2323
async function getRecentUploads(){
2424

2525
if(logCaching == 'true'){
26-
console.log(`Beginning running recent uploads`);
26+
console.log('Beginning running recent uploads');
2727

2828
}
2929

@@ -67,8 +67,8 @@ async function getRecentUploads(){
6767
async function setRecentUploads(){
6868
let recentUploads = await getRecentUploads();
6969

70-
console.log(`Calculating view amounts`);
71-
console.log(moment(new Date).format('hh:mm:ss A'))
70+
console.log('Calculating view amounts');
71+
console.log(moment(new Date).format('hh:mm:ss A'));
7272

7373
// calculate view periods for each upload
7474
recentUploads = await Promise.all(recentUploads.map(async function(upload){

caching/calculateUploadViews.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ async function calculateViewAmounts(){
2424

2525
if(logCaching == 'true'){
2626
c.l('Calculating view amounts for particular videos');
27-
console.log(moment(new Date).format('hh:mm:ss A'))
27+
console.log(moment(new Date).format('hh:mm:ss A'));
2828
}
2929

3030
// TODO: have to have a job to update upload's view amounts
@@ -51,7 +51,7 @@ async function calculateViewAmounts(){
5151

5252
if(logCaching == 'true'){
5353
c.l('View amounts calculated');
54-
console.log(moment(new Date).format('hh:mm:ss A'))
54+
console.log(moment(new Date).format('hh:mm:ss A'));
5555
}
5656

5757
// if(logCaching == 'true'){

caching/runCaching.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ const dotenv = require('dotenv');
33
const logCaching = process.env.LOG_CACHING;
44
const jsHelpers = require('../lib/helpers/js-helpers');
55

6-
function sleep(ms) {
6+
function sleep(ms){
77
return new Promise(resolve => setTimeout(resolve, ms));
88
}
99

@@ -116,19 +116,19 @@ console.log(`CACHE TOTAL VIEW INTERVAL IN MINUTES: ${cacheIntervalInMinutes} \n`
116116
async function runRecentInterval(){
117117
// calculate and cache recent uploads every minute
118118
await cacheOnlyRecentUploads();
119-
await sleep(cacheRecentIntervalInMs)
119+
await sleep(cacheRecentIntervalInMs);
120120
runRecentInterval();
121121
}
122122

123123
runRecentInterval();
124124

125125
async function runOtherCaching(){
126126
await cachePopularDailyStatsAndIndex();
127-
await sleep(cacheIntervalInMs)
128-
runOtherCaching()
127+
await sleep(cacheIntervalInMs);
128+
runOtherCaching();
129129
}
130130

131-
runOtherCaching()
131+
runOtherCaching();
132132

133133
// async function main(){
134134
//

controllers/backend/internalApi.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,10 @@ if(akismetApiKey){
5454
const siteUrl = domainNameAndTLD;
5555
akismetClient = new AkismetClient({ key: akismetApiKey, blog: siteUrl });
5656

57-
(async function() {
57+
(async function(){
5858
const isValid = await akismetClient.verifyKey();
5959

60-
if (isValid){
60+
if(isValid){
6161
console.log('Spam blocking turned on with valid key');
6262
} else {
6363
console.log('Spam blocking turned on but with invalid key');
@@ -884,9 +884,9 @@ exports.postComment = async(req, res) => {
884884
name: req.user.channelName || req.user.channelUrl
885885
};
886886

887-
const isSpam = await akismetClient.checkSpam(commentCheck)
887+
const isSpam = await akismetClient.checkSpam(commentCheck);
888888

889-
if (isSpam){
889+
if(isSpam){
890890
// create and save comment
891891
let comment = new Comment({
892892
text: req.body.comment,
@@ -899,7 +899,7 @@ exports.postComment = async(req, res) => {
899899
await comment.save();
900900

901901
res.status(500);
902-
console.log('Spam comment detected')
902+
console.log('Spam comment detected');
903903
return res.send('problem-processing-comment');
904904
}
905905
}
@@ -985,7 +985,6 @@ exports.postComment = async(req, res) => {
985985
timeAgo
986986
};
987987

988-
989988
res.json(responseObject);
990989

991990
// res.send('success')

controllers/backend/uploading.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -501,7 +501,6 @@ exports.postFileUpload = async(req, res) => {
501501

502502
console.log('done moving file');
503503

504-
505504
/** BASIC VIDEO PROCESSING COMPLETED, CHECKING IF NEEDS CONVERSION **/
506505

507506
const specificMatches = ( codecName == 'hevc' || codecProfile == 'High 4:4:4 Predictive' );
@@ -639,13 +638,13 @@ exports.postFileUpload = async(req, res) => {
639638
if(upload.fileType === 'video'){
640639
// will automatically stick it at /uploads/$channelUrl/$uniqueTag_sprite.png and /$uniqueTag_sprite.vtt
641640
(async function(){
642-
if(user.plan === 'plus') {
643-
await createSpriteImageAndVtt(channelUrl, uniqueTag, fileInDirectory)
641+
if(user.plan === 'plus'){
642+
await createSpriteImageAndVtt(channelUrl, uniqueTag, fileInDirectory);
644643

645644
upload.hasPreviewSpriteThumbnail = true;
646645
await upload.save();
647646
}
648-
})()
647+
})();
649648
}
650649
});
651650

controllers/frontend/admin.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -219,17 +219,17 @@ exports.getComments = async(req, res) => {
219219

220220
const { startingNumber, previousNumber, nextNumber, numbersArray } = pagination.buildPaginationObject(page);
221221

222-
let { visibility } = req.query;
222+
let{ visibility } = req.query;
223223

224-
if(!visibility) visibility = 'all'
224+
if(!visibility) visibility = 'all';
225225

226226
let searchQuery = {};
227227

228228
if(visibility !== 'all'){
229229
searchQuery.visibility = visibility;
230230
}
231231

232-
console.log('visibility')
232+
console.log('visibility');
233233
console.log(visibility);
234234

235235
try {

0 commit comments

Comments
 (0)