AniFlow

Documentation

Shoko Server

Connect Shoko Server, adopt its series, and let AniFlow hand files over.

What the integration is for

Shoko Server is a separate program that identifies anime files against AniDB, renames them and files them into a library. AniFlow can work alongside it in two ways:

Shoko is optional. Without it AniFlow runs in standalone mode and manages the library itself.

Standalone mode or Shoko Server mode

This is one of the first questions in the setup wizard (Who organises your library?):

ModeWhat happens to a finished download
AniFlow manages it (standalone)AniFlow places the file in your library and names it. AniFlow is the only thing that writes there.
Shoko Server manages itAniFlow puts the file in a hand-over folder. Shoko identifies, renames and files it. AniFlow then finds it again.
Careful

The wizard says it plainly: This choice cannot be changed later. Once files exist, switching would split your library in two. The episodes AniFlow already placed would keep their names while new ones go wherever Shoko puts them, and neither side would know about the other. The mode is recorded in AniFlow's database; a stale environment variable cannot override it (AniFlow logs a warning and carries on in the recorded mode). The choice can still be changed in the wizard until setup is finished.

In standalone mode the Shoko Server page and the Shoko Server tab in Settings are hidden, since there is no Shoko in the pipeline.

Connecting to Shoko

Enter the connection in the setup wizard (The programs AniFlow talks to), or later in Settings -> Shoko Server:

  1. URL - the address of your Shoko Server as reachable from the AniFlow container, for example http://192.168.1.10:8111 (example address; use your own).
  2. API key - Shoko's own API key from its settings. AniFlow never asks for your Shoko password. Once set, leave the field empty to keep the stored key.
  3. Press Test connection.

The URL and key are optional for the hand-over itself, which works through folders and needs no credentials. They are what lets AniFlow read from Shoko. The status line in the page header says Shoko Server connected, refused the key, unavailable or not set up. If Shoko is unreachable, the file hand-over is unaffected; only what Shoko can tell AniFlow is.

The hand-over

In Shoko Server mode, a finished download takes this path:

  1. AniFlow puts the file in the import folder, a folder per anime, keeping the release's own file name. Mount this folder into the AniFlow container at /import. The line in docker-compose.yml is commented out by default; remove the # and set IMPORT_HOST_PATH. Put it on the same dataset as /media so Shoko moves files instead of copying them. In Shoko this folder must be an import folder that Shoko watches (a drop source).
  2. AniFlow asks Shoko to run its import (the same as pressing Run Import in Shoko). Shoko also checks on its own schedule.
  3. Shoko identifies the file, renames it and moves it into your library.
  4. AniFlow finds the file again and records its final folder and file name. It does not guess from titles. A file is recognised by, in this order: its inode (a move within one filesystem keeps it), then the CRC32 in the release name, then an exact file size when only one file has that size. A file none of these finds stays waiting.

While it waits, the episode reads Waiting for Shoko. If the file is still in the import folder after six hours, the episode shows a warning that Shoko has not filed it. This is often because the release is too new for AniDB, which resolves itself. Two buttons help: Run Shoko import, and Open Shoko, where you can hash the file and add it to AniDB. If Shoko took the file but it never turned up in the library, the row says so; it was most likely treated as a duplicate of an episode you already have.

Libraries linked to a Shoko folder

A library can be assigned to one of Shoko's import folders (Assigned folder in Shoko when editing a library on the Libraries page). For an anime in such a library, AniFlow skips the hand-over folder, writes the file straight into the library folder and Shoko recognises it there. AniFlow then asks Shoko to run its import. A library with no assigned folder keeps using the hand-over folder. See Media folders and libraries.

Match Shoko folders (Libraries page, Shoko mode only) lists Shoko's import folders with their state. Next to each folder that can hold a library is an Add library button, which opens the Add library window with the Shoko folder already assigned. A Source folder is a drop point, not a library. AniFlow warns when Shoko is not watching a folder, or when the assigned folder no longer exists.

Important

Turn off Move on Import in Shoko. Otherwise Shoko may move files into a different library than the one AniFlow chose. With it off, AniFlow controls the file location and Shoko only recognises the file. If Shoko does move a file to another library anyway, the anime follows the file and a warning appears in the Activity log.

The Shoko Server page

The Shoko Server entry in the navigation (Shoko mode only) shows what Shoko reports, read-only. If AniFlow is not connected, the page says so and links to Settings.

There is no separate "Only in Shoko" list any more; a series Shoko holds is simply an ordinary watchlist entry once adopted. A Refresh button re-reads Shoko, which is also remembered between visits.

Adopting series into the watchlist

Take everything from Shoko puts every series Shoko holds that is not on the watchlist onto it and fills in what can be read: cover, subgroup, quality and episodes, from Shoko's files. It downloads nothing and asks no tracker. Series are matched to AniFlow's watchlist by AniDB id (and MyAnimeList id where Shoko states one). For a series the downloaded calendar does not know, AniFlow builds the entry from the AniDB title list and Shoko's own episode count. Series without an AniDB id may not be adoptable; the result line says why. The button reports how many were added and filled in, and lists what could not be filled in.

Adoption runs when you press the button, or from the Schedule page (Shoko: Importing Shoko's library, manual only). It does not run on its own timer. A single series can be added from its own page on the Shoko Server page.

Fill in missing, with Shoko

Fill in missing in an anime's Edit dialog (and Fix missing details on its page) asks the calendar first, then your chosen metadata source, and last Shoko Server when it is connected: picture, description, genres, studio and more. Shoko is only used for what is still empty, and your own edits are never overwritten. For a whole watchlist at once, the Schedule page has Watchlist: Fill in missing (all anime), manual only.

What AniFlow does to Shoko

Important

AniFlow reads from Shoko. It never calls Shoko's MyList synchronisation (SyncMyList), which can queue mass deletions on your AniDB account, and it has no button or task that could. A test in AniFlow's source guards this. Nothing in AniFlow changes your AniDB account.

Everything AniFlow does to Shoko is one of these:

AniFlow does not create series, delete files, change settings or rename anything inside Shoko. Deleting an anime in AniFlow does not touch Shoko; see Watchlist and adding anime.

AniFlow itself never fetches AniDB web pages. Its AniDB title list is the published title dump, fetched at most weekly, and the AniDB page (your My List) is built from an export file you upload.