Add per-movie attributes and per-category filename templates

This commit is contained in:
2026-06-16 17:39:39 +02:00
parent b3a61f9e86
commit a71b209539
19 changed files with 1064 additions and 111 deletions
+64
View File
@@ -21,6 +21,58 @@ Each version entry uses these sections (include only those that apply):
## Unreleased
## 1.5.0 — 2026-06-16
### Added
- **Free-form per-movie attributes** (`attributes` in the index, set via *Filmy →
Nastavit atribut…* / context menu): arbitrary `key → value` pairs (e.g.
`collection_sort`) that are exposed to Filmotéka filename templates through
`File.name_context`. So a Kolekce template `"{collection_sort} - {title}{ext}"`
orders the folder as `01 - Dr. No.mkv`, `02 - …`. Empty value removes the attr.
- **Per-category filename template** in the tag schema (`filename_template`,
editable in *Nastavení → Tag schéma…*): the hardlink inside that category's
folders is named from the template (fields `title`/`year`/`rating`/`ext`/
`stem`/`filename`), e.g. a *Kolekce* with `"{year} - {title}{ext}"` yields
`Dle kolekce/James Bond/1962 - Dr. No.mkv` while every other folder (and the
pool) keeps the plain filename. `HardlinkManager` takes
`category_filename_templates`; `File.name_context()` supplies the fields.
- The "Přiřadit štítky" dialog now lists **all tag-schema categories** (including
empty user ones like *Kolekce*) and has a **" Nový štítek…"** button to create
a tag value (e.g. *Kolekce/James Bond*) on the spot and assign it. Tag values
are created on first assignment — the schema editor defines categories + rules,
this dialog defines/assigns the individual values.
### Changed
- Tag schema `transform` now shapes only the **Filmotéka folder name**, not the
tag value. ČSFD tags keep the **exact value** (rating → `Hodnocení/90`) while
the grouping transform is applied when building folders (→ `Dle hodnocení/
90100 %`). `csfd_field_values` no longer transforms; `HardlinkManager` takes a
`category_transforms` map (`FileManager.filmoteka_category_transforms`) and
`apply_transform`/`decade_band` run at folder-generation time.
### Fixed
- Sidebar filter tree no longer re-expands every category on each check/uncheck:
the expanded/collapsed state is preserved across the rebuild (new categories
still default to expanded).
## 1.3.0 — 2026-06-16
### Added
- **Configurable tag schema** (`tag_schema` in the global config, edited via
*Nastavení → Tag schéma…*): a single source of truth for which tag categories
exist, which ČSFD field feeds each (with an optional value transform, e.g.
`decade_band` for the rating), and how each maps into the Filmotéka tree
(`""` = output root, `"Dle …"` = grouping folder, none = filter-only, no
folders). Replaces the hard-coded `FILMOTEKA_CATEGORY_ROOTS` and the fixed
category list in `apply_csfd_tags`; `HardlinkManager` roots are now derived
from the schema (`FileManager.filmoteka_category_roots`).
- **Tag provenance (ČSFD vs user)**: each file tracks which tags came from ČSFD
(`csfd_tags` in the index). `apply_csfd_tags` now **regenerates only the ČSFD
tags** from the schema and leaves user-added tags untouched — so changing a
movie's ČSFD link refreshes its ČSFD tags without wiping your own.
## 1.2.0 — 2026-06-16
### Added
- Fork of the former **Tagger** project as **Curator**, a movie-library manager.
- **Pool** concept (single source of truth) with `Filmy` / `Seriály` folders and
@@ -36,6 +88,14 @@ Each version entry uses these sections (include only those that apply):
year) and fills in the first ČSFD search hit (`find_csfd_url`
`search_movies`, reusing one Anubis session). Existing links are never
overwritten; results are a suggestion the user can review before importing.
- Import dialog now **highlights in red any title that already exists in the
pool** (live as you type) and lets you **remove a single row** (✕ per row), so
you can drop one file without discarding the whole batch and re-picking.
- **Conflict resolution on import**: when a row is left red (name already in the
pool), import asks whether to **replace** the existing movie(s) with the new
file, **keep both** (numeric suffix), or **cancel**. `FileManager.import_movie`
gained an `on_conflict` policy (`suffix` / `replace` / `skip`); `replace`
evicts the existing same-named movie (file + index metadata) first.
- `File` now stores `title` and `csfd_link`.
- New **PySide6** GUI reframed around the Filmotéka workflow (pool setup, import,
tag filter sidebar, movie table, one-click Filmotéka generation), replacing the
@@ -115,6 +175,10 @@ Each version entry uses these sections (include only those that apply):
- `requires-python` narrowed to `>=3.14,<3.15` (PySide6 compatibility).
### Removed
- Duplicate `src/core/constants.py` (hard-coded stale `VERSION = "v1.0.3"`). The
GUI window title imported from it, so it showed the wrong version. All imports
now use `src/constants.py` (version derived from `pyproject.toml`), which also
absorbed `APP_VIEWPORT`; the window title uses `APP_TITLE` → "Curator vX.Y.Z".
- Legacy Tagger predefined tags: the always-available **Hodnocení** (⭐ rating)
and **Barva** (color) categories in `TagManager`, and the automatic
**Stav/Nové** tag assigned to every newly imported file. `DEFAULT_TAGS` is now