Kyoo/scanner
dependabot[bot] aee1c97f67
build(deps): bump python-multipart from 0.0.21 to 0.0.22 in /scanner
Bumps [python-multipart](https://github.com/Kludex/python-multipart) from 0.0.21 to 0.0.22.
- [Release notes](https://github.com/Kludex/python-multipart/releases)
- [Changelog](https://github.com/Kludex/python-multipart/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Kludex/python-multipart/compare/0.0.21...0.0.22)

---
updated-dependencies:
- dependency-name: python-multipart
  dependency-version: 0.0.22
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-01-27 00:03:10 +00:00
..
2025-06-07 17:45:39 +02:00
2025-06-07 17:45:39 +02:00
2026-01-02 12:08:36 +01:00
2025-11-17 23:07:59 +01:00
2025-06-07 17:45:38 +02:00
2026-01-02 12:08:36 +01:00

Scanner

Workflow

In order of action:

  • Scanner gets /videos & scan file system to list all new videos
  • Scanner guesses as much as possible from filename/path ALONE (no external database query).
    • Format should be:

      {
          path: string,
          version: number,
          part: number | null,
          rendering: sha(path except version & part),
          guess: {
              from: "guessit"
              kind: movie | episode | extra
              title: string,
              years?: number[],
              episodes?: {season?: number, episode: number}[],
              ...
           },
      }
      
      • Apply remaps from lists (AnimeList + thexem). Format is now:
      {
          path: string,
          version: number,
          part: number | null,
          rendering: sha(path except version & part),
          guess: {
              from: "anilist",
              kind: movie | episode | extra
              name: string,
              years: number[],
              episodes?: {season?: number, episode: number}[],
              externalId: Record<string, {showId, season, number}[]>,
              history: {
                  from: "guessit"
                  kind: movie | episode | extra
                  title: string,
                  years?: number[],
                  episodes?: {season?: number, episode: number}[],
               },
              ...
           },
      }
      
  • Try to find the series id on kyoo (using the previously fetched data from /videos):
    • if another video in the list of already registered videos has the same kind, name & year, assume it's the same
    • if a match is found, add to the video's json:
    {
        entries: (
          | { slug: string }
          | { movie: uuid | string }
          | { serie: uuid | slug, season: number, episode: number }
          | { serie: uuid | slug, order: number }
          | { serie: uuid | slug, special: number }
          | { externalId?: Record<string, {serieId, season, number}> }
          | { externalId?: Record<string, {dataId}> }
        })[],
    }
    
  • Scanner pushes everything to the api in a single post /videos call
  • Api registers every video in the database & return the list of videos not matched to an existing serie/movie.
  • Scanner adds every non-matched video to a queue

For each item in the queue, the scanner will:

  • retrieves metadata from the movie/serie + ALL episodes/seasons (from an external provider)
  • pushes every metadata to the api (if there are 1000 episodes but only 1 video, still push the 1000 episodes)