Settings and Metadata - ZornTaov/ZornCoMix GitHub Wiki

Settings and Metadata

The setup-wide config/ComicScraper.json, and each comic's mirror_metadata.json, its single source of truth.

The config folder

config/ beside the scripts (not in the library, so it survives the library moving) holds ComicScraper.json, element_paths.json (Element Paths), index/ (Page Index and Alignment) and recent.json (the web page's Recent list). --config FOLDER moves it for update_comics.py, and MIRROR_CONFIG for mirror_base.py alone.

ComicScraper.json

A JSON object; every key optional. The command line wins, and the web page's Settings edits it. Re-read before every run, except schedule, read once when the waiting loop starts.

Key Default Meaning
pages_folder, cbz_folder Uncompressed, CBZs Where Add comics puts pages and archives, so a row just says MyComic.
jobs 1 Comics updated at once.
timeout 1800 Seconds before a comic is killed.
progress 60 Seconds between progress reports; 0 is off.
max_depth 5 How deep to look for comics.
schedule none Daily update time, HH:MM.
pack_chapters true Rewrite chapter archives after an update (details).
refresh_chapters true Re-read a chaptered comic's chapter list after an update.
add_defaults prime false, prefix false, increment 1, javascript false, waittime 0, cbz true, direction_check true, multi_page true What the add form starts with.

mirror_metadata.json

In each comic's folder and packed into its archive; plain JSON, made for hand editing:

{
  "schema": 2,
  "settings": {
    "url": "https://example.com/comic/412", "output": "Uncompressed/MyComic",
    "cbz_path": "CBZs/MyComic.cbz", "increment": 412, "prefix": true, "javascript": false,
    "firefox": false, "waittime": 0, "cbz": true, "direction_check": true, "multi_page": true,
    "ended": false
  },
  "state":   { "page_count": 412, "image_xpath": "...", "completed": false },
  "history": { "first_page_url": "...", "runs": [ ... ] }
}
  • settings is the only part you edit, and the only part that decides anything. Each run builds its command from it, so setting prefix to true is all it takes. Every key is written, defaults included.
  • state and history are what the scraper learned and did, rewritten each run. Web page edits are logged in history.edits; chapter corrections live in chapters.fixes.
  • info (optional) is what you say the comic is, for its ComicInfo.xml: title, series, summary, year, writer, penciller, genre, tags and web. Anything said here wins over what the scraper works out (the folder name as title and series, the site's front page as web), and every run and pack carries it into the archives. Leave a key out to keep the worked-out value.
  • ended is yours; a scrape never sets it. state.completed only means that run reached the latest page. See Notes and Limits.
  • output and cbz_path are relative to the library root, and output self-corrects when a comic is moved.

See a comic's actual command: python update_comics.py "D:/Comics" --only MyComic --dry-run.

Older metadata files

Old versions stored the rendered command in three or four places, so hand edits silently did nothing. They are still read; this rewrites them in the current shape, and is safe to run twice:

python adopt_comic.py --migrate --root "D:/Comics" --dry-run
python adopt_comic.py --migrate --root "D:/Comics"