diff --git a/dlibrary/dlibrary.py b/dlibrary/dlibrary.py index 7bce8b9..67ba0ea 100755 --- a/dlibrary/dlibrary.py +++ b/dlibrary/dlibrary.py @@ -23,6 +23,7 @@ import fitz from libsixel import * from PIL import Image from jinja2 import Environment, PackageLoader, select_autoescape +import pyuca import rarfile import requests @@ -1151,10 +1152,11 @@ def generate(args): print(f'\x1b[2K\r{idx+1}/{len(works)} works processed...', end=('' if idx+1 < len(works) else '\n')) + uca = pyuca.Collator().sort_key def make_categorization(categorization, query, work_filter, work_style_cards=False): categorization_dir = site_dir / categorization - cats = sorted((cat for (cat,) in cur.execute(query)), key=str.casefold) + cats = sorted((cat for (cat,) in cur.execute(query)), key=uca) cat_samples = {} for cat in cats: cat_works = list(filter(work_filter(cat), works)) diff --git a/flake.nix b/flake.nix index 6391e97..c4d3f8d 100644 --- a/flake.nix +++ b/flake.nix @@ -60,6 +60,7 @@ setuptools libsixel (rarfile.override { useUnrar = true; }) + pyuca ]; src = ./.; }; diff --git a/pyproject.toml b/pyproject.toml index 7897dec..99a07c1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -13,6 +13,7 @@ dependencies = [ "importlib_resources", "libsixel-python", "rarfile", + "pyuca", ] [project.scripts]