}
}
],
+ "quotes": "off",
"@typescript-eslint/indent": [
"error",
2,
"@typescript-eslint/dot-notation": "off",
"@typescript-eslint/method-signature-style": "off",
"@typescript-eslint/no-base-to-string": "off",
- "@typescript-eslint/quotes": "off",
+ "@typescript-eslint/quotes": [
+ "error",
+ "single",
+ {
+ "avoidEscape": true,
+ "allowTemplateLiterals": true
+ }
+ ],
"@typescript-eslint/no-var-requires": "off",
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/promise-function-async": "off",
-import { ActivityType } from "@shared/models"
+import { ActivityType } from '@shared/models'
function getAPId (object: string | { id: string }) {
if (typeof object === 'string') return object
body('signup.enabled').isBoolean().withMessage('Should have a valid signup enabled boolean'),
body('signup.limit').isInt().withMessage('Should have a valid signup limit'),
body('signup.requiresEmailVerification').isBoolean().withMessage('Should have a valid requiresEmailVerification boolean'),
- body('signup.minimumAge').isInt().withMessage("Should have a valid minimum age required"),
+ body('signup.minimumAge').isInt().withMessage('Should have a valid minimum age required'),
body('admin.email').isEmail().withMessage('Should have a valid administrator email'),
body('contactForm.enabled').isBoolean().withMessage('Should have a valid contact form enabled boolean'),
body('user.videoQuota').custom(isUserVideoQuotaValid).withMessage('Should have a valid video quota'),
body('user.videoQuotaDaily').custom(isUserVideoQuotaDailyValid).withMessage('Should have a valid daily video quota'),
- body('videoChannels.maxPerUser').isInt().withMessage("Should have a valid maximum amount of video channels per user"),
+ body('videoChannels.maxPerUser').isInt().withMessage('Should have a valid maximum amount of video channels per user'),
body('transcoding.enabled').isBoolean().withMessage('Should have a valid transcoding enabled boolean'),
body('transcoding.allowAdditionalExtensions').isBoolean().withMessage('Should have a valid additional extensions boolean'),
await waitJobs(servers)
const body = await commands[1].getAdminList()
- expect(body.total).to.equal(2, "wrong number of videos returned")
- expect(body.data).to.have.lengthOf(2, "wrong number of videos returned")
+ expect(body.total).to.equal(2, 'wrong number of videos returned')
+ expect(body.data).to.have.lengthOf(2, 'wrong number of videos returned')
const abuse = body.data[0]
- expect(abuse.id).to.equal(abuseServer2.id, "wrong origin server id for first video")
- expect(abuse.video.id).to.equal(abuseServer2.video.id, "wrong video id")
+ expect(abuse.id).to.equal(abuseServer2.id, 'wrong origin server id for first video')
+ expect(abuse.video.id).to.equal(abuseServer2.video.id, 'wrong video id')
expect(abuse.video.channel).to.exist
expect(abuse.video.deleted).to.be.true
})
const abuseVideo3 = body.data.find(a => a.video.id === video3Id)
expect(abuseVideo3).to.not.be.undefined
- expect(abuseVideo3.video.countReports).to.equal(1, "wrong reports count for video 3")
- expect(abuseVideo3.video.nthReport).to.equal(1, "wrong report position in report list for video 3")
- expect(abuseVideo3.countReportsForReportee).to.equal(1, "wrong reports count for reporter on video 3 abuse")
- expect(abuseVideo3.countReportsForReporter).to.equal(3, "wrong reports count for reportee on video 3 abuse")
+ expect(abuseVideo3.video.countReports).to.equal(1, 'wrong reports count for video 3')
+ expect(abuseVideo3.video.nthReport).to.equal(1, 'wrong report position in report list for video 3')
+ expect(abuseVideo3.countReportsForReportee).to.equal(1, 'wrong reports count for reporter on video 3 abuse')
+ expect(abuseVideo3.countReportsForReporter).to.equal(3, 'wrong reports count for reportee on video 3 abuse')
const abuseServer1 = abuses.find(a => a.video.id === servers[0].store.videoCreated.id)
- expect(abuseServer1.countReportsForReportee).to.equal(3, "wrong reports count for reporter on video 1 abuse")
+ expect(abuseServer1.countReportsForReportee).to.equal(3, 'wrong reports count for reporter on video 1 abuse')
}
})
{
const abuse = body.data.find(a => a.id === createRes.abuse.id)
expect(abuse.reason).to.equals(reason5)
- expect(abuse.predefinedReasons).to.deep.equals(predefinedReasons5, "predefined reasons do not match the one reported")
+ expect(abuse.predefinedReasons).to.deep.equals(predefinedReasons5, 'predefined reasons do not match the one reported')
expect(abuse.video.startAt).to.equal(1, "starting timestamp doesn't match the one reported")
expect(abuse.video.endAt).to.equal(5, "ending timestamp doesn't match the one reported")
}
{
const body = await servers[0].subscriptions.listVideos({ token: userAccessToken })
- expect(body.total).to.equal(2, "there should be 2 videos part of the subscription")
+ expect(body.total).to.equal(2, 'there should be 2 videos part of the subscription')
const query = { accountId: userAccountId, token: userFeedToken }
const json = await servers[0].feed.getJSON({ feed: 'subscriptions', query, ignoreCache: true })
.option('--last <last>', 'Process last n elements of returned playlist')
.option('--wait-interval <waitInterval>', 'Duration between two video imports (in seconds)', convertIntoMs)
.option('-T, --tmpdir <tmpdir>', 'Working directory', __dirname)
- .usage("[global options] [ -- youtube-dl options]")
+ .usage('[global options] [ -- youtube-dl options]')
.parse(process.argv)
const options = command.opts()
for (const [ index, info ] of infoArray.entries()) {
try {
if (index > 0 && options.waitInterval && !skipInterval) {
- log.info("Wait for %d seconds before continuing.", options.waitInterval / 1000)
+ log.info('Wait for %d seconds before continuing.', options.waitInterval / 1000)
await wait(options.waitInterval)
}