970 B
970 B
src/core/transforms.py
Tag-schema value transforms for miniDLNA folder names.
Applied when building a folder name from a tag value — the tag keeps its exact
value (e.g. rating 87 → tag "Hodnocení/87"), while the folder groups it
(→ "…/80–89 %"). Config-driven and extensible via TAG_TRANSFORMS.
Source: src/core/transforms.py
Functions
rating_band
function · line 11
rating_band(rating: int) -> str
Bucket a 0–100 rating into a ten-point band label (e.g. "80–89 %").
The top bucket spans 90–100 % so a perfect 100 still lands in a band.
_decade_band
function · line 21
_decade_band(value) -> str
decade_band transform: pull the leading integer and bucket it.
apply_transform
function · line 35
apply_transform(value: str, transform: Optional[str]) -> str
Apply a named tag-schema transform to a value, returning a string.