Skip to content

Create a backend service for filtering out Uncategorized videos #15

@mblomdahl

Description

@mblomdahl

As an alternative approach to waiting for acceptance and roll-out of changes in #14 (and then wait for all the video site maintainers to actually upgrade their servers with newer PeerTube software), we can deploy a backend service that queries a PeerTube server for all videos, caches them, and returns the subset that matches our criteria.

Functional requirements:

  1. Send a GET <owntube-backend>/api/peertube/<instance_hostname>/api/v1/videos/isLocal=true&categoryOneOf[]=null,2
  2. Expect a response that include all local videos with category Unknown (null) or Films (2)

Non-functional requirements:

  • Implemented in Node 22 with NestJS and Typescript
  • No robust database persistence in initial version, use a container-local SQLite database
  • Video discovery results for a host should be cached and reused between requests, i.e.
    1. in request handler; request received → emit a backend-local "check cache for instance_hostname Videos" event → return the cached results
    2. in backend-local subscriber for the "check cache for instance_hostname Videos" event; a) check when was the site last queried for channels and if it was more than 1 week ago or b) send a request and check the first page of results ordered by updatedAt (descending); then if any of a) or b) are true emit a backend-local "update cache for instance_hostname Videos" event
    3. in backend-local subscriber for the "update cache for instance_hostname Videos" event, run the Videos discovery on the target site and update the cache with new results and new cache update timestamp
  • If no Videos discovery result is available in the backend-local storage, it should run the Videos discovery on the target site synchronously, cache it, and then return the results to the client
  • Rate limits on the PeerTube API must be respected (dynamically, subject to rate limiting response headers)
  • GitHub Actions CI/CD pipeline for deploying it to OwnTube.tv Kubernetes

Metadata

Metadata

Assignees

No one assigned

    Labels

    boostBoosting Lizo'nikah

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions