From df1966c9b48fd3cb3e0ec227bac97065d0122d78 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 24 Nov 2017 15:00:10 +0100 Subject: Fix lint --- server/lib/activitypub/send/misc.ts | 4 ++-- .../activitypub-http-job-scheduler/activitypub-http-job-scheduler.ts | 2 +- server/models/video/video.ts | 2 ++ server/tests/api/single-server.ts | 4 ++-- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/server/lib/activitypub/send/misc.ts b/server/lib/activitypub/send/misc.ts index fe137464e..444c1cbd6 100644 --- a/server/lib/activitypub/send/misc.ts +++ b/server/lib/activitypub/send/misc.ts @@ -29,7 +29,7 @@ async function forwardActivity ( if (uris.length === 0) { logger.info('0 followers for %s, no forwarding.', toAccountFollowers.map(a => a.id).join(', ')) - return + return undefined } logger.debug('Creating forwarding job.', { uris }) @@ -52,7 +52,7 @@ async function broadcastToFollowers ( const uris = await computeFollowerUris(toAccountFollowers, followersException) if (uris.length === 0) { logger.info('0 followers for %s, no broadcasting.', toAccountFollowers.map(a => a.id).join(', ')) - return + return undefined } logger.debug('Creating broadcast job.', { uris }) diff --git a/server/lib/jobs/activitypub-http-job-scheduler/activitypub-http-job-scheduler.ts b/server/lib/jobs/activitypub-http-job-scheduler/activitypub-http-job-scheduler.ts index f1fe774cc..fcc81eb16 100644 --- a/server/lib/jobs/activitypub-http-job-scheduler/activitypub-http-job-scheduler.ts +++ b/server/lib/jobs/activitypub-http-job-scheduler/activitypub-http-job-scheduler.ts @@ -50,7 +50,7 @@ async function computeBody (payload: ActivityPubHttpPayload) { if (!accountSignature) throw new Error('Unknown signature account id.') body = await buildSignedActivity(accountSignature, payload.body) } - + return body } diff --git a/server/models/video/video.ts b/server/models/video/video.ts index 82b95c489..457bfce77 100644 --- a/server/models/video/video.ts +++ b/server/models/video/video.ts @@ -984,6 +984,7 @@ loadByUUIDOrURL = function (uuid: string, url: string, t?: Sequelize.Transaction loadAndPopulateAccountAndServerAndTags = function (id: number) { const options = { + order: [ [ Video['sequelize'].models.Tag, 'name', 'ASC' ] ], include: [ { model: Video['sequelize'].models.VideoChannel, @@ -1012,6 +1013,7 @@ loadAndPopulateAccountAndServerAndTags = function (id: number) { loadByUUIDAndPopulateAccountAndServerAndTags = function (uuid: string) { const options = { + order: [ [ Video['sequelize'].models.Tag, 'name', 'ASC' ] ], where: { uuid }, diff --git a/server/tests/api/single-server.ts b/server/tests/api/single-server.ts index 11080085d..40e2c64fe 100644 --- a/server/tests/api/single-server.ts +++ b/server/tests/api/single-server.ts @@ -605,7 +605,7 @@ describe('Test a single server', function () { expect(video.serverHost).to.equal('localhost:9001') expect(video.account).to.equal('root') expect(video.isLocal).to.be.true - expect(video.tags).to.deep.equal([ 'tag1', 'tag2', 'supertag' ]) + expect(video.tags).to.deep.equal([ 'supertag', 'tag1', 'tag2' ]) expect(dateIsValid(video.createdAt)).to.be.true expect(dateIsValid(video.updatedAt)).to.be.true @@ -645,7 +645,7 @@ describe('Test a single server', function () { expect(video.serverHost).to.equal('localhost:9001') expect(video.account).to.equal('root') expect(video.isLocal).to.be.true - expect(video.tags).to.deep.equal([ 'tag1', 'tag2', 'supertag' ]) + expect(video.tags).to.deep.equal([ 'supertag', 'tag1', 'tag2' ]) expect(dateIsValid(video.createdAt)).to.be.true expect(dateIsValid(video.updatedAt)).to.be.true -- cgit v1.2.3