From 9f79ade627f0044606a9fbbe16ca0154661d12b9 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 19 Mar 2019 14:13:53 +0100 Subject: Refresh playlists --- server/models/video/video.ts | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'server/models/video/video.ts') diff --git a/server/models/video/video.ts b/server/models/video/video.ts index 946be6095..fb037c21a 100644 --- a/server/models/video/video.ts +++ b/server/models/video/video.ts @@ -77,7 +77,7 @@ import { buildTrigramSearchIndex, buildWhereIdOrUUID, createSimilarityAttribute, - getVideoSort, + getVideoSort, isOutdated, throwIfNotValid } from '../utils' import { TagModel } from './tag' @@ -1547,7 +1547,7 @@ export class VideoModel extends Model { attributes: query.attributes, order: [ // Keep original order Sequelize.literal( - ids.map(id => `"VideoModel".id = ${id} DESC`).join(', ') + ids.map(id => `"VideoModel".id = ${id}`).join(', ') ) ] } @@ -1767,12 +1767,7 @@ export class VideoModel extends Model { isOutdated () { if (this.isOwned()) return false - const now = Date.now() - const createdAtTime = this.createdAt.getTime() - const updatedAtTime = this.updatedAt.getTime() - - return (now - createdAtTime) > ACTIVITY_PUB.VIDEO_REFRESH_INTERVAL && - (now - updatedAtTime) > ACTIVITY_PUB.VIDEO_REFRESH_INTERVAL + return isOutdated(this, ACTIVITY_PUB.VIDEO_REFRESH_INTERVAL) } setAsRefreshed () { -- cgit v1.2.3