~nhanb/pytaku

save both md & md@h links; fallback logic on FE

Preload logic is still wonky though: if fallback happens while
preloading, the alt urls (md@h ones) are cached but when user actually
navigates to next chapter, browser will try the default urls first, fail
again, then try alt urls again whose cache has expired (at least on
firefox when I tested it).
update mangasee cover image server

Also apparently latest `black` takes trailing slash in function argument
list into account, so in order to keep things in 1 line we'll need to
remove the trailing slash.
simpler, more correct mirror command

Old one didn't push non-master branches.
use MD@H links by default

MD's own image servers are sometimes down (like, right now). It's also
more polite to hit MD@H servers instead.

Also needed to work around the filesystem's filename length limit.

Ideally, we should probably store both main and fallback image links on
our side. Or maybe add some sort of wholesale preload logic so we can
retire the proxy thingy altogether.
filter out chapters not yet accessible
build js _before_ python package
include compiled js
bundle js code with esbuild

Source files are moved to `src/pytaku/js-src/`,
while minified js bundle will go to `src/pytaku/static/js/`.
mobile-friendly buttons in chapter/title routes
deal with longer usernames

I'll probably need to lay down username rules soon...
somewhat ok navbar

Doesn't cope well with long usernames though.
somewhere pleasant "follows" grid
more reasonable cache defaults
CDN was a dud

Bunnycdn kept routing me to US/EU edges for some reason (although they
do have a Singapore edge), so things were slooooow. Since I don't have
access to a better CDN, let's not use one at all. Therefore, there need
to be more web workers to serve static stuff.

I should really look into async servers huh.
preload 2 pages at a time
try preloading a list instead of single imgs

For some reason the preloaded images didn't get reused when user
actually visited next chapter. Maybe this helps?
cache chapter data; preload next chapter's pages
decrease default number of gunicorn workers

Should be fine now, what with the filesystem cache and CDN.
I'd probably still need some sort of preload mechanism though.
allow custom hostname for proxied urls

Even with the filesystem cache, serving proxied images through the web
worker is still suboptimal.

This prefix allows me to optionally point all proxied urls to a CDN's
hostname instead. I'm using BunnyCDN, for example.

I'd prefer to solve this on the caddy server side instead, but
apparently caddy server doesn't support the `file server that falls back
to reverse proxy if file not found` use case.

Of course everything should still work out of the box without any CDN by
default.
show source site error to user

New `@handle_source_site_errors` decorator that supports either html or
json responses.

- If html: just render a plain page
- If json: count on frontend code to report error appropriately.
  Currently it just `alert()`s the thing.
  Need to figure out a better UX.
Next