Documentation
Media folders and libraries
How AniFlow sees your folders, what a library is, and how to mount them.
The four folders
AniFlow sees four folders inside its container. They come from the volumes: in your compose file.
| Folder | What it is |
|---|---|
/config | AniFlow's settings and log. |
/data | Its database and cover cache. Back this up. |
/media | Your anime. |
/downloads | Where your download client saves, as AniFlow sees it. |
In Shoko Server mode there is a fifth, optional folder, /import: the hand-over folder that Shoko watches. See Libraries and Shoko Server.
What a library is
A library is a name and one folder. Every anime on your watchlist belongs to exactly one library. You can have as many libraries as you like, for example /media/anime and /media/adult.
The libraries page is Libraries in the sidebar. There you can:
- add a library with Add library (a name and a folder, chosen with Choose folder);
- add several at once with Add from folder, which lists the subfolders of a parent folder so you can tick the ones that should be libraries;
- edit, reorder or remove a library, and choose which one is the default with Make default;
- mark a library as adult ("Everything in this library is adult"), and tag it as Current season or Past seasons, which AniFlow uses as a hint when it checks whether a show sits in the right place;
- press Refresh (or Refresh all) to compare a library with what is on disk. The result lists anime found here, anime found in another library, anime not found and folders AniFlow does not know.
AniFlow needs at least one library with a folder. There is also a special library called Upcoming with no folder. It holds anime that have not started yet, because there is nothing to download for them. It cannot be removed or renamed; when an anime premieres you move it to one of your own libraries.
The folder picker only offers folders that exist in the container, so a folder you forgot to mount does not appear, and the system folders of the container (including /config, /data and /downloads) are not offered. If you type or open a folder that is missing, AniFlow says it does not exist in its container and asks whether it is mounted.
Moving a show between libraries
A show lives in one library, and you can change it:
- on the anime's own page (Move to...), or
- for many at once on the Libraries page, with Move anime... on a library: select the anime and the destination.
The anime's folder moves with it. If a folder of the same name already exists in the destination, that anime stays where it is and is reported as not moved. When the files are already in the new folder, untick "Move the files too" and only the library changes. When you remove a library that still has anime in it, AniFlow asks where they should go; if the destination uses the same folder, their files are already in place and only the library changes.
One mount or one mount per library
There are two ways to give AniFlow its library folders:
- One mount (the default). Mount the folder that holds all your anime at
/media. A library may then be/mediaitself or any subfolder of it, such as/media/anime. This is the simplest and works for every library. - One mount per library. Mount each library's folder on its own, for example
/seriesand/movies, and use those paths when you add the libraries. You can mix both ways.
Two libraries should not share a folder, and one library's folder should not sit inside another's. The Libraries page warns when they do ("Shares its folder with ..." or "Its folder is inside the folder of ..."), because AniFlow cannot tell their anime apart by where a file is.
The single-mount layout for hardlinks
If you set Settings -> Downloads to place files by hardlink, an episode takes space once on disk and the torrent keeps seeding. A hardlink only works when the download folder and the library are on the same filesystem and reachable through one mount. Two separate bind mounts of the same disk fail with "Invalid cross-device link", even though it is the same disk.
So for hardlinks, mount one parent folder and keep downloads and media inside it, in both AniFlow and your download client. For example, if your host has /mnt/tank/data containing downloads and media:
volumes:
- /docker/aniflow/config:/config
- /docker/aniflow/data:/data
- /mnt/tank/data:/data-share
Then the download client saves to /data-share/downloads and the library is /data-share/media/anime. The Checks page has a Hardlink placement check that tries a real link from the download folder into each library and says what to change. If hardlinks cannot work on your setup (for example a network share), choose Copy in Settings -> Downloads. See Importing: copy, move or hardlink.
Paths must match everywhere
AniFlow, your download client and, if you use it, Shoko Server must all reach the same files. In particular:
- Download client. The folder the client saves to must be the same absolute path in both containers. AniFlow maps the finished file by that path; there is no setting that translates between different paths. If they differ, AniFlow cannot find the files. The wizard's Test the download folder button and the Checks page ("Download folder matches the client's") test this.
- Shoko Server. The path of a library in AniFlow and the path Shoko has for the same folder are different views of one place; AniFlow shows both ("AniFlow: ..." and "Shoko Server: ..."). Both containers must have the folder mounted.
- Permissions. The user AniFlow runs as must be able to read and write the library and download folders.
See Download clients for the client side.
Libraries and Shoko Server
In Shoko Server mode each library can be assigned to one of Shoko's import folders ("Assigned folder in Shoko"). Shoko Server mode is explained in Shoko Server; the parts that concern folders are these:
- Match Shoko folders on the Libraries page (and in the wizard) adds a library for a folder Shoko watches and assigns its Shoko folder for you. A Shoko folder marked "Drop point, not a library" is a hand-over folder only.
- A library that is not assigned shows a warning, because AniFlow cannot tell whether Shoko watches it. Other warnings say that Shoko is not watching the folder, or that the folder assigned in Shoko no longer exists. If Shoko cannot be reached, the folder checks are switched off.
- Files for a library that is not linked to Shoko are handed over through
/import, which must be mounted and writable. If every library is linked, no hand-over folder is needed. The Checks page tests this ("Shoko hand-over folder"). - The Libraries page recommends turning off "Move on Import" in Shoko. Otherwise Shoko may move files to a different library. With it off, AniFlow controls where the file goes and Shoko only recognises it.
Mount /import on the same filesystem as /media if you can, so that Shoko moves files instead of copying them.
Check your folders
The Checks page (sidebar) tests every folder one at a time: AniFlow's settings and data folders, each library ("exists and can be written to", with free space), the download folder, the hand-over folder in Shoko mode, and hardlink placement. Each failing line says what to change, and Check again reruns it. In Shoko Server mode a library AniFlow only reads from is reported as readable rather than writable. See Troubleshooting and Checks.