Rename the app from MangaParty to MangaCircus

This commit is contained in:
Maashkinoozhe committed 2026-10-01 09:37:52 +02:00
1 parent 8dd776b7f4
commit cfb2d79103
19 files changed
+49 -49

No files matched your search

+18 -18
View File
@@ -1,36 +1,36 @@
# Scraper guide: supplying the MangaParty library
# Scraper guide: supplying the MangaCircus library
**Audience:** an automated agent or program that downloads manga, comics or webtoons from upstream sources and writes them into a MangaParty library folder.
**Audience:** an automated agent or program that downloads manga, comics or webtoons from upstream sources and writes them into a MangaCircus library folder.
**Normative words:** MUST, MUST NOT, SHOULD, SHOULD NOT and MAY as in RFC 2119. Rules have ids (`R-…`) so you can cite them in logs and reviews.
**Background reading** (optional; this guide is self-contained):
- [library-format.md](library-format.md): the format.
- [import.md](import.md): how MangaParty reads it.
- [import.md](import.md): how MangaCircus reads it.
---
## 0. The contract in short
- You write **plain folders and image files**. There is no upload API.
- MangaParty scans the library folder every `SCAN_INTERVAL` minutes (default 10), and on demand (§9).
- MangaCircus scans the library folder every `SCAN_INTERVAL` minutes (default 10), and on demand (§9).
- The layout is `<library>/<Manga>/<Book>/<Chapter>/<pages>`, always three levels.
- Names carry meaning:
- the manga folder name is the manga's id,
- the book/chapter **numbers** in folder names are ids and order,
- the chapter folder name is the version id,
- page file names carry order and page roles.
- MangaParty notifies followers as soon as a new chapter number becomes visible. So a chapter MUST become visible **complete and in one step**: stage it in a hidden folder, then rename it (§10).
- MangaParty never writes to the library. You own it; MangaParty only reads it.
- MangaCircus notifies followers as soon as a new chapter number becomes visible. So a chapter MUST become visible **complete and in one step**: stage it in a hidden folder, then rename it (§10).
- MangaCircus never writes to the library. You own it; MangaCircus only reads it.
## 1. Inputs you need
| Input | Required | Notes |
|-------|----------|-------|
| Library root path | yes | The folder MangaParty mounts as `LIBRARY` (`/library` in Docker) |
| Library root path | yes | The folder MangaCircus mounts as `LIBRARY` (`/library` in Docker) |
| Upstream manga metadata | yes | Title, reading direction/type, chapter list with numbers |
| Per chapter: ordered page images | yes | Plus, where available: which pages are covers, spreads, credits/notes |
| MangaParty URL + an admin account | no | Only to trigger an immediate rescan (§9) |
| MangaCircus URL + an admin account | no | Only to trigger an immediate rescan (§9) |
## 2. Target layout (template)
@@ -69,7 +69,7 @@
- `x<NN>[ <title>]` for extra books (specials, art books, one-shot collections) that sit outside the numbering.
- Example: `v01 Spring`, `s02 Season 2`, `x01 Specials`.
- **R-B2** Pad numbers to 2 digits, or to 3 digits for series that can exceed 99 volumes, and keep the width the same within a manga. Re-padding a book folder later (`v01` → `v001`) is safe: the number, not the text, is the id.
- **R-B3** Book numbers MUST be unique within a manga. MangaParty ignores a second folder with the same number.
- **R-B3** Book numbers MUST be unique within a manga. MangaCircus ignores a second folder with the same number.
- **R-B4** A chapter's id includes its book number (`<book>/<chapter>`). Moving a chapter to another book later creates a "new" chapter: progress and votes stay behind, and followers get notified again. Therefore you MUST choose a book strategy per manga that never needs to move chapters:
- **Flat (default):** every chapter goes into `v01` (for example `v01 Chapters`). Use it for ongoing series and for sources without reliable volume data.
- **Volumes:** chapters go into their volume, **only** if the source gives a final volume number at the time you first write the chapter, and for every chapter.
@@ -212,8 +212,8 @@ All are UTF-8 JSON **without** BOM, pretty-printing optional.
New content shows up by itself at the next scheduled scan. For immediate pickup, trigger **one** rescan after a batch, not per chapter:
```bash
curl -s -c jar.txt -H 'Content-Type: application/json' -d '{"name":"<admin>","password":"<password>"}' "$MANGAPARTY/api/login"
curl -s -b jar.txt -H 'Content-Type: application/json' -d '{}' "$MANGAPARTY/api/admin/rescan"
curl -s -c jar.txt -H 'Content-Type: application/json' -d '{"name":"<admin>","password":"<password>"}' "$MANGACIRCUS/api/login"
curl -s -b jar.txt -H 'Content-Type: application/json' -d '{}' "$MANGACIRCUS/api/admin/rescan"
```
- The response contains `scan.error` (null on success) and counts.
@@ -221,7 +221,7 @@ curl -s -b jar.txt -H 'Content-Type: application/json' -d '{}' "$MANGAPARTY/api/
## 10. Writing safely
MangaParty can scan at any moment. Everything it can see must always be complete.
MangaCircus can scan at any moment. Everything it can see must always be complete.
- **R-W1** All staging paths MUST start with `.` and MUST be on the **same file system** as their final location; only then is `rename` atomic. Put staging folders next to the target:
@@ -232,7 +232,7 @@ MangaParty can scan at any moment. Everything it can see must always be complete
| new manga | `<library>/.staging-<random>/` |
- **R-W2** Publish = one `rename` of the finished staging folder to its final name. Write every image and `chapter.json` before that rename.
- **R-W3** You MUST NOT overwrite image files in place. MangaParty caches image sizes per folder mtime, and an in-place overwrite goes unnoticed. Replace whole version folders instead (R-W4).
- **R-W3** You MUST NOT overwrite image files in place. MangaCircus caches image sizes per folder mtime, and an in-place overwrite goes unnoticed. Replace whole version folders instead (R-W4).
- **R-W4** Replacing an existing version (same folder name):
1. stage the new copy,
2. `rename(final → .old-<random>)`,
@@ -242,8 +242,8 @@ MangaParty can scan at any moment. Everything it can see must always be complete
- **R-W5** Updating a JSON file: write `.<name>.tmp` in the same folder, then `rename` it over the target.
- **R-W6** At start-up, delete your own leftover `.staging-*` / `.old-*` folders older than a few hours (from crashed runs).
- **R-W7** On Windows, `rename` can fail with `EPERM`/`EBUSY` while another process reads the folder. Retry a few times with a short delay.
- **R-W8** Files MUST be readable by the MangaParty process. In Docker that is uid 1000, so use mode `0644` for files and `0755` for folders.
- **R-W9** You MUST NOT write anything into MangaParty's `DATA` folder (`db.json`, `scan-cache.json`).
- **R-W8** Files MUST be readable by the MangaCircus process. In Docker that is uid 1000, so use mode `0644` for files and `0755` for folders.
- **R-W9** You MUST NOT write anything into MangaCircus's `DATA` folder (`db.json`, `scan-cache.json`).
### 10.1 Reference implementation (Node.js, no dependencies)
@@ -323,9 +323,9 @@ after the batch: optionally trigger one rescan
- [ ] Publishing is a single rename.
- [ ] No secrets in `manga.json`.
## 13. What MangaParty does with your output
## 13. What MangaCircus does with your output
| You do | MangaParty does |
| You do | MangaCircus does |
|--------|-----------------|
| Publish a manga folder for the first time | Adds it to the library. **No** notifications (first sight) |
| Publish a new chapter number in a known manga | Lists it, and notifies followers in the app and by webhook within one scan |
@@ -335,7 +335,7 @@ after the batch: optionally trigger one rescan
| Move or renumber a chapter | Treats it as a new chapter and notifies again. Old progress and votes are orphaned |
| Rename a version folder | Votes for it are lost |
| Remove a chapter | It disappears from the list. It is not re-announced if it comes back |
| Write invalid names or JSON | Skips the folder or ignores the JSON, and logs a `[scan]` warning in MangaParty's output |
| Write invalid names or JSON | Skips the folder or ignores the JSON, and logs a `[scan]` warning in MangaCircus's output |
## 14. Worked example