video.isOutdated() is not a function?

We only want logged in users to view the video with any privacy type and for not logged in users we want to show the NOT_AUTHORIZED page, which is implemented for ‹ PRIVATE and INTERNAL › videos by default in Peertube.

Trying to filter a video using the following hook (‹ filter:api.video.get.result ›),

if we do not return a video using this hook, the error is always ‹ video.isOutdated() is not a function › and no further execution is possible.

Is there any way to achieve what we are trying to implement (is this particular hook not the way to go?)
How can we not return a video and not get the error?

    target: 'filter:api.video.get.result',
    handler: async (video, userInfo) => {
      if (!video) return video
      if (!userInfo.userId) return { data: [] }

      return video
    }
  })```

Hi,

Can you explain why you don’t force the private/internal video privacies on your instance?

You’re right peertube doesn’t support a null/undefined value returned by this hook. Can you create an issue on github? GitHub - Chocobozzz/PeerTube: ActivityPub-federated video streaming platform using P2P directly in your web browser