for (const videoId of videoIds) {
try {
const views = await Redis.Instance.getLocalVideoViews(videoId)
await Redis.Instance.deleteLocalVideoViews(videoId)
for (const videoId of videoIds) {
try {
const views = await Redis.Instance.getLocalVideoViews(videoId)
await Redis.Instance.deleteLocalVideoViews(videoId)
if (!video) {
logger.debug('Video %d does not exist anymore, skipping videos view addition.', videoId, lTags())
continue
}
if (!video) {
logger.debug('Video %d does not exist anymore, skipping videos view addition.', videoId, lTags())
continue
}
// If this is a remote video, the origin instance will send us an update
await VideoModel.incrementViews(videoId, views)
// If this is a remote video, the origin instance will send us an update
await VideoModel.incrementViews(videoId, views)