Skip to main content

## safe_component

# Function safe_component

Source

    fn safe_component(value: &str) -> String

Expand description

Make one part of a cache filename safe to put in a path.

Every part of the name comes from the caller — the item id and image type are taken verbatim from Jellyfin JSON — so none of them may contribute a path separator or a `..`. The rule is the one the image tag has always used (non-alphanumerics become `_`), applied to all three parts, so values that were already safe keep producing exactly the filename they did before.

TRACES: | DR-210 | UT-204