Add season folder to library layout

This commit is contained in:
Dymas
2026-05-11 12:30:51 +02:00
parent 79ee98ae62
commit 32ec0fe856
4 changed files with 12 additions and 6 deletions
+4
View File
@@ -1,5 +1,9 @@
# Changelog # Changelog
## 0.1.2 - 2026-05-11
- Updated finalized download layout to save media under `ANI_CLI_DOWNLOAD_DIR/anime_name/Season <season>/`.
## 0.1.1 - 2026-05-11 ## 0.1.1 - 2026-05-11
- Expanded `.gitignore` to ignore `__pycache__` directories at every project depth. - Expanded `.gitignore` to ignore `__pycache__` directories at every project depth.
+2 -2
View File
@@ -2,7 +2,7 @@
A small local web UI for a system-wide `ani-cli` install. A small local web UI for a system-wide `ani-cli` install.
Current version: `0.1.1` Current version: `0.1.2`
## Project Layout ## Project Layout
@@ -32,7 +32,7 @@ The app searches anime, queues downloads, supports original or dubbed mode, qual
Downloads are staged in the web app state directory first. After `ani-cli` finishes, the wrapper moves them into a Plex/Jellyfin-friendly layout: Downloads are staged in the web app state directory first. After `ani-cli` finishes, the wrapper moves them into a Plex/Jellyfin-friendly layout:
```text ```text
ANI_CLI_DOWNLOAD_DIR/anime_name/anime_name - S01E01.mp4 ANI_CLI_DOWNLOAD_DIR/anime_name/Season <season>/anime_name - S01E01.mp4
``` ```
## Configuration ## Configuration
+1 -1
View File
@@ -1 +1 @@
0.1.1 0.1.2
+5 -3
View File
@@ -20,7 +20,7 @@ from uuid import uuid4
PROJECT_ROOT = Path(__file__).resolve().parent PROJECT_ROOT = Path(__file__).resolve().parent
ANI_CLI = os.environ.get("ANI_CLI_BIN") or shutil.which("ani-cli") or "ani-cli" ANI_CLI = os.environ.get("ANI_CLI_BIN") or shutil.which("ani-cli") or "ani-cli"
APP_NAME = "ani-cli-web" APP_NAME = "ani-cli-web"
VERSION = "0.1.1" VERSION = "0.1.2"
ALLANIME_BASE = "allanime.day" ALLANIME_BASE = "allanime.day"
ALLANIME_API = f"https://api.{ALLANIME_BASE}" ALLANIME_API = f"https://api.{ALLANIME_BASE}"
ALLANIME_REFERER = "https://allmanga.to" ALLANIME_REFERER = "https://allmanga.to"
@@ -449,7 +449,8 @@ def normalize_season(value):
def job_output_dir(job): def job_output_dir(job):
return Path(job["download_dir"]).expanduser() / sanitize_path_component(job.get("anime_name") or job.get("title")) anime_name = sanitize_path_component(job.get("anime_name") or job.get("title"))
return Path(job["download_dir"]).expanduser() / anime_name / f"Season {job.get('season') or '1'}"
def job_staging_dir(job): def job_staging_dir(job):
@@ -1194,7 +1195,8 @@ INDEX_HTML = r"""<!doctype html>
item.querySelector(".job-title").textContent = job.title; item.querySelector(".job-title").textContent = job.title;
const libraryName = job.anime_name || job.title; const libraryName = job.anime_name || job.title;
const season = String(job.season || "1").padStart(2, "0"); const season = String(job.season || "1").padStart(2, "0");
const target = job.target_dir || `${job.download_dir}/${libraryName}`; const seasonFolder = `Season ${job.season || "1"}`;
const target = job.target_dir || `${job.download_dir}/${libraryName}/${seasonFolder}`;
item.querySelector(".job-head .muted").textContent = item.querySelector(".job-head .muted").textContent =
`${libraryName} · S${season} · ${job.mode} · ${job.quality} · episodes ${job.episodes} · ${target}`; `${libraryName} · S${season} · ${job.mode} · ${job.quality} · episodes ${job.episodes} · ${target}`;
const status = item.querySelector(".status"); const status = item.querySelector(".status");