From d6ff5cd46a95f0e8d66b98ece09aa1787b7ac438 Mon Sep 17 00:00:00 2001 From: stjet <49297268+stjet@users.noreply.github.com> Date: Sun, 13 Sep 2026 19:47:14 +0000 Subject: [PATCH] add optional anime notes --- build.ts | 8 +++++++- notes/joshiraku_s01e01.txt | 2 ++ templates/anime.html | 6 ++++++ 3 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 notes/joshiraku_s01e01.txt diff --git a/build.ts b/build.ts index 3904479..712498b 100644 --- a/build.ts +++ b/build.ts @@ -1,5 +1,5 @@ import * as path from 'path'; -import { readdirSync, existsSync } from 'fs'; +import { readdirSync, readFileSync, existsSync } from 'fs'; import { Renderer } from './ryuji.js'; import { Builder } from './saki.js'; import _favourites_info from './favourites_info.json'; @@ -34,6 +34,7 @@ type MusicVars = ListingVars; interface AnimeVars extends ListingVars { higher_quality_available: boolean; + notes: string | boolean; }; interface MangaVars extends ListingVars { @@ -118,10 +119,15 @@ for (let i = 0; i < listings.length; i++) { }; const serve_path = `/${listing.type}/${listing.name}/${chapter}`; if (listing.type === "anime") { + let notes: string | boolean = false; + try { + notes = readFileSync(`notes/${listing.name}_${chapter}.txt`, "utf-8"); + } catch (_) {} anime_serve_paths.push(serve_path); anime_vars.push({ ...base, higher_quality_available: existsSync(path.join(__dirname, `/static_assets/${listing.type}_assets/${listing.name}`, `${chapter}_higher_quality.mp4`)), + notes, }); } else if (listing.type === "manga") { manga_serve_paths.push(serve_path); diff --git a/notes/joshiraku_s01e01.txt b/notes/joshiraku_s01e01.txt new file mode 100644 index 0000000..833a03e --- /dev/null +++ b/notes/joshiraku_s01e01.txt @@ -0,0 +1,2 @@ +Test note! +Wei wei wei wei wei wei \ No newline at end of file diff --git a/templates/anime.html b/templates/anime.html index 743671d..5647dde 100644 --- a/templates/anime.html +++ b/templates/anime.html @@ -45,6 +45,12 @@ [[ endif ]] [[ component:nav ]] + [[ if:notes ]] +