#!/usr/bin/env python3 """Config page template for Kaizoku.""" from app_support import DISCORD_WEBHOOK_EVENT_CHOICES, DISCORD_WEBHOOK_EVENT_LABELS from template_helpers import BROWSER_API_HELPER, render_page_links, render_sidebar_brand WEBHOOK_EVENT_OPTIONS = "\n".join( ( f' " ) for event_name in DISCORD_WEBHOOK_EVENT_CHOICES ) CONFIG_HTML = r""" Kaizoku - config

Defaults

Manage the folder, mode, and quality that the Search page starts with.

Tip: these are the saved defaults only. The active search form can still be adjusted per download.

Provider

Choose the default source used for search, watchlist refresh, and auto-downloads.

Search results and watchlist entries store their provider in the show ID, so existing tracked anime keep using their original source.

Watchlist schedule

Periodically queue a background watchlist refresh to check for newly available episodes.

When enabled, the server periodically starts the existing background “Refresh All” job using this interval. Bulk refreshes now wait this many seconds between shows to avoid flooding upstream sources.

Auto-download

Automatically queue newly discovered episodes for shows in the `Watching` category after manual or scheduled refreshes.

Adding a new watchlist entry does not auto-download anything. Auto-download only reacts to later manual refreshes or scheduled refreshes that find new episodes.

Jellyfin handoff

Move fully completed anime libraries from the default download area into the folders that Jellyfin scans.

TV entries move only after the show is marked `Finished` and at least one downloaded language covers the expected episode count. Movie entries move after they are downloaded. The manual trigger scans the current watchlist and moves anything already eligible.
No recent Jellyfin handoff job.

Watchlist filesystem sync

Manually reconcile downloaded episode flags with the files currently present under the download library.

This scans the configured download library, removes downloaded episode flags for files that no longer exist, and adds flags for episodes already present on disk.
No watchlist filesystem sync run yet.

Watchlist backup

Export or restore a complete watchlist database snapshot, including removed-show records.

Import replaces the current watchlist with the selected backup file.
No watchlist backup action run yet.

Discord notifications

Send webhook notifications for refresh discoveries, refresh problems, and unexpected runtime errors.

The new-episodes notification includes one card per anime, with local cached thumbnails attached to the webhook when available.
""" + WEBHOOK_EVENT_OPTIONS + r"""
"""